Skip to content

Commit

Permalink
Fix Helpers::is_post_edit_page (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadahmad21 authored Oct 14, 2024
1 parent 081ee32 commit dfdcbec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/seven-chefs-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpsocio/wp-utils": patch
---

Fixed Helpers::is_post_edit_page to return false when post type is non-null
2 changes: 1 addition & 1 deletion packages/php/wp-utils/src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function is_post_edit_page( $post_type = null ) {
$is_edit_page = 'post-new.php' === $pagenow || 'post.php' === $pagenow;

if ( $is_edit_page ) {
if ( $post_type ) {
if ( null !== $post_type ) {
return in_array( $typenow, (array) $post_type, true );
}
return true;
Expand Down

0 comments on commit dfdcbec

Please sign in to comment.