Improve the comment about checking the editor page

[MAILPOET-6090]
This commit is contained in:
Rostislav Wolny
2024-11-14 11:31:28 +01:00
committed by Oluwaseun Olorunsola
parent 33e828f2ed
commit b124ffe596

View File

@@ -62,7 +62,7 @@ class EmailEditor {
if ($isEditorPage) {
return $isEditorPage;
}
// Check on for post 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 ($this->wp->isAdmin() && isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] === 'edit') {
$post = $this->wp->getPost((int)$_GET['post']);
return $post && $post->post_type === self::MAILPOET_EMAIL_POST_TYPE; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps