Ticket #16545: 16545.2.diff
File 16545.2.diff, 1.4 KB (added by , 14 years ago) |
---|
-
wp-includes/query.php
1312 1312 * @access public 1313 1313 */ 1314 1314 function parse_query_vars() { 1315 $this->parse_query( '');1315 $this->parse_query(); 1316 1316 } 1317 1317 1318 1318 /** … … 1383 1383 * @since 1.5.0 1384 1384 * @access public 1385 1385 * 1386 * @param string|array $query 1386 * @param string|array $query Optional query. 1387 1387 */ 1388 function parse_query( $query) {1389 if ( ! empty($query) || !isset($this->query) ) {1388 function parse_query( $query = '' ) { 1389 if ( ! empty( $query ) ) { 1390 1390 $this->init(); 1391 $this->query = $this->query_vars = wp_parse_args($query); 1391 $this->query = $this->query_vars = wp_parse_args( $query ); 1392 } elseif ( ! isset( $this->query ) ) { 1393 $this->query = $this->query_vars; 1392 1394 } 1393 1395 1394 1396 $this->query_vars = $this->fill_query_vars($this->query_vars); … … 1871 1873 function &get_posts() { 1872 1874 global $wpdb, $user_ID, $_wp_using_ext_object_cache; 1873 1875 1876 $this->parse_query(); 1877 1874 1878 do_action_ref_array('pre_get_posts', array(&$this)); 1875 1879 1876 1880 // Shorthand. … … 2851 2855 * @param string $query URL query string. 2852 2856 * @return array List of posts. 2853 2857 */ 2854 function &query($query) { 2855 $this->parse_query($query); 2858 function &query( $query ) { 2859 $this->init(); 2860 $this->query = $this->query_vars = wp_parse_args( $query ); 2856 2861 return $this->get_posts(); 2857 2862 } 2858 2863