Ticket #1459: meta-1459.3.patch
File meta-1459.3.patch, 1.0 KB (added by , 9 years ago) |
---|
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-json-api.php
346 346 * @param WP $request 347 347 */ 348 348 function wcorg_json_v2_compat( $request ) { 349 $v2_routes = array(350 '/wp-json/wordcamp-qbo',351 '/wp-json/wordcamp-letsencrypt',352 );353 349 354 if ( strpos( $_SERVER['REQUEST_URI'], '/wp-json' ) !== 0 ) { 350 $rest_prefix = rest_get_url_prefix(); 351 352 if ( strpos( $_SERVER[ 'REQUEST_URI' ], "/$rest_prefix" ) !== 0 ) { 355 353 return; 356 354 } 357 355 358 356 $is_route_v2 = false; 359 foreach ( $v2_routes as $route ) {360 if ( strpos( $_SERVER[ 'REQUEST_URI'], $route) === 0 ) {357 foreach ( rest_get_server()->get_namespaces() as $namespace ) { 358 if ( strpos( $_SERVER[ 'REQUEST_URI' ], "/$rest_prefix/$namespace" ) === 0 ) { 361 359 $is_route_v2 = true; 362 360 break; 363 361 }