Yoast\WP\SEO\Conditionals\Third_Party

Elementor_Edit_Conditional::is_met()publicYoast 1.0

Returns whether this conditional is met.

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

Хуков нет.

Возвращает

true|false. Whether the conditional is met.

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

$Elementor_Edit_Conditional = new Elementor_Edit_Conditional();
$Elementor_Edit_Conditional->is_met();

Код Elementor_Edit_Conditional::is_met() Yoast 22.1

public function is_met() {
	global $pagenow;

	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
	if ( isset( $_GET['action'] ) && \is_string( $_GET['action'] ) ) {
		// phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
		$get_action = \wp_unslash( $_GET['action'] );
		if ( $pagenow === 'post.php' && $get_action === 'elementor' ) {
			return true;
		}
	}

	// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We are not processing form information.
	if ( isset( $_POST['action'] ) && \is_string( $_POST['action'] ) ) {
		// phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
		$post_action = \wp_unslash( $_POST['action'] );
		return \wp_doing_ajax() && $post_action === 'wpseo_elementor_save';
	}

	return false;
}