Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

wpp_get_mostpopular Update

By: casben79 on Apr 3rd, 2012  |  syntax: PHP  |  size: 0.60 KB  |  views: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }