wpseo_set_ignore()Yoast 1.0

Function used to remove the admin notices for several purposes, dies on exit.

Хуков нет.

Возвращает

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

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

wpseo_set_ignore();

Код wpseo_set_ignore() Yoast 22.4

function wpseo_set_ignore() {
	if ( ! current_user_can( 'manage_options' ) ) {
		die( '-1' );
	}

	check_ajax_referer( 'wpseo-ignore' );

	if ( ! isset( $_POST['option'] ) || ! is_string( $_POST['option'] ) ) {
		die( '-1' );
	}

	$ignore_key = sanitize_text_field( wp_unslash( $_POST['option'] ) );
	WPSEO_Options::set( 'ignore_' . $ignore_key, true );

	die( '1' );
}