Can someone help me fix this error?
PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts
, admin_enqueue_scripts
, or login_enqueue_scripts
hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /nas/content/live/greattaste/wp-includes/functions.php on line 4986
code:
function wp_auth_check_load() {
if ( ! is_admin() && ! is_user_logged_in() ) {
return;
}
if ( defined( 'IFRAME_REQUEST' ) ) {
return;
}
$screen = get_current_screen();
$hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
$show = ! in_array( $screen->id, $hidden );
/**
* Filters whether to load the authentication check.
*
* Passing a falsey value to the filter will effectively short-circuit
* loading the authentication check.
*
* @since 3.6.0
*
* @param bool $show Whether to load the authentication check.
* @param WP_Screen $screen The current screen object.
*/
if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {
wp_enqueue_style( 'wp-auth-check' );
wp_enqueue_script( 'wp-auth-check' );
add_action( 'admin_print_footer_scripts', 'wp_auth_check_html', 5 );
add_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 );
}
}
wp_auth_check_load
? Is it attached to a hook? such asadd_action( 'init', 'wp_auth_check_load' );
?wp_auth_check_load
wp_auth_check_load
is a function in WP core, are you making edits and modifications to the WP core files?! This is very dangerous, bad practice, and should never be done. All your changes will be lost when you update WordPress. If you want to make changes to WP behaviour or add new functionality, you should use plugins and hooks/filters like everybody else