This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 3rd, 2011  |  syntax: PHP  |  size: 0.88 KB  |  views: 66  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function add_query_arg() {
  2.         $ret = '';
  3.  
  4.         if ( is_array( func_get_arg(0) ) ) {
  5.                 if ( @func_num_args() < 2 || false === @func_get_arg( 1 ) )
  6.                         if ( get_bloginfo('url') != '' )
  7.                                 $uri = bloginfo('url') . $_SERVER['REQUEST_URI'];
  8.                         else
  9.                                 $uri = $_SERVER['REQUEST_URI'];
  10.                 else
  11.                         $uri = @func_get_arg( 1 );
  12.         } else {
  13.                 if ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )
  14.                         if ( get_bloginfo('url') != '' )
  15.                                 $uri = bloginfo('url') . $_SERVER['REQUEST_URI'];
  16.                         else
  17.                                 $uri = $_SERVER['REQUEST_URI'];
  18.                 else
  19.                         $uri = @func_get_arg( 2 );
  20.         }
clone this paste RAW Paste Data