WPSEO_Taxonomy::localize_term_scraper_script
Pass variables to js for use with the term-scraper.
Метод класса: WPSEO_Taxonomy{}
Хуков нет.
Возвращает
Массив.
Использование
$WPSEO_Taxonomy = new WPSEO_Taxonomy(); $WPSEO_Taxonomy->localize_term_scraper_script( $term_id );
- $term_id(int) (обязательный)
- The ID of the term to localize the script for.
Код WPSEO_Taxonomy::localize_term_scraper_script() WPSEO Taxonomy::localize term scraper script Yoast 26.9
public function localize_term_scraper_script( $term_id ) {
$term = get_term_by( 'id', $term_id, $this::get_taxonomy() );
$taxonomy = get_taxonomy( $term->taxonomy );
$term_formatter = new WPSEO_Metabox_Formatter(
new WPSEO_Term_Metabox_Formatter( $taxonomy, $term )
);
return $term_formatter->get_values();
}