WordPress.org

Forums

WP125
scripts are incorrectly enqueued (4 posts)

  1. Paul de Wouters
    Human Made
    Posted 3 years ago #

    Hi

    you should use the wp_enqueue_scripts hook to register your javascripts and stylesheets.

    http://wordpress.org/extend/plugins/wp125/

    also:
    register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead.

  2. redwallhp
    Member
    Plugin Author

    Posted 3 years ago #

    Maybe I'm missing something, but WP125 1.4.1 is using the wp_enqueue_scripts hook to register stylesheets.

    function wp125_stylesheet() {
    	if (get_option("wp125_disable_default_style")=='') {
    		wp_register_style('wp125style', wp125_get_plugin_dir('url').'/wp125.css');
    		wp_enqueue_style('wp125style');
    	}
    }
    add_action('wp_enqueue_scripts', 'wp125_stylesheet');

    When I wrote the plugin initially, I don't think that hook had existed yet. If I remember correctly, I finally got around to updating it around the time WP 3.3 came out.

    The widgets are next on my list.

  3. Paul de Wouters
    Human Made
    Posted 3 years ago #

    sorry about that.
    Actually I meant in the file adminmenus.php.
    I suggest the using admin_enqueue_scripts hook

    I suggest using the plugin Log deprecated notices to check your code, it's pretty useful :)

  4. redwallhp
    Member
    Plugin Author

    Posted 3 years ago #

    Ah, I see now. I don't know how I missed that before.

    And I'll have to take a look at that plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP125
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags