Make WordPress Core


Ignore:
Timestamp:
12/25/2019 09:39:46 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Update legacy arguments passed to WP_UnitTest_Factory_For_Blog::create_object().

This converts the arguments originally meant for wpmu_create_blog() to the ones used by wp_insert_site().

Follow-up to [47011].

Fixes #47195.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php

    r47011 r47013  
    3434        global $wpdb;
    3535
    36         // Map some arguments for backward compatibility with wpmu_create_blog() previously used here.
    37         if ( ! isset( $args['public'] ) ) {
    38             // Default to public, unless an options array was provided.
    39             $args['public'] = ! isset( $args['meta'] ) ? 1 : 0;
    40         }
    41 
    42         if ( ! isset( $args['user_id'] ) ) {
    43             $args['user_id'] = get_current_user_id();
    44         }
    45 
    46         if ( isset( $args['site_id'] ) ) {
     36        // Map some arguments for backward compatibility with `wpmu_create_blog()` previously used here.
     37        if ( ! isset( $args['network_id'] ) && isset( $args['site_id'] ) ) {
    4738            $args['network_id'] = $args['site_id'];
    4839            unset( $args['site_id'] );
Note: See TracChangeset for help on using the changeset viewer.