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

Yoast\WP\SEO\Integrations\Watchers

Primary_Term_Watcher::delete_primary_terms() public Yoast 1.0

Deletes primary terms for a post.

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

Хуков нет.

Возвращает

null.

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

$Primary_Term_Watcher = new Primary_Term_Watcher();
$Primary_Term_Watcher->delete_primary_terms( $post_id );
$post_id(число) (обязательный)
The post to delete the terms of.

Код Primary_Term_Watcher::delete_primary_terms() Yoast 15.6.2

<?php
public function delete_primary_terms( $post_id ) {
	foreach ( $this->primary_term->get_primary_term_taxonomies( $post_id ) as $taxonomy ) {
		$primary_term = $this->repository->find_by_post_id_and_taxonomy( $post_id, $taxonomy->name, false );

		if ( ! $primary_term ) {
			continue;
		}

		$primary_term->delete();
	}
}