Automattic\WooCommerce\Internal\EmailEditor
Integration::is_editor_page()
Check if current page is email editor page.
Method of the class: Integration{}
No Hooks.
Return
true|false
. Whether current page is email editor page.
Usage
$Integration = new Integration(); $Integration->is_editor_page( $is_editor_page ): bool;
- $is_editor_page(true|false) (required)
- Current editor page status.
Integration::is_editor_page() Integration::is editor page code WC 9.8.1
public function is_editor_page( bool $is_editor_page ): bool { if ( $is_editor_page ) { return $is_editor_page; } // We need to check early if we are on the email editor page. The check runs early so we can't use current_screen() here. if ( is_admin() && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are not verifying the nonce here because we are not using the nonce in the function and the data is okay in this context (WP-admin errors out gracefully). $post = get_post( (int) $_GET['post'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are not verifying the nonce here because we are not using the nonce in the function and the data is okay in this context (WP-admin errors out gracefully). return $post && self::EMAIL_POST_TYPE === $post->post_type; } return false; }