Ticket #16303: 16303.ep-docs.diff
File 16303.ep-docs.diff, 2.5 KB (added by , 13 years ago) |
---|
-
wp-includes/rewrite.php
202 202 /** 203 203 * Add an endpoint, like /trackback/. 204 204 * 205 * The endpoints are added to the end of the request. So a requestmatching206 * "/2008/10/14/my_post/myep/", the endpoint will be "/myep/".205 * Adding an endpoint creates extra rewrite rules for each of the matching 206 * places specified by the provided bitmask. For example: 207 207 * 208 * Be sure to flush the rewrite rules (wp_rewrite->flush_rules()) when your plugin gets 209 * activated (register_activation_hook()) and deactivated (register_deactivation_hook()) 208 * <code> 209 * add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES ); 210 * </code> 210 211 * 212 * will add a new rewrite rule ending with "json(/(.*))?/?$" for every permastruct 213 * that describes a permalink (post) or page. This is rewritten to "json=$match" 214 * where $match is the part of the URL matched by the endpoint regex (e.g. "foo" in 215 * "<permalink>/json/foo/"). 216 * 217 * A new query var with the same name as the endpoint will also be created. 218 * 219 * Be sure to flush the rewrite rules - flush_rewrite_rules() - when your plugin gets 220 * activated and deactivated. 221 * 211 222 * @since 2.1.0 212 * @see WP_Rewrite::add_endpoint() Parameters and more description.213 * @ uses$wp_rewrite223 * @see WP_Rewrite::add_endpoint() 224 * @global object $wp_rewrite 214 225 * 215 * @param unknown_type $name216 * @param unknown_type $places226 * @param string $name Name of the endpoint. 227 * @param int $places Endpoint mask describing the places the endpoint should be added. 217 228 */ 218 function add_rewrite_endpoint( $name, $places) {229 function add_rewrite_endpoint( $name, $places ) { 219 230 global $wp_rewrite; 220 $wp_rewrite->add_endpoint( $name, $places);231 $wp_rewrite->add_endpoint( $name, $places ); 221 232 } 222 233 223 234 /** … … 1802 1813 /** 1803 1814 * Add an endpoint, like /trackback/. 1804 1815 * 1805 * To be inserted after certain URL types (specified in $places).1816 * See {@link add_rewrite_endpoint()} for full documentation. 1806 1817 * 1818 * @see add_rewrite_endpoint() 1807 1819 * @since 2.1.0 1808 1820 * @access public 1821 * @uses WP::add_query_var() 1809 1822 * 1810 * @param string $name Name of endpoint.1811 * @param array $places URL types that endpoint can be used.1823 * @param string $name Name of the endpoint. 1824 * @param int $places Endpoint mask describing the places the endpoint should be added. 1812 1825 */ 1813 1826 function add_endpoint($name, $places) { 1814 1827 global $wp;