Advertisement
phpface

Add [custom_tags_cloud] shortcode

Mar 22nd, 2022 (edited)
1,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. /**
  2.  *
  3.  * Add [custom_tags_cloud] shortcode
  4.  *
  5.  */
  6. add_shortcode( 'custom_tags_cloud', function( $attrs = array(), $content = '' ){
  7.  
  8.     $attrs = wp_parse_args( $attrs, array(
  9.         'taxonomy'      =>  'video_tag',
  10.         'number'        =>  100,
  11.         'show_count'    =>  true,
  12.         'echo'          =>  false
  13.     ) );
  14.  
  15.     return sprintf(
  16.         '<div class="tagcloud">%s</div>',
  17.         wp_tag_cloud( $attrs )
  18.     );
  19.  
  20. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement