Get the current sidebar id.

@param  string $default Default sidebar to use if a custom one is not specified.
@param  string $meta_key Meta key to check for a custom sidebar id.
@return string
336768
public function getCurrentSidebarId( $default = 'default-sidebar', $meta_key = '_app_custom_sidebar' ) {
		$post_id = $this->getSidebarPostId();
		$sidebar = $default;

		if ( $post_id ) {
			$sidebar = get_post_meta( $post_id, $meta_key, true );
		}

		if ( empty( $sidebar ) ) {
			$sidebar = $default;
		}

		return $sidebar;
	}
688951
public function get($key, $default = '')
    {
        $method = 'get'.$key;

        if (method_exists($this, $method)) {
            return $this->$method($default);
        }

        if (empty($this->metas[$key])) {
            return $default;
        }

        return $this->metas[$key];
    }
127513
public function get( $key, $user_id = null, $single = true, $default = '' ) {
		if ( ! isset( $user_id ) ) {
			$user_id = $this->user_id;
		}
		if ( $user_id <= 0 ) {
			return $this->apply_filters( 'get_user_meta', $default, $key, $user_id, $single, $default );
		}

		return $this->apply_filters( 'get_user_meta', get_user_meta( $user_id, $this->get_meta_key( $key ), $single ), $key, $user_id, $single, $default, $this->get_user_prefix() );
	}
775519
public function getMeta($key, $default = null, $getObj = false)
    {
        $meta = $this->meta()
            ->where('key', $key)
            ->get();

        if ($getObj) {
            $collection = $meta;

        } else {
            $collection = new Collection();

            foreach ($meta as $m) {
                $collection->put($m->id, $m->value);
            }
        }

        // Were there no records? Return NULL if no default provided
        if (0 == $collection->count()) {
            return $default;
        }

        return $collection->count() <= 1 ? $collection->first() : $collection;
    }
414962
public static function get_widget_count($sidebar_id)
    {
        global $_wp_sidebars_widgets;

        // If not front page, the global is empty so set it another way.
        if (empty($_wp_sidebars_widgets)) {
            $_wp_sidebars_widgets = \get_option('sidebars_widgets', []);
        }

        // if our sidebar exists, return count.
        if (isset($_wp_sidebars_widgets[ $sidebar_id ])) {
            return \count($_wp_sidebars_widgets[ $sidebar_id ]);
        }

        return 0;
    }
508704
private function _getConfig(string $key, $default = null)
    {
        if (isset($this->_config[$key])) {
            return $this->_config[$key];
        }

        return $default;
    }
881542
public function getMetaData(string $key, $default = null)
    {
        $meta = $this->getAttribute('meta');

        return $meta->get($key, $default);
    }
999654
public function getParam($key = null, $default = null)
    {
        if (null === $key) {
            return $this->data[self::P_PARAMS];
        }

        return $this->hasParam($key) ? $this->data[self::P_PARAMS][$key] : $default;
    }
932181
public function current()
    {
        list($name, $content) = $this->members[$this->pointer];
        if (is_a($content, ViewHelperInterface::class)) {
            /** @var $content ViewHelperInterface */
            return $content->__toString();
        }
        switch ($name) {
            case 'charset':
                return "<meta {$name}=\"{$content}\">";
            case 'base':
                return "<base href=\"{$content}\" />";
            default:
                return "<meta name=\"{$name}\" content=\"{$content}\">";
        }
    }
990375
function getPost($key = null, $default = null)
    {
        if (!$this->post)
            $this->setPost($_POST);

        if ($key !== null)
            return $this->post->get($key, $default);

        return $this->post;
    }
611781
public function getSidebar($sidebar_name)
    {
        $registered_sidebars = json_decode($this->drivers->getDriver()->wpcli('sidebar', 'list', [
            '--format=json',
        ])['stdout']);

        $sidebar_id = null;

        foreach ($registered_sidebars as $sidebar) {
            if ($sidebar_name === $sidebar->name) {
                $sidebar_id = $sidebar->id;
                break;
            }
        }

        if ($sidebar_id === null) {
            throw new UnexpectedValueException(sprintf('[W506] Sidebar "%s" does not exist', $sidebar_name));
        }

        return $sidebar_id;
    }
864150
public function getMeta(string $key, $default = null)
    {
        if ($this->hasMeta($key)) {
            return $this->getMetaRecord($key)->getAttribute('value');
        }

        return $default;
    }
83217
public function col_post_meta( string $meta_key, array $args ) {

		$vals = get_post_meta( get_the_ID(), $meta_key, false );
		$echo = [];
		sort( $vals );

		if ( isset( $args['date_format'] ) ) {

			if ( true === $args['date_format'] ) {
				$args['date_format'] = get_option( 'date_format' );
			}

			foreach ( $vals as $val ) {
				$val_time = strtotime( $val );

				if ( $val_time ) {
					$val = $val_time;
				}

				if ( is_numeric( $val ) ) {
					$echo[] = date_i18n( $args['date_format'], $val );
				} elseif ( ! empty( $val ) ) {
					$echo[] = mysql2date( $args['date_format'], $val );
				}
			}
		} else {

			foreach ( $vals as $val ) {

				if ( ! empty( $val ) || ( '0' === $val ) ) {
					$echo[] = $val;
				}
			}
		}

		if ( empty( $echo ) ) {
			echo '&#8212;';
		} else {
			echo esc_html( implode( ', ', $echo ) );
		}

	}
820645
public function getMeta($posts_id)
    {
        if (!is_array($posts_id)) {
            $posts_id = [$posts_id];
        }

        array_map([$this, 'checkId'], $posts_id);

        return $this->adapter->get(sprintf('/posts/meta?ids=%s', implode(',', $posts_id)));
    }
765177
protected function get_flag($key, $default = null)
    {
        return \WP_CLI\Utils\get_flag_value($this->args->original(), $key, $default);
    }
832468
public function getValue($key, $default = null)
    {
        $meta = $this->meta;

        if (isset($meta[$key])) {
            return $meta[$key];
        }

        return $default;
    }
553525
public function getFrontendViewParameter($key, $default = null)
    {
        return array_key_exists($key, $this->frontendViewParameters) ? $this->frontendViewParameters[$key] : $default;
    }