Make WordPress Core


Ignore:
Timestamp:
11/29/2022 03:49:49 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Always use parentheses when instantiating an object.

Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php

    r53760 r54891  
    716716                if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
    717717                    // Use new stdClass so that JSON result is {} and not [].
    718                     $prepared['instance']['raw'] = empty( $instance ) ? new stdClass : $instance;
     718                    $prepared['instance']['raw'] = empty( $instance ) ? new stdClass() : $instance;
    719719                }
    720720            }
Note: See TracChangeset for help on using the changeset viewer.