Ticket #25143: 25143.4.patch
File 25143.4.patch, 1.8 KB (added by , 10 years ago) |
---|
-
src/wp-includes/rewrite.php
248 248 * 249 249 * @param string $name Name of the endpoint. 250 250 * @param int $places Endpoint mask describing the places the endpoint should be added. 251 * @param string $query_var Name of the corresponding query variable. Defaults to $name.251 * @param bool $add_query_var Whether or not to register the query var. Default is true. 252 252 */ 253 function add_rewrite_endpoint( $name, $places, $query_var = null) {253 function add_rewrite_endpoint( $name, $places, $query_var = true ) { 254 254 global $wp_rewrite; 255 255 $wp_rewrite->add_endpoint( $name, $places, $query_var ); 256 256 } … … 1964 1964 * @see add_rewrite_endpoint() for full documentation. 1965 1965 * @uses WP::add_query_var() 1966 1966 * 1967 * @param string $name Name of the endpoint.1968 * @param int $places Endpoint mask describing the places the endpoint should be added.1969 * @param string $query_var Name of the corresponding query variable. Default is value of $name.1967 * @param string $name Name of the endpoint. 1968 * @param int $places Endpoint mask describing the places the endpoint should be added. 1969 * @param string $query_var Name of the corresponding query variable. Default is value of $name. 1970 1970 */ 1971 public function add_endpoint( $name, $places, $query_var = null) {1971 public function add_endpoint( $name, $places, $query_var = true ) { 1972 1972 global $wp; 1973 if ( null === $query_var ) { 1973 1974 if ( true === $query_var ) { 1974 1975 $query_var = $name; 1975 1976 } 1976 1977 $this->endpoints[] = array( $places, $name, $query_var ); 1977 $wp->add_query_var( $query_var ); 1978 1979 if( $query_var ) { 1980 $wp->add_query_var( $query_var ); 1981 } 1978 1982 } 1979 1983 1980 1984 /**