Yoast\WP\SEO\Integrations\Third_Party
Elementor::get_metabox_script_data() protected Yoast 1.0
Passes variables to js for use with the post-scraper.
{} Это метод класса: Elementor{}
Хуки из метода
Возвращает
Массив.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_metabox_script_data();
Код Elementor::get_metabox_script_data() Elementor::get metabox script data Yoast 15.6.2
protected function get_metabox_script_data() {
$permalink = '';
if ( \is_object( $this->get_metabox_post() ) ) {
$permalink = \get_sample_permalink( $this->get_metabox_post()->ID );
$permalink = $permalink[0];
}
$post_formatter = new WPSEO_Metabox_Formatter(
new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink )
);
$values = $post_formatter->get_values();
/** This filter is documented in admin/filters/class-cornerstone-filter.php. */
$post_types = \apply_filters( 'wpseo_cornerstone_post_types', YoastSEO()->helpers->post_type->get_accessible_post_types() );
if ( $values['cornerstoneActive'] && ! \in_array( $this->get_metabox_post()->post_type, $post_types, true ) ) {
$values['cornerstoneActive'] = false;
}
return $values;
}