Advertisement
Guest User

add_query_arg() should include using get_option('siteurl')

a guest
Jun 2nd, 2011
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  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_option('siteurl') != '' )
  7.                         {
  8.                                 $uri = get_option('siteurl') . $_SERVER['REQUEST_URI'];
  9.                         }
  10.                         else
  11.                         {
  12.                                 $uri = $_SERVER['REQUEST_URI'];
  13.                         }
  14.                 else
  15.                         $uri = @func_get_arg( 1 );
  16.         } else {
  17.                 if ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )
  18.                         if ( get_option('siteurl') != '' )
  19.                         {
  20.                                 $uri = get_option('siteurl') . $_SERVER['REQUEST_URI'];
  21.                         }
  22.                         else
  23.                         {
  24.                                 $uri = $_SERVER['REQUEST_URI'];
  25.                         }
  26.                 else
  27.                         $uri = @func_get_arg( 2 );
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement