WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

Yoast\WP\SEO\Integrations\Watchers

Primary_Term_Watcher::save_primary_terms() public Yoast 1.0

Saves all selected primary terms.

{} Это метод класса: Primary_Term_Watcher{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$Primary_Term_Watcher = new Primary_Term_Watcher();
$Primary_Term_Watcher->save_primary_terms( $post_id );
$post_id(int) (обязательный)
Post ID to save primary terms for.

Код Primary_Term_Watcher::save_primary_terms() Yoast 16.8

<?php
public function save_primary_terms( $post_id ) {
	// Bail if this is a multisite installation and the site has been switched.
	if ( $this->site->is_multisite_and_switched() ) {
		return;
	}

	$taxonomies = $this->primary_term->get_primary_term_taxonomies( $post_id );

	foreach ( $taxonomies as $taxonomy ) {
		$this->save_primary_term( $post_id, $taxonomy );
	}

	$this->primary_term_builder->build( $post_id );
}