Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute Hooks on pages without Hooks.
#6
More on this...
What do you think would be better?

Code:
if (...) {
    add_action('footer','your_function');
}

function your_function() {
  // code...
}

Or this:

Code:
add_action('footer','your_function');

function your_function() {
  if (...) {
    // code...
  }
}

First is like Mike's tip. In the second one the check for the current page is done inside the hooked function.
Reply


Messages In This Thread
Execute Hooks on pages without Hooks. - by Carlos - 2011-06-15, 06:23:33
Execute Hooks on pages without Hooks. - by Carlos - 2011-06-15, 07:28:40
Execute Hooks on pages without Hooks. - by Carlos - 2011-06-15, 07:35:28



Users browsing this thread: 1 Guest(s)