WPSEO_Admin_Bar_Menu::get_post_focus_keyword()
Gets the focus keyword for a given post.
Метод класса: WPSEO_Admin_Bar_Menu{}
Хуки из метода
Возвращает
Строку
. Focus keyword, or empty string if none available.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_post_focus_keyword( $post );
- $post(WP_Post) (обязательный)
- Post object to get its focus keyword.
Код WPSEO_Admin_Bar_Menu::get_post_focus_keyword() WPSEO Admin Bar Menu::get post focus keyword Yoast 21.1
protected function get_post_focus_keyword( $post ) { if ( ! is_object( $post ) || ! property_exists( $post, 'ID' ) ) { return ''; } /** * Filter: 'wpseo_use_page_analysis' Determines if the analysis should be enabled. * * @api bool Determines if the analysis should be enabled. */ if ( apply_filters( 'wpseo_use_page_analysis', true ) !== true ) { return ''; } return WPSEO_Meta::get_value( 'focuskw', $post->ID ); }