Wp Plugin Question

Discussion in 'PHP' started by stephan2307, Jan 29, 2013.

  1. #1
    I am writing a custom plugin.

    What I am looking for at the moment is a way to run a function to change the html of the page AFTER it has been fully build but BEFORE it is being sent to the browser. I want to make sure that my plugins function is the last thing that runs. No other plugin should run after my code.

    Can anyone help
     
    stephan2307, Jan 29, 2013 IP
  2. Mano2

    Mano2 Greenhorn

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    maybe you can use the $priority arg of the add_filter/add_action function, and the 'plugins_loaded' hook ("Runs after all plugins have been loaded. ")
     
    Mano2, Jan 29, 2013 IP
  3. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #3
    Just from a quick google, I stumbled across
    http://wordpress.org/support/topic/how-to-change-plugins-load-order
    There appears to be a way to specify the order in which the actions of plugins run.
    add_action( 'hook_name', 'callback_name' ); // Default third value of 10
    ..or..
    add_action( 'hook_name', 'callback_name', 100 );
    ..or..
    add_filter( 'hook_name', 'callback_name' ); // Default third value of 10
    ..or..
    add_filter( 'hook_name', 'callback_name', 100 );
    Code (markup):
    Just read the thread and see if it is of any use. Generally, they will run after the content has been gained. So set the priority to a large number

    The specific comment is http://wordpress.org/support/topic/how-to-change-plugins-load-order#post-1564605
     
    Last edited: Jan 29, 2013
    Grit., Jan 29, 2013 IP