Changeset 38790 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 10/14/2016 07:29:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r38310 r38790 92 92 * 93 93 * @see add_rewrite_rule() 94 * @global WP_Rewrite $wp_rewrite 94 95 */ 95 96 function rest_api_register_rewrites() { 97 global $wp_rewrite; 98 96 99 add_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' ); 97 100 add_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' ); 101 add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' ); 102 add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' ); 98 103 } 99 104 … … 177 182 * 178 183 * @todo Check if this is even necessary 184 * @global WP_Rewrite $wp_rewrite 179 185 * 180 186 * @param int $blog_id Optional. Blog ID. Default of null returns URL for current blog. … … 189 195 190 196 if ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) { 191 $url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme ); 197 global $wp_rewrite; 198 199 if ( $wp_rewrite->using_index_permalinks() ) { 200 $url = get_home_url( $blog_id, $wp_rewrite->index . '/' . rest_get_url_prefix(), $scheme ); 201 } else { 202 $url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme ); 203 } 204 192 205 $url .= '/' . ltrim( $path, '/' ); 193 206 } else {
Note: See TracChangeset
for help on using the changeset viewer.