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