Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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:


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();

Change History (7)

comment:1 @devil15918 years ago

  • Summary changed from using wp_register_script generates an error to using wp_register_script generates an error in plugin

comment:2 @westi8 years ago

  • Keywords reporter-feeback added
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Please provide example code.

Are you calling it before the init hook fires?

comment:3 @devil15918 years ago

Using this sample plugin i'm getting the error.

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();


comment:4 @devil15918 years ago

  • Keywords reporter-feeback removed

comment:5 @lloydbudd8 years ago

  • Cc mdawaffe added

Relates to #5605.

comment:6 @mdawaffe8 years ago

  • Resolution set to duplicate
  • Status changed from assigned to closed

I'm going to call this a duplicate of #5605 even though this one correctly diagnoses the problem :) Thanks!

comment:7 @Nazgul8 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.