Advertisement
casben79

wpp_get_mostpopular Update

Apr 3rd, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. function wpp_get_mostpopular($args = NULL, $return = false) {
  2.  
  3.     if ( is_null( $args ) ) {
  4.         echo do_shortcode('[wpp]');
  5.     } else {
  6.             if( is_array( $args ) ){
  7.                 $atts = '';
  8.                 foreach( $args as $key => $arg ){
  9.                     $atts .= $key . '="' . $arg . '"';
  10.                 }
  11.             } else {
  12.                 $atts = trim( str_replace( "&", " ", $args  ) );
  13.             }
  14.            
  15.             $out = do_shortcode( '[wpp '.$atts.']' );
  16.            
  17.             if( $return )
  18.                 return $out;
  19.            
  20.             echo $out;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement