[wp-trac] [WordPress Trac] #9349: Load widgets.php Before Plugins
Because Of New WP_Widget Class
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 16 17:57:01 GMT 2009
#9349: Load widgets.php Before Plugins Because Of New WP_Widget Class
--------------------------+-------------------------------------------------
Reporter: GamerZ | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 2.8
Component: Widgets | Version: 2.8
Severity: normal | Keywords: widgets
--------------------------+-------------------------------------------------
widgets.php is only included when wp_maybe_load_widgets() is called in
/wp-includes/functions.php.
{{{
function wp_maybe_load_widgets() {
if ( !function_exists( 'dynamic_sidebar' ) ) {
require_once( ABSPATH . WPINC . '/widgets.php' );
add_action( '_admin_menu', 'wp_widgets_add_menu' );
}
}
}}}
But in WP2.8 there is a new WP_Widget Class, if I attempt to create a new
Widget Class extending on this class in my plugin, it will prompt me
"Class 'WP_Widget' not found" because the class is not included before the
plugin.
Should we load widgets.php in wp-settings.php? Or we should move the class
portion to new file called class-widgets.php?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9349>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list