WPSEO_Primary_Term::set_primary_term()publicYoast 1.0

Sets the new primary term ID.

Метод класса: WPSEO_Primary_Term{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$WPSEO_Primary_Term = new WPSEO_Primary_Term();
$WPSEO_Primary_Term->set_primary_term( $new_primary_term );
$new_primary_term(int) (обязательный)
New primary term ID.

Код WPSEO_Primary_Term::set_primary_term() Yoast 22.3

public function set_primary_term( $new_primary_term ) {
	update_post_meta( $this->post_ID, WPSEO_Meta::$meta_prefix . 'primary_' . $this->taxonomy_name, $new_primary_term );
}