Make WordPress Core


Ignore:
Timestamp:
03/16/2018 02:14:04 AM (6 years ago)
Author:
flixos90
Message:

Multisite: Introduce metadata for sites.

A new global multisite table wp_blogmeta is added to the database schema, and a set of *_site_meta() API functions are introduced.

The implementation fails gracefully when the new table is not yet available, which may happen especially shortly after the core update, before the network has been upgraded to the new database schema. The presence of the table is detected once and stored as a global setting on the main network.

Core does not yet use site metadata, but there are several use-cases to be implemented or explored in the near future, and it allows plugins to extend sites with arbitrary data, which will come in particularly handy with the upcoming REST API endpoint for sites.

Props spacedmonkey, johnjamesjacoby, jeremyfelt, flixos90.
Fixes #37923.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r42343 r42836  
    21342134        }
    21352135    }
     2136
     2137    // 5.0
     2138    if ( $wp_current_db_version < 42836 ) {
     2139        $network_id = get_main_network_id();
     2140        delete_network_option( $network_id, 'site_meta_supported' );
     2141        is_site_meta_supported();
     2142    }
    21362143}
    21372144
Note: See TracChangeset for help on using the changeset viewer.