WPSEO_Taxonomy_Columns::get_taxonomy()privateYoast 1.0

Returns the posted/get taxonomy value if it is set.

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

Хуков нет.

Возвращает

Строку|null.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_taxonomy();

Код WPSEO_Taxonomy_Columns::get_taxonomy() Yoast 22.4

private function get_taxonomy() {
	// phpcs:disable WordPress.Security.NonceVerification.Missing,WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
	if ( wp_doing_ajax() ) {
		if ( isset( $_POST['taxonomy'] ) && is_string( $_POST['taxonomy'] ) ) {
			return sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) );
		}
	}
	elseif ( isset( $_GET['taxonomy'] ) && is_string( $_GET['taxonomy'] ) ) {
		return sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) );
	}
	// phpcs:enable WordPress.Security.NonceVerification.Missing,WordPress.Security.NonceVerification.Recommended
	return null;
}