Changeset 19753
- Timestamp:
- 01/25/2012 09:58:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/rewrite.php
r19752 r19753 102 102 } 103 103 104 //pseudo-places105 104 /** 106 105 * Endpoint Mask for default, which is nothing. … … 211 210 * Add an endpoint, like /trackback/. 212 211 * 213 * The endpoints are added to the end of the request. So a request matching 214 * "/2008/10/14/my_post/myep/", the endpoint will be "/myep/". 215 * 216 * Be sure to flush the rewrite rules (wp_rewrite->flush_rules()) when your plugin gets 217 * activated (register_activation_hook()) and deactivated (register_deactivation_hook()) 212 * Adding an endpoint creates extra rewrite rules for each of the matching 213 * places specified by the provided bitmask. For example: 214 * 215 * <code> 216 * add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES ); 217 * </code> 218 * 219 * will add a new rewrite rule ending with "json(/(.*))?/?$" for every permastruct 220 * that describes a permalink (post) or page. This is rewritten to "json=$match" 221 * where $match is the part of the URL matched by the endpoint regex (e.g. "foo" in 222 * "<permalink>/json/foo/"). 223 * 224 * A new query var with the same name as the endpoint will also be created. 225 * 226 * When specifying $places ensure that you are using the EP_* constants (or a 227 * combination of them using the bitwise OR operator) as their values are not 228 * guaranteed to remain static (especially EP_ALL). 229 * 230 * Be sure to flush the rewrite rules - flush_rewrite_rules() - when your plugin gets 231 * activated and deactivated. 218 232 * 219 233 * @since 2.1.0 220 * @see WP_Rewrite::add_endpoint() Parameters and more description.221 * @ uses$wp_rewrite222 * 223 * @param unknown_type $name224 * @param unknown_type $places225 */ 226 function add_rewrite_endpoint( $name, $places) {234 * @see WP_Rewrite::add_endpoint() 235 * @global object $wp_rewrite 236 * 237 * @param string $name Name of the endpoint. 238 * @param int $places Endpoint mask describing the places the endpoint should be added. 239 */ 240 function add_rewrite_endpoint( $name, $places ) { 227 241 global $wp_rewrite; 228 $wp_rewrite->add_endpoint( $name, $places);242 $wp_rewrite->add_endpoint( $name, $places ); 229 243 } 230 244 … … 1834 1848 * Add an endpoint, like /trackback/. 1835 1849 * 1836 * To be inserted after certain URL types (specified in $places). 1837 * 1850 * See {@link add_rewrite_endpoint()} for full documentation. 1851 * 1852 * @see add_rewrite_endpoint() 1838 1853 * @since 2.1.0 1839 1854 * @access public 1840 * 1841 * @param string $name Name of endpoint. 1842 * @param array $places URL types that endpoint can be used. 1855 * @uses WP::add_query_var() 1856 * 1857 * @param string $name Name of the endpoint. 1858 * @param int $places Endpoint mask describing the places the endpoint should be added. 1843 1859 */ 1844 1860 function add_endpoint($name, $places) {
Note: See TracChangeset
for help on using the changeset viewer.