#5612 closed defect (bug) (duplicate)
using wp_register_script generates an error in plugin
| Reported by: | devil1591 | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
19 years ago
- Summary using wp_register_script generates an error → using wp_register_script generates an error in plugin
#3
@
19 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 configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Please provide example code.
Are you calling it before the init hook fires?