WordPress/wp-admin/includes
Felix Arntz 2b10923a28 Multisite: Introduce a site initialization and uninitialization API.
This changeset makes the new CRUD API for sites introduced in [43548] usable for real-world sites. A new function `wp_initialize_site()`, which takes care of creating a site's database tables and populating them with initial values, is hooked into the site insertion process that is initiated when calling `wp_insert_site()`. Similarly, a new function `wp_uninitialize_site()`, which takes care of dropping a site's database tables, is hooked into the site deletion process that is initiated when calling `wp_delete_site()`.

A new function `wp_is_site_initialized()` completes the API, allowing to check whether a site is initialized. Since this function always makes a database request in its default behavior, it should be called with caution. Plugins that would like to use site initialization in special ways can leverage a `pre_wp_is_site_initialized` filter to alter that default behavior.

The separate handling of the site's row in the `wp_blogs` database table and the actual site setup allows for more flexibility in controlling whether or how a site's data is set up. For example, a unit test that only checks data from the site's database table row can unhook the site initialization process to improve performance. At the same time, developers consuming the new sites API only need to know about the CRUD functions, since the initialization and uninitialization processes happen internally.

With this changeset, the foundation for a sites REST API endpoint is fully available. The previously recommended functions `wpmu_create_blog()` and `wpmu_delete_blog()` now call the new respective function internally. Further follow-up work to this includes replacing calls to `wpmu_create_blog()` with `wp_insert_site()`, `update_blog_details()` with `wp_update_site()` and `wpmu_delete_blog()` with `wp_delete_blog()` throughout the codebase.

As a side-effect of this work, the `wpmu_new_blog`, `delete_blog`, and `deleted_blog` actions and the `install_blog()` function have been deprecated.

Fixes #41333. See #40364.

Built from https://develop.svn.wordpress.org/trunk@43654


git-svn-id: http://core.svn.wordpress.org/trunk@43483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-09-24 15:09:26 +00:00
..
admin-filters.php Privacy: Enable pagination screen options for privacy requests list tables. 2018-07-17 16:04:24 +00:00
admin.php
ajax-actions.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
bookmark.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-automatic-upgrader-skin.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-bulk-plugin-upgrader-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-bulk-theme-upgrader-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-bulk-upgrader-skin.php I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders. 2018-03-11 16:44:34 +00:00
class-core-upgrader.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-file-upload-upgrader.php
class-ftp-pure.php
class-ftp-sockets.php
class-ftp.php
class-language-pack-upgrader-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-language-pack-upgrader.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-pclzip.php
class-plugin-installer-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-plugin-upgrader-skin.php Docs: Document many more parameters and properties using typed array notation. 2018-03-22 20:27:32 +00:00
class-plugin-upgrader.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-theme-installer-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-theme-upgrader-skin.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-theme-upgrader.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-walker-category-checklist.php
class-walker-nav-menu-checklist.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-walker-nav-menu-edit.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-wp-ajax-upgrader-skin.php General: Introduce WP_Error::has_errors() method and use it where appropriate. 2018-02-27 02:31:31 +00:00
class-wp-automatic-updater.php I18n: Improve translators comments [3]. 2018-08-30 13:36:25 +00:00
class-wp-comments-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-community-events.php Docs: Update @since versions in Community Events class added in [42726]. 2018-06-28 02:34:04 +00:00
class-wp-filesystem-base.php
class-wp-filesystem-direct.php
class-wp-filesystem-ftpext.php
class-wp-filesystem-ftpsockets.php
class-wp-filesystem-ssh2.php
class-wp-importer.php Import: Avoid counting an uncountable type when reading arguments passed to a script. 2018-03-02 17:17:31 +00:00
class-wp-internal-pointers.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-links-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-list-table-compat.php
class-wp-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-media-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-ms-sites-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-ms-themes-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-ms-users-list-table.php Docs: Document many more parameters and properties using typed array notation. 2018-03-22 20:27:32 +00:00
class-wp-plugin-install-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-plugins-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-post-comments-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-posts-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-screen.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-site-icon.php Docs: Document many more parameters and properties using typed array notation. 2018-03-22 20:27:32 +00:00
class-wp-terms-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-theme-install-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-themes-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
class-wp-upgrader-skin.php General: Introduce WP_Error::has_errors() method and use it where appropriate. 2018-02-27 02:31:31 +00:00
class-wp-upgrader-skins.php
class-wp-upgrader.php Docs: Standardise and correct documentation relating to parameters which accept plugin names. 2018-03-05 21:50:31 +00:00
class-wp-users-list-table.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
comment.php
continents-cities.php I18N: Update list of continents and cities for the timezone selection. 2018-07-18 11:21:25 +00:00
credits.php
dashboard.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
deprecated.php Taxonomy: restore TagSearch unit tests and correct deprecated version string. 2018-02-25 16:28:30 +00:00
edit-tag-messages.php
export.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
file.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
image-edit.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
image.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
import.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
list-table.php Docs: Update and correct various inline documentation. 2018-05-07 17:20:22 +00:00
media.php Docs: Correct and improve some docblocks. 2018-09-14 13:35:25 +00:00
menu.php
meta-boxes.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
misc.php Docs: Correct @since value for _wp_privacy_statuses(). 2018-09-13 10:20:24 +00:00
ms-admin-filters.php
ms-deprecated.php
ms.php Multisite: Introduce a site initialization and uninitialization API. 2018-09-24 15:09:26 +00:00
nav-menu.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
network.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
noop.php
options.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
plugin-install.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
plugin.php Privacy: Make sure wp_add_privacy_policy_content() does not cause a fatal error by unintentionally flushing rewrite rules outside of the admin context. 2018-06-28 02:36:09 +00:00
post.php Docs: Correct and improve various inline documentation. 2018-08-27 14:28:26 +00:00
revision.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
schema.php Upgrade/Install: Fix coding standard errors after [43629]. 2018-09-05 12:50:24 +00:00
screen.php
taxonomy.php Docs: Correct and improve various inline documentation. 2018-03-25 19:35:29 +00:00
template.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
theme-install.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
theme.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
translation-install.php
update-core.php Docs: Use consistent description for $wp_filesystem global. 2018-03-04 21:58:30 +00:00
update.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
upgrade.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
user.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00
widgets.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:51:36 +00:00