REST: Fix a yoda condition in WP_REST_Request::get_parameter_order() and add a missing period for an inline comment in `WP_REST_Request::from_url().

Props mrahmadawais.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39027


git-svn-id: http://core.svn.wordpress.org/trunk@38969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2016-10-30 17:42:45 +00:00
parent e84b257852
commit 1ef0a5514e
2 changed files with 4 additions and 3 deletions

View File

@ -359,7 +359,8 @@ class WP_REST_Request implements ArrayAccess {
// Ensure we parse the body data.
$body = $this->get_body();
if ( $this->method !== 'POST' && ! empty( $body ) ) {
if ( 'POST' !== $this->method && ! empty( $body ) ) {
$this->parse_body_params();
}
@ -967,7 +968,7 @@ class WP_REST_Request implements ArrayAccess {
$api_root = rest_url();
if ( get_option( 'permalink_structure' ) && 0 === strpos( $url, $api_root ) ) {
// Pretty permalinks on, and URL is under the API root
// Pretty permalinks on, and URL is under the API root.
$api_url_part = substr( $url, strlen( untrailingslashit( $api_root ) ) );
$route = parse_url( $api_url_part, PHP_URL_PATH );
} elseif ( ! empty( $query_params['rest_route'] ) ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta1-39026';
$wp_version = '4.7-beta1-39027';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.