The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.
A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available. However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.
The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.
Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828
git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Assigns the `wp-activate-container` and `wp-signup-container` to the container inside `#signup-container` on each. This container already existed in `wp-signup.php` and is new in `wp-activate.php`.
Props ocean90.
Fixes#25478.
Built from https://develop.svn.wordpress.org/trunk@34814
git-svn-id: http://core.svn.wordpress.org/trunk@34779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After some discussion, it was decided that Multisite vs single site context can just as easily be derived using available functions like `is_network_admin()`, `get_current_screen()`, etc., rendering the second parameter moot. The hook was introduced in [34796].
Fixes#25360.
Built from https://develop.svn.wordpress.org/trunk@34813
git-svn-id: http://core.svn.wordpress.org/trunk@34778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This function attempts to read from the relationship cache, and uses any data
it finds. If it finds no data, it does a query for the data it needs. Since we
are going to the trouble to query for the relationships, and since we are
already using cached data when available, let's go ahead and cache it for
later use.
Props joehoyle, boonebgorges.
Fixes#32044.
Built from https://develop.svn.wordpress.org/trunk@34812
git-svn-id: http://core.svn.wordpress.org/trunk@34777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Renames `reset_permalinks()` to `set_permalink_structure()` (mimicking `$wp_rewrite->set_permalink_structure()`) and allows it to accept an optional permalink structure. In this way, we can double dip using it to both set and reset the permalink structure from anywhere.
Removes alot of duplicated code from tests.
See #33968.
Built from https://develop.svn.wordpress.org/trunk@34810
git-svn-id: http://core.svn.wordpress.org/trunk@34775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp_insert_term()` doesn't allow the creation of a term when the term `name`
is the same as another term in the same hierarchy level of the same taxonomy.
Previously, this duplicate check used `get_term_by( 'name' )`, which uses the
database collation to determine sameness. But common collations do not
distinguish between accented and non-accented versions of a character. As a
result, it was impossible to create a term 'Foo' if a sibling term with an
accented character existed.
We address this problem by using `get_terms()` to do the duplicate check. This
query returns all potentially matching terms. We then do a stricter check
for equivalence in PHP, before determining whether one of the matches is
indeed a duplicate.
Props boonebgorges, tyxla, geza.miklo, mehulkaklotar.
Fixes#33864.
Built from https://develop.svn.wordpress.org/trunk@34809
git-svn-id: http://core.svn.wordpress.org/trunk@34774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This filter allows developers to modify the output of `get_page_of_comment()`.
As a side effect of this new filter, comment page numbers will always be
returned as integers. Previously, they would sometimes be returned as floats -
eg `float(2.0)` instead of `int(2)`.
Props laceous.
See #13939.
Built from https://develop.svn.wordpress.org/trunk@34808
git-svn-id: http://core.svn.wordpress.org/trunk@34773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The function now uses the following order of precedence when calculating
comment pagination: 1. the 'per_page' value passed in the `$args` array,
2. the 'comments_per_page' query var in `$wp_query`, and 3. the
'comments_per_page' setting from options-discussion.php. This change allows
`get_page_of_comment()` to return an accurate value before the main query
has been run.
Props laceous.
See #13939.
Built from https://develop.svn.wordpress.org/trunk@34806
git-svn-id: http://core.svn.wordpress.org/trunk@34771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This prevents notices from being thrown when a 'pre_get_users' callback
removes required values from the list of `query_vars`.
For backward compatibility with previous uses of 'pre_get_users', default
values are parsed both before and after the action is fired.
Fixes#33449.
Built from https://develop.svn.wordpress.org/trunk@34804
git-svn-id: http://core.svn.wordpress.org/trunk@34769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The current list table is passed as a second parameter, `$this`, and can take the form of either a `WP_Users_List_Table` or `WP_MS_Users_List_Table` instance depending on the context in which the filter was evaluated.
Props juliobox for the initial patch.
Fixes#25360.
Built from https://develop.svn.wordpress.org/trunk@34796
git-svn-id: http://core.svn.wordpress.org/trunk@34761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Instead of using `Array.toString()` to serialize an array with comma delimiters, explicitly `join` the array using spaces instead. Also ensure that `xfn` is handled properly if it ever gets stored as an array.
Props tyxla, westonruter.
Fixes#34111.
Built from https://develop.svn.wordpress.org/trunk@34788
git-svn-id: http://core.svn.wordpress.org/trunk@34753 1a063a9b-81f0-0310-95a4-ce76da25c4cd