Driving me nuts.
I have a shortcode which works -fine- but for one detail. I won't post the entire thing, but it pulls the content of a post (works fine) then should echo a portion of it to a new DIV in the footer.
I'm doing it this way because, apparently, you can't pass variables to an anonymous function with add_action.
add_shortcode('tooltip', 'tooltip');
function tooltip( $atts, $content=null) {
$output = '...some stuff from another post.';
//...working fine...
do_action( 'jch_tooltip_func', 'text to put in footer' );
// the text arg is never passed to jch_tooltip_func();
return $output;
}
add_action('wp_footer', 'jch_tooltip_func', 100, 1);
function jch_tooltip_func( $d ) {
echo('<p>DIV TEST:' . $d . 'END</p>' );
return($d);
}
...so 'text to put in footer' should be passed to jch_tooltip_func() and then placed my footer via wp_footer. But the argument never gets passed.
Why oh why?
TIA,
---JC