Skip to content

Commit

Permalink
Check for global var from core, fix #165
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge committed May 3, 2024
1 parent 8592f82 commit fc2e13a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion adminimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,12 @@ function _mw_adminimize_set_metabox_cp_option() {
$post_id = (int) $_POST[ 'post_ID' ];
}

$current_post_type = $GLOBALS[ 'post_type' ];
if ( ! isset( $GLOBALS[ 'post_type' ] ) || empty( $GLOBALS[ 'post_type' ] ) ) {
$current_post_type = get_post_type();
} else {
$current_post_type = $GLOBALS[ 'post_type' ];
}

if ( ! isset( $current_post_type ) ) {
$current_post_type = get_post_type( $post_id );
}
Expand Down

0 comments on commit fc2e13a

Please sign in to comment.