I tried to trace the root of the problem.
I found that this problem arises because the module Advanced Access Manager (aam) overriding wp_die function:
// wp die hook
add_filter ('wp_die_handler', array ($ this, 'wpDie'), 10);
As a result, any errors that occur on the backend will be handled by the wpDie function
(example: upload a file that is not an image as a background on the menu appreance: Background):
???? public function wpDie ($ function) {
???????? $ redirect = aam_Core_ConfigPress :: getParam ('backend.access.deny.redirect');
???????? $ message = aam_Core_ConfigPress :: getParam (
???????????????????????? 'backend.access.deny.message', __ ('Access Denied', 'aam')
???????? );
????????
???????? if (filter_var ($ redirect, FILTER_VALIDATE_URL)) {
???????????? wp_redirect ($ redirect);
???????????? exit;
???????? } Elseif (is_int ($ redirect)) {
???????????? wp_redirect (get_post_permalink ($ redirect));
???????????? exit;
???????? } Else {
???????????? call_user_func ($ function, $ message, '', array ());
???????? }
???? }
As you can can see, this function will generate an error ‘Access Denied’
For temporary solution, I suggest making this line as a comment:
add_filter (‘wp_die_handler’, array ($ this, ‘wpDie’), 10);
I will try to ask the purpose of the filter wp die hook aam forum.