WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Plugin priority? (3 posts)

  1. KidCactus
    Member
    Posted 3 years ago #

    I have two plugins installed that automatically add things after the posts; related posts (Microkid's Related Posts) and share buttons (Sociable for WordPress 3.0).

    At the moment they appear in the following order: post, related, share. I want them to appear in this order: post, share, related.

    What tells WP to insert them in this order when it's done automatically, is there some priority that is easy to change?

  2. KidCactus
    Member
    Posted 3 years ago #

    Never mind, found how to do it. I changed the the_content prio in Sociable3.php to 1, and now I get my buttons where I want them.

  3. caugb
    Member
    Posted 3 years ago #

    There is another way to do this.. the plugins are loaded following the sequence of the array stored in 'active_plugins' option.

    This function keeps my plugin in the first place to be loaded.

    function mw_load_first($plugin = '') {
    $plugs = get_option('active_plugins');
    $nplugs = array();
      foreach($plugs as $plug) {
        if(strstr($plug, 'media-window')) $mw = $plug;
        else $nplugs[] = $plug;
      }
      if(isset($mw)) {
        array_unshift($nplugs, $mw);
        update_option('active_plugins', $nplugs);
      }
    }
    add_action('activated_plugin', 'mw_load_first');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.