Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#5612 closed defect (bug) (duplicate)

using wp_register_script generates an error in plugin

Reported by: devil1591's profile devil1591 Owned by: westi's profile 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)

#1 @devil1591
14 years ago

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

#2 @westi
14 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?

#3 @devil1591
14 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();


#4 @devil1591
14 years ago

  • Keywords reporter-feeback removed

#5 @lloydbudd
14 years ago

  • Cc mdawaffe added

Relates to #5605.

#6 @mdawaffe
14 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!

#7 @Nazgul
14 years ago

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