Add check if global $current_screen is set
-
Hi,
Inside the method
add_checkbox_auto_protect_file
there should be an extra check if$screen
is set.The method is checking if
get_current_screen()
exists but in case thatscreen.php
is included elsewhere this check is not enough.Unfortunately this has led to a conflict with another plugin causing the following error: “Trying to get property ‘id’ of non-object”
Is there anywhere I could open up a pull request?
Adding the check
isset($screen)
insideadd_checkbox_auto_protect_file
would solve the problem:if (isset($screen) && 'media' === $screen->id && 'add' == $screen->action) { // }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add check if global $current_screen is set’ is closed to new replies.