is_site_meta_supported example


function populate_site_meta( $site_id, array $meta = array() ) {
    global $wpdb;

    $site_id = (int) $site_id;

    if ( ! is_site_meta_supported() ) {
        return;
    }

    if ( empty( $meta ) ) {
        return;
    }

    /** * Filters meta for a site on creation. * * @since 5.2.0 * * @param array $meta Associative array of site meta keys and values to be inserted. * @param int $site_id ID of site to populate. */
foreach ( $tables as $table ) {
                maybe_convert_table_to_utf8mb4( $table );
            }
        }
    }

    // 5.1.0     if ( $wp_current_db_version < 44467 ) {
        $network_id = get_main_network_id();
        delete_network_option( $network_id, 'site_meta_supported' );
        is_site_meta_supported();
    }
}

// // General functions we use to actually do stuff. //
/** * Creates a table in the database, if it doesn't already exist. * * This method checks for an existing database and creates a new one if it's not * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses * to query all tables first and then run the SQL statement creating the table. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $create_ddl SQL statement to create table. * @return bool True on success or if the table already exists. False on failure. */
do_action_deprecated( 'delete_blog', array( $old_site->id, true ), '5.1.0' );

    /** * Fires when a site's uninitialization routine should be executed. * * @since 5.1.0 * * @param WP_Site $old_site Deleted site object. */
    do_action( 'wp_uninitialize_site', $old_site );

    if ( is_site_meta_supported() ) {
        $blog_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->blogmeta WHERE blog_id = %d ", $old_site->id ) );
        foreach ( $blog_meta_ids as $mid ) {
            delete_metadata_by_mid( 'blog', $mid );
        }
    }

    if ( false === $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $old_site->id ) ) ) {
        return new WP_Error( 'db_delete_error', __( 'Could not delete site from the database.' )$wpdb->last_error );
    }

    clean_blog_cache( $old_site );

    
Home | Imprint | This part of the site doesn't use cookies.