Yoast\WP\SEO\Integrations\Third_Party
Elementor::get_metabox_post() protected Yoast 1.0
Returns post in metabox context.
{} Это метод класса: Elementor{}
Хуков нет.
Возвращает
WP_Post/null.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_metabox_post();
Код Elementor::get_metabox_post() Elementor::get metabox post Yoast 15.6.2
protected function get_metabox_post() {
if ( $this->post !== null ) {
return $this->post;
}
$post = \filter_input( INPUT_GET, 'post' );
if ( ! empty( $post ) ) {
$post_id = (int) WPSEO_Utils::validate_int( $post );
$this->post = \get_post( $post_id );
return $this->post;
}
if ( isset( $GLOBALS['post'] ) ) {
$this->post = $GLOBALS['post'];
return $this->post;
}
return null;
}