Pass Variable to function in add_action()
-
So, I’ve got a hook declared already, I’m trying to add a function call to that hook, and pass a variable:
add_action(‘wp_hook_sidebar’, ‘displayAd($passedtext)’);then i’ve got the function:
function displayAd($passedText)
{
echo $passedText;
}The text doesn’t get passed to the function though. I know that’s not the way it works based on a couple of previous threads I found:
https://www.ads-software.com/support/topic/155337
and
https://www.ads-software.com/support/topic/166587But, neither of those threads provide an answer. Anybody got a clue how I can get that variable passed? This is driving me nuts
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pass Variable to function in add_action()’ is closed to new replies.