'', 'scheme' => 'admin', 'query' => array(), ); $args = array_merge( $default_args, $args ); $admin_url = ''; if ( $args['path'] || $args['scheme'] ) { $admin_url = admin_url( $args['path'], $args['scheme'] ); } if ( $args['query'] ) { $admin_url_parsed = wp_parse_url( $admin_url ); if ( is_string( $args['query'] ) ) { $admin_url_parsed['query'] = $args['query']; } elseif ( is_array( $args['query'] ) ) { $admin_url_parsed['query'] = http_build_query( $args['query'] ); } $admin_url = http_build_url( $admin_url_parsed ); } return $admin_url; } }