Guest User

Untitled

a guest
Nov 14th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. [box] Text [/box]
  2.  
  3. <div class="box">&nbsp; Text &nbsp;</div>
  4.  
  5. function infoButton($atts, $content = null) {
  6. extract( shortcode_atts( array(
  7.  
  8. 'class' => '',
  9.  
  10. ), $atts ));
  11.  
  12. $str = '<div class="box ' . $class . '">' . do_shortcode($content) . '</div>';
  13. $new_str = str_replace('&nbsp;','',$str);
  14.  
  15. return $new_str;
  16.  
  17. }
  18. add_shortcode('box', 'infoButton');
  19.  
  20. function infoButton($atts, $content = null) {
  21. extract( shortcode_atts( array(
  22.  
  23. 'class' => '',
  24.  
  25. ), $atts ));
  26.  
  27. $str = '<div class="box ' . $class . '">' . do_shortcode( trim( $content ) ) . '</div>';
  28.  
  29. return $str;
  30.  
  31. }
  32. add_shortcode('box', 'infoButton');
Add Comment
Please, Sign In to add comment