#5612 closed defect (bug) (duplicate)
using wp_register_script generates an error in plugin
Reported by: | devil1591 | Owned by: | westi |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Hi there,
I'm using using lastest svn r6582
When I use wp_register_script inside a plugin, and it generates an error and it wasn't last week :
Fatal error: Call to undefined function: wp_get_current_user() in wp-includes\user.php on line 30.
Same error if I use this inside a plugin :
$wp_scripts = new WP_Scripts(); $wp_scripts->dequeue('tiny_mce');
Change History (7)
#1
@
17 years ago
- Summary changed from using wp_register_script generates an error to using wp_register_script generates an error in plugin
#2
@
17 years ago
- Keywords reporter-feeback added
- Owner changed from anonymous to westi
- Status changed from new to assigned
#3
@
17 years ago
Using this sample plugin i'm getting the error.
<?php /* Plugin Name: BUG TEST Version: 1.0 */ wp_register_script('jscalendar', get_bloginfo('template_directory').'/js/jscalendar/calendar_stripped.js', array(), '1.51'); // this is buggy too /* $wp_scripts = new WP_Scripts(); $wp_scripts->dequeue('tiny_mce'); */ ?>
Note: See
TracTickets for help on using
tickets.
Please provide example code.
Are you calling it before the init hook fires?