Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i cant access my dashboard. after i make true the wp-debug it shows the following error.

Notice: wp_register_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.) in /var/www/html/enteopinion/wp-includes/functions.php on line 3012 

what should i do to make the site dashboard to work well? i used a plugin simple error handler.it shows the following errors.

Error trapped: USER NOTICE(1024), wp_register_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.)
 /var/www/html/enteopinion/wp-includes/functions.php[3012]
 /var/www/html/enteopinion/wp-includes/functions.wp-scripts.php[57]
 /var/www/html/enteopinion/wp-settings.php[197]
 /var/www/html/enteopinion/wp-config.php[90]
 /var/www/html/enteopinion/wp-load.php[29]
 /var/www/html/enteopinion/wp-admin/admin.php[30]
 /var/www/html/enteopinion/wp-admin/plugins.php[10]

what to do with these errors? :( please help me

share|improve this question
    
The notice (not error) that you're seeing isn't likely the cause of your inability to to access the dashboard (but it does need to be fixed). Take a look at your error logs to see if there are any other clues - i.e. actual errors that will point you in the direction. –  Will the Web Mechanic Dec 30 '13 at 8:12
    
and by 'forbidden' to you mean 403 error? Check file permissions and web server configuration. –  Will the Web Mechanic Dec 30 '13 at 8:14
    
yeah.. it shows "you dont have permission to access the file /wp-admin/widgets.php" etc. but when i refresh the site again it displays the actual dashboard. but there is some unusual things in the site due to this notice.i mean by unusual is the live site shows elements in different positions on each page refreshment. –  Ammu Dec 30 '13 at 8:21
    
Check this out –  Subharanjan Dec 30 '13 at 9:47

1 Answer 1

Here is the short sweet answer.

Somewhere you, a plugin, or your theme are doing something like this:

wp_register_script( 'myscript', get_template_directory_uri() . '/path/to/myscript.js', '', '', true );

What should be happening is this:

add_action(
  'wp_enqueue_scripts',
  function() {
    wp_register_script( 'myscript', get_template_directory_uri() . '/path/to/myscript.js', '', '', true );
  }
);

From the Notice:

Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks

In other words, somewhere scripts are being registered prematurely. By hooking to one of the hooks listed in the Notice, or any hook after those run, you ensure that the scripts are registered when they should be and not before.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.