mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Coding Standards: Always use parentheses when instantiating an object.
Note: This will be enforced by WPCS 3.0.0. Props jrf. See #56791. git-svn-id: https://develop.svn.wordpress.org/trunk@54891 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -97,7 +97,7 @@ if ( ! empty( $autofocus ) && is_array( $autofocus ) ) {
|
||||
}
|
||||
|
||||
$registered = $wp_scripts->registered;
|
||||
$wp_scripts = new WP_Scripts;
|
||||
$wp_scripts = new WP_Scripts();
|
||||
$wp_scripts->registered = $registered;
|
||||
|
||||
add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
|
||||
|
||||
@@ -1570,7 +1570,7 @@ function wp_ajax_add_menu_item() {
|
||||
'before' => '',
|
||||
'link_after' => '',
|
||||
'link_before' => '',
|
||||
'walker' => new $walker_class_name,
|
||||
'walker' => new $walker_class_name(),
|
||||
);
|
||||
|
||||
echo walk_nav_menu_tree( $menu_items, 0, (object) $args );
|
||||
|
||||
@@ -59,7 +59,7 @@ function edit_link( $link_id = 0 ) {
|
||||
* @return stdClass Default link object.
|
||||
*/
|
||||
function get_default_link_to_edit() {
|
||||
$link = new stdClass;
|
||||
$link = new stdClass();
|
||||
if ( isset( $_GET['linkurl'] ) ) {
|
||||
$link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
|
||||
} else {
|
||||
|
||||
@@ -62,7 +62,7 @@ class Language_Pack_Upgrader extends WP_Upgrader {
|
||||
* Avoid messing with VCS installations, at least for now.
|
||||
* Noted: this is not the ideal way to accomplish this.
|
||||
*/
|
||||
$check_vcs = new WP_Automatic_Updater;
|
||||
$check_vcs = new WP_Automatic_Updater();
|
||||
if ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class WP_Automatic_Updater {
|
||||
*/
|
||||
public function should_update( $type, $item, $context ) {
|
||||
// Used to see if WP_Filesystem is set up to allow unattended updates.
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
|
||||
if ( $this->is_disabled() ) {
|
||||
return false;
|
||||
@@ -305,7 +305,7 @@ class WP_Automatic_Updater {
|
||||
* @return null|WP_Error
|
||||
*/
|
||||
public function update( $type, $item ) {
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
|
||||
switch ( $type ) {
|
||||
case 'core':
|
||||
|
||||
@@ -280,7 +280,7 @@ class WP_Site_Health_Auto_Updates {
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
}
|
||||
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
$success = $skin->request_filesystem_credentials( false, ABSPATH );
|
||||
|
||||
if ( ! $success ) {
|
||||
@@ -313,7 +313,7 @@ class WP_Site_Health_Auto_Updates {
|
||||
|
||||
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
|
||||
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
$success = $skin->request_filesystem_credentials( false, ABSPATH );
|
||||
|
||||
if ( ! $success ) {
|
||||
|
||||
@@ -739,7 +739,7 @@ function wp_restore_image( $post_id ) {
|
||||
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
||||
$old_backup_sizes = $backup_sizes;
|
||||
$restored = false;
|
||||
$msg = new stdClass;
|
||||
$msg = new stdClass();
|
||||
|
||||
if ( ! is_array( $backup_sizes ) ) {
|
||||
$msg->error = __( 'Cannot load image metadata.' );
|
||||
@@ -827,7 +827,7 @@ function wp_restore_image( $post_id ) {
|
||||
function wp_save_image( $post_id ) {
|
||||
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
|
||||
|
||||
$return = new stdClass;
|
||||
$return = new stdClass();
|
||||
$success = false;
|
||||
$delete = false;
|
||||
$scaled = false;
|
||||
|
||||
@@ -32,7 +32,7 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
|
||||
}
|
||||
|
||||
if ( 'markup' === $response_format ) {
|
||||
$args['walker'] = new Walker_Nav_Menu_Checklist;
|
||||
$args['walker'] = new Walker_Nav_Menu_Checklist();
|
||||
}
|
||||
|
||||
if ( 'get-post-item' === $type ) {
|
||||
@@ -429,14 +429,14 @@ function wp_nav_menu_item_post_type_meta_box( $data_object, $box ) {
|
||||
}
|
||||
|
||||
// @todo Transient caching of these results with proper invalidation on updating of a post of this type.
|
||||
$get_posts = new WP_Query;
|
||||
$get_posts = new WP_Query();
|
||||
$posts = $get_posts->query( $args );
|
||||
|
||||
// Only suppress and insert when more than just suppression pages available.
|
||||
if ( ! $get_posts->post_count ) {
|
||||
if ( ! empty( $suppress_page_ids ) ) {
|
||||
unset( $args['post__not_in'] );
|
||||
$get_posts = new WP_Query;
|
||||
$get_posts = new WP_Query();
|
||||
$posts = $get_posts->query( $args );
|
||||
} else {
|
||||
echo '<p>' . __( 'No items.' ) . '</p>';
|
||||
@@ -1059,7 +1059,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
|
||||
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
|
||||
|
||||
if ( class_exists( $walker_class_name ) ) {
|
||||
$walker = new $walker_class_name;
|
||||
$walker = new $walker_class_name();
|
||||
} else {
|
||||
return new WP_Error(
|
||||
'menu_walker_not_exist',
|
||||
|
||||
@@ -716,7 +716,7 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||
wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
|
||||
}
|
||||
} else {
|
||||
$post = new stdClass;
|
||||
$post = new stdClass();
|
||||
$post->ID = 0;
|
||||
$post->post_author = '';
|
||||
$post->post_date = '';
|
||||
|
||||
@@ -535,7 +535,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
||||
wp_delete_file( $archive_pathname );
|
||||
}
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip = new ZipArchive();
|
||||
if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) {
|
||||
if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) {
|
||||
$error = __( 'Unable to archive the personal data export file (JSON format).' );
|
||||
|
||||
@@ -1050,7 +1050,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
|
||||
* created.
|
||||
*/
|
||||
if ( ! is_multisite() ) {
|
||||
$current_site = new stdClass;
|
||||
$current_site = new stdClass();
|
||||
$current_site->domain = $domain;
|
||||
$current_site->path = $path;
|
||||
$current_site->site_name = ucfirst( $domain );
|
||||
|
||||
@@ -104,7 +104,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
|
||||
$parsed_args = wp_parse_args( $params, $defaults );
|
||||
|
||||
if ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) {
|
||||
$walker = new Walker_Category_Checklist;
|
||||
$walker = new Walker_Category_Checklist();
|
||||
} else {
|
||||
$walker = $parsed_args['walker'];
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ function wp_download_language_pack( $download ) {
|
||||
$translation = (object) $translation;
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
$upgrader = new Language_Pack_Upgrader( $skin );
|
||||
$translation->type = 'core';
|
||||
$result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) );
|
||||
@@ -263,7 +263,7 @@ function wp_can_install_language_pack() {
|
||||
}
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
$skin = new Automatic_Upgrader_Skin;
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
$upgrader = new Language_Pack_Upgrader( $skin );
|
||||
$upgrader->init();
|
||||
|
||||
|
||||
@@ -1395,7 +1395,7 @@ function update_core( $from, $to ) {
|
||||
// If a error occurs partway through this final step, keep the error flowing through, but keep process going.
|
||||
if ( is_wp_error( $_result ) ) {
|
||||
if ( ! is_wp_error( $result ) ) {
|
||||
$result = new WP_Error;
|
||||
$result = new WP_Error();
|
||||
}
|
||||
|
||||
$result->add(
|
||||
|
||||
@@ -93,7 +93,7 @@ function find_core_auto_update() {
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
|
||||
$auto_update = false;
|
||||
$upgrader = new WP_Automatic_Updater;
|
||||
$upgrader = new WP_Automatic_Updater();
|
||||
foreach ( $updates->updates as $update ) {
|
||||
if ( 'autoupdate' !== $update->response ) {
|
||||
continue;
|
||||
@@ -235,7 +235,7 @@ function core_update_footer( $msg = '' ) {
|
||||
|
||||
$cur = get_preferred_from_update_core();
|
||||
if ( ! is_object( $cur ) ) {
|
||||
$cur = new stdClass;
|
||||
$cur = new stdClass();
|
||||
}
|
||||
|
||||
if ( ! isset( $cur->current ) ) {
|
||||
|
||||
@@ -2617,7 +2617,7 @@ function maybe_convert_table_to_utf8mb4( $table ) {
|
||||
*/
|
||||
function get_alloptions_110() {
|
||||
global $wpdb;
|
||||
$all_options = new stdClass;
|
||||
$all_options = new stdClass();
|
||||
$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
|
||||
if ( $options ) {
|
||||
foreach ( $options as $option ) {
|
||||
|
||||
@@ -29,7 +29,7 @@ function add_user() {
|
||||
*/
|
||||
function edit_user( $user_id = 0 ) {
|
||||
$wp_roles = wp_roles();
|
||||
$user = new stdClass;
|
||||
$user = new stdClass();
|
||||
$user_id = (int) $user_id;
|
||||
if ( $user_id ) {
|
||||
$update = true;
|
||||
|
||||
@@ -104,7 +104,7 @@ if ( is_multisite()
|
||||
if ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) {
|
||||
$new_email = get_user_meta( $current_user->ID, '_new_email', true );
|
||||
if ( $new_email && hash_equals( $new_email['hash'], $_GET['newuseremail'] ) ) {
|
||||
$user = new stdClass;
|
||||
$user = new stdClass();
|
||||
$user->ID = $current_user->ID;
|
||||
$user->user_email = esc_html( trim( $new_email['newemail'] ) );
|
||||
if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) {
|
||||
|
||||
@@ -41,7 +41,7 @@ function _wp_admin_bar_init() {
|
||||
*/
|
||||
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
|
||||
if ( class_exists( $admin_bar_class ) ) {
|
||||
$wp_admin_bar = new $admin_bar_class;
|
||||
$wp_admin_bar = new $admin_bar_class();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -975,7 +975,7 @@ function user_can( $user, $capability, ...$args ) {
|
||||
if ( empty( $user ) ) {
|
||||
// User is logged out, create anonymous user object.
|
||||
$user = new WP_User( 0 );
|
||||
$user->init( new stdClass );
|
||||
$user->init( new stdClass() );
|
||||
}
|
||||
|
||||
return $user->has_cap( $capability, ...$args );
|
||||
|
||||
@@ -1110,7 +1110,7 @@ function _wp_object_count_sort_cb( $a, $b ) {
|
||||
function walk_category_tree( ...$args ) {
|
||||
// The user's options are the third parameter.
|
||||
if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
|
||||
$walker = new Walker_Category;
|
||||
$walker = new Walker_Category();
|
||||
} else {
|
||||
/**
|
||||
* @var Walker $walker
|
||||
@@ -1136,7 +1136,7 @@ function walk_category_tree( ...$args ) {
|
||||
function walk_category_dropdown_tree( ...$args ) {
|
||||
// The user's options are the third parameter.
|
||||
if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
|
||||
$walker = new Walker_CategoryDropdown;
|
||||
$walker = new Walker_CategoryDropdown();
|
||||
} else {
|
||||
/**
|
||||
* @var Walker $walker
|
||||
|
||||
@@ -41,7 +41,7 @@ class WP_Admin_Bar {
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public function initialize() {
|
||||
$this->user = new stdClass;
|
||||
$this->user = new stdClass();
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
/* Populate settings we need for the menu based on the current user. */
|
||||
|
||||
@@ -1799,7 +1799,7 @@ final class _WP_Editors {
|
||||
$query = apply_filters( 'wp_link_query_args', $query );
|
||||
|
||||
// Do main query.
|
||||
$get_posts = new WP_Query;
|
||||
$get_posts = new WP_Query();
|
||||
$posts = $get_posts->query( $query );
|
||||
|
||||
// Build results.
|
||||
|
||||
@@ -581,7 +581,7 @@ class WP_Http {
|
||||
|
||||
// Transport claims to support request, instantiate it and give it a whirl.
|
||||
if ( empty( $transports[ $class ] ) ) {
|
||||
$transports[ $class ] = new $class;
|
||||
$transports[ $class ] = new $class();
|
||||
}
|
||||
|
||||
$response = $transports[ $class ]->request( $url, $args );
|
||||
|
||||
@@ -639,7 +639,7 @@ class WP_oEmbed {
|
||||
return false;
|
||||
}
|
||||
|
||||
$dom = new DOMDocument;
|
||||
$dom = new DOMDocument();
|
||||
$success = $dom->loadXML( $response_body );
|
||||
if ( ! $success ) {
|
||||
return false;
|
||||
@@ -660,7 +660,7 @@ class WP_oEmbed {
|
||||
return false;
|
||||
}
|
||||
|
||||
$return = new stdClass;
|
||||
$return = new stdClass();
|
||||
foreach ( $xml as $key => $value ) {
|
||||
$return->$key = (string) $value;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
foreach ( $orig_matches as $o => $f ) {
|
||||
if ( is_numeric( $o ) && is_numeric( $f ) ) {
|
||||
$text_diff = new Text_Diff( 'auto', array( array( $orig[ $o ] ), array( $final[ $f ] ) ) );
|
||||
$renderer = new $this->inline_diff_renderer;
|
||||
$renderer = new $this->inline_diff_renderer();
|
||||
$diff = $renderer->render( $text_diff );
|
||||
|
||||
// If they're too different, don't include any <ins> or <del>'s.
|
||||
|
||||
@@ -156,7 +156,7 @@ class WP_User {
|
||||
if ( $data ) {
|
||||
$this->init( $data, $site_id );
|
||||
} else {
|
||||
$this->data = new stdClass;
|
||||
$this->data = new stdClass();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2238,7 +2238,7 @@ function wp_list_comments( $args = array(), $comments = null ) {
|
||||
wp_queue_comments_for_comment_meta_lazyload( $_comments );
|
||||
|
||||
if ( empty( $parsed_args['walker'] ) ) {
|
||||
$walker = new Walker_Comment;
|
||||
$walker = new Walker_Comment();
|
||||
} else {
|
||||
$walker = $parsed_args['walker'];
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ function get_approved_comments( $post_id, $args = array() ) {
|
||||
);
|
||||
$parsed_args = wp_parse_args( $args, $defaults );
|
||||
|
||||
$query = new WP_Comment_Query;
|
||||
$query = new WP_Comment_Query();
|
||||
return $query->query( $parsed_args );
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ function get_comment( $comment = null, $output = OBJECT ) {
|
||||
* @return WP_Comment[]|int[]|int List of comments or number of found comments if `$count` argument is true.
|
||||
*/
|
||||
function get_comments( $args = '' ) {
|
||||
$query = new WP_Comment_Query;
|
||||
$query = new WP_Comment_Query();
|
||||
return $query->query( $args );
|
||||
}
|
||||
|
||||
@@ -1023,7 +1023,7 @@ function get_comment_pages_count( $comments = null, $per_page = null, $threaded
|
||||
}
|
||||
|
||||
if ( $threaded ) {
|
||||
$walker = new Walker_Comment;
|
||||
$walker = new Walker_Comment();
|
||||
$count = ceil( $walker->get_number_of_root_elements( $comments ) / $per_page );
|
||||
} else {
|
||||
$count = ceil( count( $comments ) / $per_page );
|
||||
|
||||
@@ -4302,7 +4302,7 @@ function _wp_json_sanity_check( $data, $depth ) {
|
||||
}
|
||||
}
|
||||
} elseif ( is_object( $data ) ) {
|
||||
$output = new stdClass;
|
||||
$output = new stdClass();
|
||||
foreach ( $data as $id => $el ) {
|
||||
if ( is_string( $id ) ) {
|
||||
$clean_id = _wp_json_convert_string( $id );
|
||||
|
||||
@@ -1306,7 +1306,7 @@ function get_translations_for_domain( $domain ) {
|
||||
|
||||
static $noop_translations = null;
|
||||
if ( null === $noop_translations ) {
|
||||
$noop_translations = new NOOP_Translations;
|
||||
$noop_translations = new NOOP_Translations();
|
||||
}
|
||||
|
||||
return $noop_translations;
|
||||
|
||||
@@ -297,7 +297,7 @@ function ms_load_current_site_and_network( $domain, $path, $subdomain = false )
|
||||
|
||||
// If the network is defined in wp-config.php, we can simply use that.
|
||||
if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {
|
||||
$current_site = new stdClass;
|
||||
$current_site = new stdClass();
|
||||
$current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;
|
||||
$current_site->domain = DOMAIN_CURRENT_SITE;
|
||||
$current_site->path = PATH_CURRENT_SITE;
|
||||
@@ -387,7 +387,7 @@ function ms_load_current_site_and_network( $domain, $path, $subdomain = false )
|
||||
|
||||
// During activation of a new subdomain, the requested site does not yet exist.
|
||||
if ( empty( $current_blog ) && wp_installing() ) {
|
||||
$current_blog = new stdClass;
|
||||
$current_blog = new stdClass();
|
||||
$current_blog->blog_id = 1;
|
||||
$blog_id = 1;
|
||||
$current_blog->public = 1;
|
||||
|
||||
@@ -617,7 +617,7 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
|
||||
* @return string The HTML list content for the menu items.
|
||||
*/
|
||||
function walk_nav_menu_tree( $items, $depth, $args ) {
|
||||
$walker = ( empty( $args->walker ) ) ? new Walker_Nav_Menu : $args->walker;
|
||||
$walker = ( empty( $args->walker ) ) ? new Walker_Nav_Menu() : $args->walker;
|
||||
|
||||
return $walker->walk( $items, $depth, $args );
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@ function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_
|
||||
$object_id = (int) $object_id;
|
||||
$menu_item_ids = array();
|
||||
|
||||
$query = new WP_Query;
|
||||
$query = new WP_Query();
|
||||
$menu_items = $query->query(
|
||||
array(
|
||||
'meta_key' => '_menu_item_object_id',
|
||||
|
||||
@@ -105,7 +105,7 @@ if ( ! function_exists( 'get_user_by' ) ) :
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = new WP_User;
|
||||
$user = new WP_User();
|
||||
$user->init( $userdata );
|
||||
|
||||
return $user;
|
||||
|
||||
@@ -1546,7 +1546,7 @@ function wp_page_menu( $args = array() ) {
|
||||
*/
|
||||
function walk_page_tree( $pages, $depth, $current_page, $args ) {
|
||||
if ( empty( $args['walker'] ) ) {
|
||||
$walker = new Walker_Page;
|
||||
$walker = new Walker_Page();
|
||||
} else {
|
||||
/**
|
||||
* @var Walker $walker
|
||||
@@ -1578,7 +1578,7 @@ function walk_page_tree( $pages, $depth, $current_page, $args ) {
|
||||
*/
|
||||
function walk_page_dropdown_tree( ...$args ) {
|
||||
if ( empty( $args[2]['walker'] ) ) { // The user's options are the third parameter.
|
||||
$walker = new Walker_PageDropdown;
|
||||
$walker = new Walker_PageDropdown();
|
||||
} else {
|
||||
/**
|
||||
* @var Walker $walker
|
||||
|
||||
@@ -2410,7 +2410,7 @@ function get_posts( $args = null ) {
|
||||
$parsed_args['ignore_sticky_posts'] = true;
|
||||
$parsed_args['no_found_rows'] = true;
|
||||
|
||||
$get_posts = new WP_Query;
|
||||
$get_posts = new WP_Query();
|
||||
return $get_posts->query( $parsed_args );
|
||||
|
||||
}
|
||||
@@ -3013,7 +3013,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! post_type_exists( $type ) ) {
|
||||
return new stdClass;
|
||||
return new stdClass();
|
||||
}
|
||||
|
||||
$cache_key = _count_posts_cache_key( $type, $perm );
|
||||
|
||||
@@ -255,15 +255,15 @@ function create_initial_rest_routes() {
|
||||
}
|
||||
|
||||
// Post types.
|
||||
$controller = new WP_REST_Post_Types_Controller;
|
||||
$controller = new WP_REST_Post_Types_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Post statuses.
|
||||
$controller = new WP_REST_Post_Statuses_Controller;
|
||||
$controller = new WP_REST_Post_Statuses_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Taxonomies.
|
||||
$controller = new WP_REST_Taxonomies_Controller;
|
||||
$controller = new WP_REST_Taxonomies_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Terms.
|
||||
@@ -278,7 +278,7 @@ function create_initial_rest_routes() {
|
||||
}
|
||||
|
||||
// Users.
|
||||
$controller = new WP_REST_Users_Controller;
|
||||
$controller = new WP_REST_Users_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Application Passwords
|
||||
@@ -286,7 +286,7 @@ function create_initial_rest_routes() {
|
||||
$controller->register_routes();
|
||||
|
||||
// Comments.
|
||||
$controller = new WP_REST_Comments_Controller;
|
||||
$controller = new WP_REST_Comments_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
$search_handlers = array(
|
||||
@@ -318,15 +318,15 @@ function create_initial_rest_routes() {
|
||||
$controller->register_routes();
|
||||
|
||||
// Global Styles.
|
||||
$controller = new WP_REST_Global_Styles_Controller;
|
||||
$controller = new WP_REST_Global_Styles_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Settings.
|
||||
$controller = new WP_REST_Settings_Controller;
|
||||
$controller = new WP_REST_Settings_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Themes.
|
||||
$controller = new WP_REST_Themes_Controller;
|
||||
$controller = new WP_REST_Themes_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Plugins.
|
||||
@@ -562,7 +562,7 @@ function rest_get_server() {
|
||||
* @param string $class_name The name of the server class. Default 'WP_REST_Server'.
|
||||
*/
|
||||
$wp_rest_server_class = apply_filters( 'wp_rest_server_class', 'WP_REST_Server' );
|
||||
$wp_rest_server = new $wp_rest_server_class;
|
||||
$wp_rest_server = new $wp_rest_server_class();
|
||||
|
||||
/**
|
||||
* Fires when preparing to serve a REST API request.
|
||||
|
||||
@@ -227,7 +227,7 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
return null;
|
||||
}
|
||||
|
||||
$error = new WP_Error;
|
||||
$error = new WP_Error();
|
||||
|
||||
if ( is_array( $this->get_data() ) ) {
|
||||
$data = $this->get_data();
|
||||
|
||||
@@ -766,7 +766,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
|
||||
// Ensure empty details is an empty object.
|
||||
if ( empty( $data['media_details'] ) ) {
|
||||
$data['media_details'] = new stdClass;
|
||||
$data['media_details'] = new stdClass();
|
||||
} elseif ( ! empty( $data['media_details']['sizes'] ) ) {
|
||||
|
||||
foreach ( $data['media_details']['sizes'] as $size => &$size_data ) {
|
||||
@@ -797,7 +797,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$data['media_details']['sizes'] = new stdClass;
|
||||
$data['media_details']['sizes'] = new stdClass();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
*/
|
||||
$prepared_args = apply_filters( 'rest_comment_query', $prepared_args, $request );
|
||||
|
||||
$query = new WP_Comment_Query;
|
||||
$query = new WP_Comment_Query();
|
||||
$query_result = $query->query( $prepared_args );
|
||||
|
||||
$comments = array();
|
||||
@@ -295,7 +295,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
// Out-of-bounds, run the query again without LIMIT for total count.
|
||||
unset( $prepared_args['number'], $prepared_args['offset'] );
|
||||
|
||||
$query = new WP_Comment_Query;
|
||||
$query = new WP_Comment_Query();
|
||||
$prepared_args['count'] = true;
|
||||
|
||||
$total_comments = $query->query( $prepared_args );
|
||||
|
||||
@@ -807,7 +807,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* @return object Term object.
|
||||
*/
|
||||
public function prepare_item_for_database( $request ) {
|
||||
$prepared_term = new stdClass;
|
||||
$prepared_term = new stdClass();
|
||||
|
||||
$schema = $this->get_item_schema();
|
||||
if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) {
|
||||
|
||||
@@ -1121,7 +1121,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* @return object User object.
|
||||
*/
|
||||
protected function prepare_item_for_database( $request ) {
|
||||
$prepared_user = new stdClass;
|
||||
$prepared_user = new stdClass();
|
||||
|
||||
$schema = $this->get_item_schema();
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@ class WP_REST_Widget_Types_Controller extends WP_REST_Controller {
|
||||
|
||||
if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
|
||||
// Use new stdClass so that JSON result is {} and not [].
|
||||
$response['instance']['raw'] = empty( $instance ) ? new stdClass : $instance;
|
||||
$response['instance']['raw'] = empty( $instance ) ? new stdClass() : $instance;
|
||||
}
|
||||
|
||||
return rest_ensure_response( $response );
|
||||
|
||||
@@ -715,7 +715,7 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
|
||||
|
||||
if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
|
||||
// Use new stdClass so that JSON result is {} and not [].
|
||||
$prepared['instance']['raw'] = empty( $instance ) ? new stdClass : $instance;
|
||||
$prepared['instance']['raw'] = empty( $instance ) ? new stdClass() : $instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1331,7 +1331,7 @@ function _get_random_header_data() {
|
||||
}
|
||||
|
||||
if ( empty( $headers ) ) {
|
||||
return new stdClass;
|
||||
return new stdClass();
|
||||
}
|
||||
|
||||
$_wp_random_header = (object) $headers[ array_rand( $headers ) ];
|
||||
|
||||
@@ -44,7 +44,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
|
||||
}
|
||||
|
||||
if ( ! is_object( $current ) ) {
|
||||
$current = new stdClass;
|
||||
$current = new stdClass();
|
||||
$current->updates = array();
|
||||
$current->version_checked = $wp_version;
|
||||
}
|
||||
@@ -327,10 +327,10 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
$current = get_site_transient( 'update_plugins' );
|
||||
|
||||
if ( ! is_object( $current ) ) {
|
||||
$current = new stdClass;
|
||||
$current = new stdClass();
|
||||
}
|
||||
|
||||
$updates = new stdClass;
|
||||
$updates = new stdClass();
|
||||
$updates->last_checked = time();
|
||||
$updates->response = array();
|
||||
$updates->translations = array();
|
||||
@@ -595,7 +595,7 @@ function wp_update_themes( $extra_stats = array() ) {
|
||||
$last_update = get_site_transient( 'update_themes' );
|
||||
|
||||
if ( ! is_object( $last_update ) ) {
|
||||
$last_update = new stdClass;
|
||||
$last_update = new stdClass();
|
||||
}
|
||||
|
||||
$themes = array();
|
||||
@@ -734,7 +734,7 @@ function wp_update_themes( $extra_stats = array() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$new_update = new stdClass;
|
||||
$new_update = new stdClass();
|
||||
$new_update->last_checked = time();
|
||||
$new_update->checked = $checked;
|
||||
|
||||
@@ -846,7 +846,7 @@ function wp_maybe_auto_update() {
|
||||
include_once ABSPATH . 'wp-admin/includes/admin.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
|
||||
$upgrader = new WP_Automatic_Updater;
|
||||
$upgrader = new WP_Automatic_Updater();
|
||||
$upgrader->run();
|
||||
}
|
||||
|
||||
|
||||
@@ -951,7 +951,7 @@ function get_blogs_of_user( $user_id, $all = false ) {
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
$site_id = get_current_blog_id();
|
||||
$sites = array( $site_id => new stdClass );
|
||||
$sites = array( $site_id => new stdClass() );
|
||||
$sites[ $site_id ]->userblog_id = $site_id;
|
||||
$sites[ $site_id ]->blogname = get_option( 'blogname' );
|
||||
$sites[ $site_id ]->domain = '';
|
||||
|
||||
@@ -81,7 +81,7 @@ $post_default_title = '';
|
||||
* @param string $class The name of the XML-RPC server class.
|
||||
*/
|
||||
$wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' );
|
||||
$wp_xmlrpc_server = new $wp_xmlrpc_server_class;
|
||||
$wp_xmlrpc_server = new $wp_xmlrpc_server_class();
|
||||
|
||||
// Fire off the request.
|
||||
$wp_xmlrpc_server->serve_request();
|
||||
|
||||
@@ -9,7 +9,7 @@ abstract class WP_Test_REST_Controller_Testcase extends WP_Test_REST_TestCase {
|
||||
add_filter( 'rest_url', array( $this, 'filter_rest_url_for_leading_slash' ), 10, 2 );
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
|
||||
register_post_type( 'content', array( 'show_in_admin_bar' => true ) );
|
||||
|
||||
$admin_bar = new WP_Admin_Bar;
|
||||
$admin_bar = new WP_Admin_Bar();
|
||||
|
||||
wp_admin_bar_new_content_menu( $admin_bar );
|
||||
|
||||
@@ -54,7 +54,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
public function test_merging_existing_meta_values() {
|
||||
wp_set_current_user( self::$editor_id );
|
||||
|
||||
$admin_bar = new WP_Admin_Bar;
|
||||
$admin_bar = new WP_Admin_Bar();
|
||||
|
||||
$admin_bar->add_node(
|
||||
array(
|
||||
|
||||
@@ -31,7 +31,7 @@ class Tests_Blocks_Editor extends WP_UnitTestCase {
|
||||
$post = self::factory()->post->create_and_get( $args );
|
||||
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||
// Make sure objects are cloned going to and from the cache.
|
||||
public function test_object_refs() {
|
||||
$key = __FUNCTION__ . '_1';
|
||||
$object_a = new stdClass;
|
||||
$object_a = new stdClass();
|
||||
$object_a->foo = 'alpha';
|
||||
$this->cache->set( $key, $object_a );
|
||||
$object_a->foo = 'bravo';
|
||||
@@ -240,7 +240,7 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||
$this->assertSame( 'bravo', $object_a->foo );
|
||||
|
||||
$key = __FUNCTION__ . '_2';
|
||||
$object_a = new stdClass;
|
||||
$object_a = new stdClass();
|
||||
$object_a->foo = 'alpha';
|
||||
$this->cache->add( $key, $object_a );
|
||||
$object_a->foo = 'bravo';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
class Tests_Dependencies extends WP_UnitTestCase {
|
||||
public function test_add() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -18,7 +18,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_remove() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -31,7 +31,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_enqueue() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -47,7 +47,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_dequeue() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -67,7 +67,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_enqueue_args() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -85,7 +85,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_dequeue_args() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertTrue( $dep->add( 'two', '' ) );
|
||||
@@ -112,7 +112,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
* @ticket 21741
|
||||
*/
|
||||
public function test_query_and_registered_enqueued() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertTrue( $dep->add( 'one', '' ) );
|
||||
$this->assertInstanceOf( '_WP_Dependency', $dep->query( 'one' ) );
|
||||
@@ -138,7 +138,7 @@ class Tests_Dependencies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
function test_enqueue_before_register() {
|
||||
$dep = new WP_Dependencies;
|
||||
$dep = new WP_Dependencies();
|
||||
|
||||
$this->assertArrayNotHasKey( 'one', $dep->registered );
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Tests_Dependencies_jQuery extends WP_UnitTestCase {
|
||||
* @covers WP_Scripts::query
|
||||
*/
|
||||
public function test_location_of_jquery() {
|
||||
$scripts = new WP_Scripts;
|
||||
$scripts = new WP_Scripts();
|
||||
wp_default_scripts( $scripts );
|
||||
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
@@ -106,7 +106,7 @@ class Tests_Dependencies_jQuery extends WP_UnitTestCase {
|
||||
* @covers WP_Scripts::do_items
|
||||
*/
|
||||
public function test_jquery_in_footer() {
|
||||
$scripts = new WP_Scripts;
|
||||
$scripts = new WP_Scripts();
|
||||
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ) );
|
||||
$scripts->add( 'jquery-core', '/jquery.js', array() );
|
||||
$scripts->add( 'jquery-migrate', '/jquery-migrate.js', array() );
|
||||
|
||||
@@ -276,7 +276,7 @@ JS;
|
||||
* @covers WP_Dependencies::do_items
|
||||
*/
|
||||
public function test_group_mismatch_in_deps() {
|
||||
$scripts = new WP_Scripts;
|
||||
$scripts = new WP_Scripts();
|
||||
$scripts->add( 'one', 'one', array(), 'v1', 1 );
|
||||
$scripts->add( 'two', 'two', array( 'one' ) );
|
||||
$scripts->add( 'three', 'three', array( 'two' ), 'v1', 1 );
|
||||
@@ -295,7 +295,7 @@ JS;
|
||||
$this->assertContains( 'two', $scripts->done );
|
||||
$this->assertContains( 'three', $scripts->done );
|
||||
|
||||
$scripts = new WP_Scripts;
|
||||
$scripts = new WP_Scripts();
|
||||
$scripts->add( 'one', 'one', array(), 'v1', 1 );
|
||||
$scripts->add( 'two', 'two', array( 'one' ), 'v1', 1 );
|
||||
$scripts->add( 'three', 'three', array( 'one' ) );
|
||||
|
||||
@@ -105,7 +105,7 @@ class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
|
||||
'',
|
||||
),
|
||||
array(
|
||||
new WP_Query,
|
||||
new WP_Query(),
|
||||
'',
|
||||
),
|
||||
array(
|
||||
|
||||
@@ -26,7 +26,7 @@ class Tests_Formatting_StripslashesDeep extends WP_UnitTestCase {
|
||||
$this->assertSame( $arr, stripslashes_deep( $arr ) ); // Keyed array.
|
||||
$this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj = new stdClass();
|
||||
foreach ( $arr as $k => $v ) {
|
||||
$obj->$k = $v;
|
||||
}
|
||||
@@ -41,9 +41,9 @@ class Tests_Formatting_StripslashesDeep extends WP_UnitTestCase {
|
||||
$this->assertSame( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array.
|
||||
$this->assertSame( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed.
|
||||
|
||||
$obj_old = new stdClass;
|
||||
$obj_old = new stdClass();
|
||||
$obj_old->a = $old;
|
||||
$obj_new = new stdClass;
|
||||
$obj_new = new stdClass();
|
||||
$obj_new->a = $new;
|
||||
$this->assertEquals( $obj_new, stripslashes_deep( $obj_old ) );
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class Tests_Formatting_wpSlash extends WP_UnitTestCase {
|
||||
$this->assertSame( $arr, wp_slash( $arr ) ); // Keyed array.
|
||||
$this->assertSame( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj = new stdClass();
|
||||
foreach ( $arr as $k => $v ) {
|
||||
$obj->$k = $v;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
class Tests_Functions extends WP_UnitTestCase {
|
||||
public function test_wp_parse_args_object() {
|
||||
$x = new MockClass;
|
||||
$x = new MockClass();
|
||||
$x->_baba = 5;
|
||||
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
||||
$x->a = array( 5, 111, 'x' );
|
||||
@@ -17,7 +17,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
),
|
||||
wp_parse_args( $x )
|
||||
);
|
||||
$y = new MockClass;
|
||||
$y = new MockClass();
|
||||
$this->assertSame( array(), wp_parse_args( $y ) );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_wp_parse_args_defaults() {
|
||||
$x = new MockClass;
|
||||
$x = new MockClass();
|
||||
$x->_baba = 5;
|
||||
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
||||
$x->a = array( 5, 111, 'x' );
|
||||
@@ -1113,7 +1113,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
* @ticket 28786
|
||||
*/
|
||||
public function test_wp_json_encode_object() {
|
||||
$object = new stdClass;
|
||||
$object = new stdClass();
|
||||
$object->a = 'b';
|
||||
$this->assertSame( wp_json_encode( $object ), '{"a":"b"}' );
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
|
||||
// Regex based parser cannot detect malformed XML.
|
||||
foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) {
|
||||
$parser = new $p;
|
||||
$parser = new $p();
|
||||
$result = $parser->parse( $file );
|
||||
$this->assertWPError( $result );
|
||||
$this->assertSame( 'There was an error when reading this WXR file', $result->get_error_message() );
|
||||
@@ -51,7 +51,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
|
||||
foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
|
||||
foreach ( array( $f1, $f2 ) as $file ) {
|
||||
$parser = new $p;
|
||||
$parser = new $p();
|
||||
$result = $parser->parse( $file );
|
||||
$this->assertWPError( $result );
|
||||
$this->assertSame( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );
|
||||
@@ -69,7 +69,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
|
||||
foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
|
||||
$message = $p . ' failed';
|
||||
$parser = new $p;
|
||||
$parser = new $p();
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
$this->assertIsArray( $result, $message );
|
||||
@@ -167,7 +167,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
|
||||
foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
|
||||
$message = $p . ' failed';
|
||||
$parser = new $p;
|
||||
$parser = new $p();
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
$this->assertIsArray( $result, $message );
|
||||
@@ -265,7 +265,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
|
||||
foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
|
||||
$message = 'Parser ' . $p;
|
||||
$parser = new $p;
|
||||
$parser = new $p();
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
$post = $result['posts'][0];
|
||||
@@ -298,7 +298,7 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
public function test_unescaped_cdata_closing_sequence() {
|
||||
$file = DIR_TESTDATA . '/export/crazy-cdata.xml';
|
||||
|
||||
$parser = new WXR_Parser_Regex;
|
||||
$parser = new WXR_Parser_Regex();
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
$post = $result['posts'][0];
|
||||
|
||||
@@ -361,7 +361,7 @@ https://w.org</a>',
|
||||
* @dataProvider data_autoembed
|
||||
*/
|
||||
public function test_autoembed( $content, $result = null ) {
|
||||
$wp_embed = new Test_Autoembed;
|
||||
$wp_embed = new Test_Autoembed();
|
||||
|
||||
$this->assertSame( $wp_embed->autoembed( $content ), $result ? $result : $content );
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = new StdClass;
|
||||
$data[0] = new StdClass();
|
||||
$data[0]->name = 'yesorno';
|
||||
$data[0]->value = 'yes';
|
||||
$_POST['nav-menu-data'] = addslashes( json_encode( $data ) );
|
||||
@@ -36,7 +36,7 @@ class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = new StdClass;
|
||||
$data[0] = new StdClass();
|
||||
$data[0]->name = 'would[1][do][the][trick]';
|
||||
$data[0]->value = 'yes';
|
||||
$_POST['nav-menu-data'] = addslashes( json_encode( $data ) );
|
||||
@@ -66,13 +66,13 @@ class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = new StdClass;
|
||||
$data[0] = new StdClass();
|
||||
$data[0]->name = 'would[1][do][the][trick]';
|
||||
$data[0]->value = 'yes';
|
||||
$data[1] = new StdClass;
|
||||
$data[1] = new StdClass();
|
||||
$data[1]->name = 'would[2][do][the][trick]';
|
||||
$data[1]->value = 'yes';
|
||||
$data[2] = new StdClass;
|
||||
$data[2] = new StdClass();
|
||||
$data[2]->name = 'would[2][do][the][job]';
|
||||
$data[2]->value = 'yes';
|
||||
$_POST['nav-menu-data'] = addslashes( json_encode( $data ) );
|
||||
|
||||
@@ -401,7 +401,7 @@ class Tests_Meta extends WP_UnitTestCase {
|
||||
* @ticket 15030
|
||||
*/
|
||||
public function test_get_metadata_with_empty_key_object_value() {
|
||||
$data = new stdClass;
|
||||
$data = new stdClass();
|
||||
$data->foo = 'bar';
|
||||
$value = serialize( $data );
|
||||
add_metadata( 'user', $this->author->ID, 'foo', $data );
|
||||
|
||||
@@ -49,7 +49,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
|
||||
add_filter( 'pre_http_request', array( $this, 'mock_embed_request' ), 10, 3 );
|
||||
|
||||
@@ -145,7 +145,7 @@ class Tests_POMO_MO extends WP_UnitTestCase {
|
||||
|
||||
public function test_export_should_not_include_empty_translations() {
|
||||
$entries = array();
|
||||
$mo = new MO;
|
||||
$mo = new MO();
|
||||
$mo->add_entry(
|
||||
array(
|
||||
'singular' => 'baba',
|
||||
|
||||
@@ -28,7 +28,7 @@ class Tests_POMO_NOOPTranslations extends WP_UnitTestCase {
|
||||
|
||||
public function set_up() {
|
||||
parent::set_up();
|
||||
$this->noop = new NOOP_Translations;
|
||||
$this->noop = new NOOP_Translations();
|
||||
$this->entry = new Translation_Entry( array( 'singular' => 'baba' ) );
|
||||
$this->plural_entry = new Translation_Entry(
|
||||
array(
|
||||
|
||||
@@ -121,7 +121,7 @@ class Tests_POMO_Translations extends WP_UnitTestCase {
|
||||
$domain = new Translations();
|
||||
$domain->add_entry( $entry_digit_1 );
|
||||
$domain->add_entry( $entry_digit_2 );
|
||||
$dummy_translation = new Translations;
|
||||
$dummy_translation = new Translations();
|
||||
$this->assertSame( '1', $domain->translate( '1' ) );
|
||||
$domain->merge_with( $dummy_translation );
|
||||
$this->assertSame( '1', $domain->translate( '1' ) );
|
||||
|
||||
@@ -158,7 +158,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
|
||||
_unregister_post_type( $post_type );
|
||||
$count = wp_count_posts( $post_type, 'readable' );
|
||||
$this->assertEquals( new stdClass, $count );
|
||||
$this->assertEquals( new stdClass(), $count );
|
||||
}
|
||||
|
||||
public function test_wp_count_posts_filtered() {
|
||||
@@ -601,7 +601,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
'1 int' => array( 1 ),
|
||||
'null' => array( null ),
|
||||
'true' => array( true ),
|
||||
'an object' => array( new stdClass ),
|
||||
'an object' => array( new stdClass() ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class Tests_Post_Meta extends WP_UnitTestCase {
|
||||
$mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', 'get_post_meta_by_key_value', true );
|
||||
$this->assertIsInt( $mid );
|
||||
|
||||
$mobj = new stdClass;
|
||||
$mobj = new stdClass();
|
||||
$mobj->meta_id = $mid;
|
||||
$mobj->post_id = self::$post_id;
|
||||
$mobj->meta_key = 'get_post_meta_by_key';
|
||||
|
||||
@@ -256,7 +256,7 @@ class Tests_Post_Types extends WP_UnitTestCase {
|
||||
$this->assertNotNull( get_post_type_object( 'foo' ) );
|
||||
$this->assertNull( get_post_type_object( array() ) );
|
||||
$this->assertNull( get_post_type_object( array( 'foo' ) ) );
|
||||
$this->assertNull( get_post_type_object( new stdClass ) );
|
||||
$this->assertNull( get_post_type_object( new stdClass() ) );
|
||||
|
||||
_unregister_post_type( 'foo' );
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class Tests_Query extends WP_UnitTestCase {
|
||||
* @ticket 16471
|
||||
*/
|
||||
public function test_default_query_var() {
|
||||
$query = new WP_Query;
|
||||
$query = new WP_Query();
|
||||
$this->assertSame( '', $query->get( 'nonexistent' ) );
|
||||
$this->assertFalse( $query->get( 'nonexistent', false ) );
|
||||
$this->assertTrue( $query->get( 'nonexistent', true ) );
|
||||
|
||||
@@ -19,7 +19,7 @@ class Tests_Query_GeneratePostdata extends WP_UnitTestCase {
|
||||
* @ticket 42814
|
||||
*/
|
||||
public function test_setup_by_fake_post() {
|
||||
$fake = new stdClass;
|
||||
$fake = new stdClass();
|
||||
$fake->ID = 98765;
|
||||
$data = generate_postdata( $fake->ID );
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class Tests_Query_SetupPostdata extends WP_UnitTestCase {
|
||||
* @ticket 30970
|
||||
*/
|
||||
public function test_setup_by_fake_post() {
|
||||
$fake = new stdClass;
|
||||
$fake = new stdClass();
|
||||
$fake->ID = 98765;
|
||||
setup_postdata( $fake->ID );
|
||||
|
||||
|
||||
@@ -624,15 +624,15 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase {
|
||||
* @ticket 47620
|
||||
*/
|
||||
public function test_prepare_item() {
|
||||
$registry = new WP_Block_Type_Registry;
|
||||
$registry = new WP_Block_Type_Registry();
|
||||
$settings = array(
|
||||
'icon' => 'text',
|
||||
'render_callback' => '__return_null',
|
||||
);
|
||||
$registry->register( 'fake/line', $settings );
|
||||
$block_type = $registry->get_registered( 'fake/line' );
|
||||
$endpoint = new WP_REST_Block_Types_Controller;
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Block_Types_Controller();
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$response = $endpoint->prepare_item_for_response( $block_type, $request );
|
||||
$this->check_block_type_object( $block_type, $response->get_data(), $response->get_links() );
|
||||
@@ -642,15 +642,15 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase {
|
||||
* @ticket 47620
|
||||
*/
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$registry = new WP_Block_Type_Registry;
|
||||
$registry = new WP_Block_Type_Registry();
|
||||
$settings = array(
|
||||
'icon' => 'text',
|
||||
'render_callback' => '__return_null',
|
||||
);
|
||||
$registry->register( 'fake/line', $settings );
|
||||
$block_type = $registry->get_registered( 'fake/line' );
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Block_Types_Controller;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Block_Types_Controller();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'name' );
|
||||
$response = $endpoint->prepare_item_for_response( $block_type, $request );
|
||||
|
||||
@@ -1093,7 +1093,7 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas
|
||||
}
|
||||
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$request = new WP_REST_Request;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Terms_Controller( 'category' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$term = get_term( 1, 'category' );
|
||||
|
||||
@@ -152,7 +152,7 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase
|
||||
|
||||
public function set_up() {
|
||||
parent::set_up();
|
||||
$this->endpoint = new WP_REST_Comments_Controller;
|
||||
$this->endpoint = new WP_REST_Comments_Controller();
|
||||
if ( is_multisite() ) {
|
||||
update_site_option( 'site_admins', array( 'superadmin' ) );
|
||||
}
|
||||
@@ -953,7 +953,7 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase
|
||||
public function test_prepare_item_limit_fields() {
|
||||
wp_set_current_user( self::$admin_id );
|
||||
|
||||
$endpoint = new WP_REST_Comments_Controller;
|
||||
$endpoint = new WP_REST_Comments_Controller();
|
||||
$request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'id,status' );
|
||||
|
||||
@@ -247,7 +247,7 @@ class WP_Test_REST_Post_Meta_Fields extends WP_Test_REST_TestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ class WP_Test_REST_Post_Meta_Fields extends WP_Test_REST_TestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
|
||||
add_post_meta( self::$post_id, 'test_string', 42 );
|
||||
|
||||
@@ -125,8 +125,8 @@ class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Test
|
||||
|
||||
public function test_prepare_item() {
|
||||
$obj = get_post_status_object( 'publish' );
|
||||
$endpoint = new WP_REST_Post_Statuses_Controller;
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Post_Statuses_Controller();
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$data = $endpoint->prepare_item_for_response( $obj, $request );
|
||||
$this->check_post_status_obj( $obj, $data->get_data(), $data->get_links() );
|
||||
@@ -134,8 +134,8 @@ class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Test
|
||||
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$obj = get_post_status_object( 'publish' );
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Post_Statuses_Controller;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Post_Statuses_Controller();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$response = $endpoint->prepare_item_for_response( $obj, $request );
|
||||
|
||||
@@ -133,8 +133,8 @@ class WP_Test_REST_Post_Types_Controller extends WP_Test_REST_Controller_Testcas
|
||||
|
||||
public function test_prepare_item() {
|
||||
$obj = get_post_type_object( 'post' );
|
||||
$endpoint = new WP_REST_Post_Types_Controller;
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Post_Types_Controller();
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$response = $endpoint->prepare_item_for_response( $obj, $request );
|
||||
$this->check_post_type_obj( 'edit', $obj, $response->get_data(), $response->get_links() );
|
||||
@@ -142,8 +142,8 @@ class WP_Test_REST_Post_Types_Controller extends WP_Test_REST_Controller_Testcas
|
||||
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$obj = get_post_type_object( 'post' );
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Post_Types_Controller;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Post_Types_Controller();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$response = $endpoint->prepare_item_for_response( $obj, $request );
|
||||
|
||||
@@ -20,7 +20,7 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
|
||||
add_filter( 'pre_http_request', array( $this, 'mock_embed_request' ), 10, 3 );
|
||||
|
||||
@@ -1211,7 +1211,7 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
}
|
||||
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$request = new WP_REST_Request;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Terms_Controller( 'post_tag' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
|
||||
|
||||
@@ -174,8 +174,8 @@ class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas
|
||||
|
||||
public function test_prepare_item() {
|
||||
$tax = get_taxonomy( 'category' );
|
||||
$endpoint = new WP_REST_Taxonomies_Controller;
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Taxonomies_Controller();
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$response = $endpoint->prepare_item_for_response( $tax, $request );
|
||||
$this->check_taxonomy_object( 'edit', $tax, $response->get_data(), $response->get_links() );
|
||||
@@ -183,8 +183,8 @@ class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas
|
||||
|
||||
public function test_prepare_item_limit_fields() {
|
||||
$tax = get_taxonomy( 'category' );
|
||||
$request = new WP_REST_Request;
|
||||
$endpoint = new WP_REST_Taxonomies_Controller;
|
||||
$request = new WP_REST_Request();
|
||||
$endpoint = new WP_REST_Taxonomies_Controller();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$response = $endpoint->prepare_item_for_response( $tax, $request );
|
||||
|
||||
@@ -194,7 +194,7 @@ class WP_Test_REST_Term_Meta_Fields extends WP_Test_REST_TestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ class WP_Test_REST_Term_Meta_Fields extends WP_Test_REST_TestCase {
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
$wp_rest_server = new Spy_REST_Server;
|
||||
$wp_rest_server = new Spy_REST_Server();
|
||||
do_action( 'rest_api_init', $wp_rest_server );
|
||||
|
||||
add_term_meta( self::$category_id, 'test_string', 42 );
|
||||
|
||||
@@ -974,7 +974,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
public function test_prepare_item() {
|
||||
wp_set_current_user( self::$user );
|
||||
|
||||
$request = new WP_REST_Request;
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$user = get_user_by( 'id', get_current_user_id() );
|
||||
$data = $this->endpoint->prepare_item_for_response( $user, $request );
|
||||
@@ -984,7 +984,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
public function test_prepare_item_limit_fields() {
|
||||
wp_set_current_user( self::$user );
|
||||
|
||||
$request = new WP_REST_Request;
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$request->set_param( '_fields', 'id,name' );
|
||||
$user = get_user_by( 'id', get_current_user_id() );
|
||||
|
||||
@@ -118,7 +118,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
$response = rest_get_server()->dispatch( $request );
|
||||
$data = $response->get_data();
|
||||
$this->assertGreaterThan( 1, count( $data ) );
|
||||
$endpoint = new WP_REST_Widget_Types_Controller;
|
||||
$endpoint = new WP_REST_Widget_Types_Controller();
|
||||
foreach ( $data as $item ) {
|
||||
$widget_type = $endpoint->get_widget( $item['name'] );
|
||||
$this->check_widget_type_object( $widget_type, $item, $item['_links'] );
|
||||
@@ -180,7 +180,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
wp_set_current_user( self::$admin_id );
|
||||
$request = new WP_REST_Request( 'GET', '/wp/v2/widget-types/' . $widget_name );
|
||||
$response = rest_get_server()->dispatch( $request );
|
||||
$endpoint = new WP_REST_Widget_Types_Controller;
|
||||
$endpoint = new WP_REST_Widget_Types_Controller();
|
||||
$widget_type = $endpoint->get_widget( $widget_name );
|
||||
$this->check_widget_type_object( $widget_type, $response->get_data(), $response->get_links() );
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
wp_set_current_user( self::$admin_id );
|
||||
$request = new WP_REST_Request( 'GET', '/wp/v2/widget-types/' . $widget_id );
|
||||
$response = rest_get_server()->dispatch( $request );
|
||||
$endpoint = new WP_REST_Widget_Types_Controller;
|
||||
$endpoint = new WP_REST_Widget_Types_Controller();
|
||||
$widget_type = $endpoint->get_widget( $widget_id );
|
||||
$this->check_widget_type_object( $widget_type, $response->get_data(), $response->get_links() );
|
||||
}
|
||||
@@ -298,9 +298,9 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
* @ticket 41683
|
||||
*/
|
||||
public function test_prepare_item() {
|
||||
$endpoint = new WP_REST_Widget_Types_Controller;
|
||||
$endpoint = new WP_REST_Widget_Types_Controller();
|
||||
$widget_type = $endpoint->get_widget( 'calendar' );
|
||||
$request = new WP_REST_Request;
|
||||
$request = new WP_REST_Request();
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$response = $endpoint->prepare_item_for_response( $widget_type, $request );
|
||||
$this->check_widget_type_object( $widget_type, $response->get_data(), $response->get_links() );
|
||||
@@ -366,7 +366,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
array(
|
||||
'encoded' => base64_encode( serialize( array() ) ),
|
||||
'hash' => wp_hash( serialize( array() ) ),
|
||||
'raw' => new stdClass,
|
||||
'raw' => new stdClass(),
|
||||
),
|
||||
$data['instance']
|
||||
);
|
||||
@@ -402,7 +402,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc
|
||||
array(
|
||||
'encoded' => base64_encode( serialize( array() ) ),
|
||||
'hash' => wp_hash( serialize( array() ) ),
|
||||
'raw' => new stdClass,
|
||||
'raw' => new stdClass(),
|
||||
),
|
||||
$data['instance']
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user