Advertisement
sgaffney

do_action test

Dec 1st, 2011
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. I am using a textarea so the user can input html code such as:
  2. <div class="xyz" id="abc"></div>
  3.  
  4. I am storing the above in the smof panel below. Basically I am trying to write a function with a hook that will go in my plugin custom-functions.php file
  5.  
  6. This works: and outputs the value stored in 'wptumble_custom_output_content_wrapper'
  7. <?php (stripslashes($tumbledata['wptumble_custom_output_content_wrapper'])); ?>
  8.  
  9.  
  10. This does NOT work. It only outputs 'xxx'
  11. I did the XXX to make sure that all the functions wrapping around it are working properly.
  12. <?php
  13.  
  14. if($tumbledata['custom_main_content'] == 1) {
  15.  
  16.     add_action( 'wptumble_before_main_content_new', 'wptumble_custom_output_content_wrapper_new', 10 );
  17.  
  18.     // Fix the layout etc
  19.     if (!function_exists('wptumble_custom_output_content_wrapper_new')) {
  20.         function wptumble_custom_output_content_wrapper_new() {
  21.             echo 'xxx';
  22.             echo (stripslashes($tumbledata['wptumble_custom_output_content_wrapper']));
  23.  
  24.         }
  25.     }
  26.  
  27.  
  28. }
  29. ?>
  30. <?php do_action('wptumble_before_main_content_new');  ?>
  31.  
  32. the above action outputs only 'xxx'. It is not outputting the $tumbledata. I have narrowed the problem down to that one single line of code, but can't figure out how to change it to make it work.
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement