WPSEO_Slug_Change_Watcher::detect_term_delete()publicYoast 1.0

Shows a message when a term is about to get deleted.

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

Хуков нет.

Возвращает

null. Ничего.

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

$WPSEO_Slug_Change_Watcher = new WPSEO_Slug_Change_Watcher();
$WPSEO_Slug_Change_Watcher->detect_term_delete( $term_id );
$term_id(int) (обязательный)
The term ID that will be deleted.

Код WPSEO_Slug_Change_Watcher::detect_term_delete() Yoast 19.7.1

public function detect_term_delete( $term_id ) {
	if ( ! $this->is_term_viewable( $term_id ) ) {
		return;
	}

	$first_sentence = sprintf(
		/* translators: 1: term label */
		__( 'You just deleted a %1$s.', 'wordpress-seo' ),
		$this->get_taxonomy_label_for_term( $term_id )
	);

	$message = $this->get_message( $first_sentence );

	$this->add_notification( $message );
}