Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.
See #47632. Built from https://develop.svn.wordpress.org/trunk@45590 git-svn-id: http://core.svn.wordpress.org/trunk@45401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1579,7 +1579,8 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( in_array( 'template', $fields, true ) ) {
|
||||
if ( $template = get_page_template_slug( $post->ID ) ) {
|
||||
$template = get_page_template_slug( $post->ID );
|
||||
if ( $template ) {
|
||||
$data['template'] = $template;
|
||||
} else {
|
||||
$data['template'] = '';
|
||||
@@ -1747,7 +1748,8 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
// If we have a featured media, add that.
|
||||
if ( $featured_media = get_post_thumbnail_id( $post->ID ) ) {
|
||||
$featured_media = get_post_thumbnail_id( $post->ID );
|
||||
if ( $featured_media ) {
|
||||
$image_url = rest_url( 'wp/v2/media/' . $featured_media );
|
||||
|
||||
$links['https://api.w.org/featuredmedia'] = array(
|
||||
|
||||
@@ -423,7 +423,8 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* If we're going to inform the client that the term already exists,
|
||||
* give them the identifier for future use.
|
||||
*/
|
||||
if ( $term_id = $term->get_error_data( 'term_exists' ) ) {
|
||||
$term_id = $term->get_error_data( 'term_exists' );
|
||||
if ( $term_id ) {
|
||||
$existing_term = get_term( $term_id, $this->taxonomy );
|
||||
$term->add_data( $existing_term->term_id, 'term_exists' );
|
||||
$term->add_data(
|
||||
|
||||
@@ -498,7 +498,8 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
foreach ( $messages as $message ) {
|
||||
$error->add( $code, $message );
|
||||
}
|
||||
if ( $error_data = $error->get_error_data( $code ) ) {
|
||||
$error_data = $error->get_error_data( $code );
|
||||
if ( $error_data ) {
|
||||
$error->add_data( $error_data, $code );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user