Critical error after updating my wordpress

If you are using WordPress 5.2 or newer, then the site should by default send a fatal error notification email to your admin email address. The email should have some sort of stack trace in it, which shows where the error occured. Then either login to the site using the recovery mode link found on … Read more

Customizing login message

You can use a variation of this code to change invalid login messages (adjust the message to your needs; but see note below): add_filter(‘login_errors’, function ($error) { global $errors; $err_codes = $errors->get_error_codes(); // Invalid username. if (in_array(‘invalid_username’, $err_codes)) { $error=”<strong>ERROR</strong>: Sorry, that is incorrect.”; } // Incorrect password. if (in_array(‘incorrect_password’, $err_codes)) { $error=”<strong>ERROR</strong>: Sorry, that … Read more

Core error when calling remove_menu_page

The error line comes from the following in wp-admin/includes/plugin.php: function remove_menu_page( $menu_slug ) { global $menu; foreach ( $menu as $i => $item ) { if ( $menu_slug === $item[2] ) { unset( $menu[ $i ] ); return $item; } } return false; } The global $menu does not actually get populated until the wp-admin/menu-header.php … Read more