Our call to `$wp_roles->_init()` relied on the `__call()` method in `WP_Roles` to handle the link to the protected method. This works back to PHP 5.2.9, when a bug was fixed allowing access to protected methods through this exact approach.
`install_blog()` needs a fresh `$wp_roles` object after `populate_roles()` resets everything in its path. We can create this new object from scratch, effectively doing the same thing with the call to `_init()` via the constructor.
Fixes#29692 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@30242 602fd350-edb4-49c9-b593-d223f7449a82
When updating an existing taxonomy term that shares its `term_id` with
another term, we generate a new row in `wp_terms` and associate the updated
term_taxonomy_id with the new term. This separates the terms, such that
updating the name of one term does not change the name of any others.
Note that this term splitting only occurs on installations whose database
schemas have been upgraded to version 30133 or higher. Note also that shared
terms are only split when run through `wp_update_term()`, as on edit-tags.php;
we will wait until a future release of WordPress to force the splitting of all
shared taxonomy terms.
Props boonebgorges, rmccue, greuben, garyc40, wonderboymusic, imath, jesin.
Fixes#5809.
git-svn-id: https://develop.svn.wordpress.org/trunk@30241 602fd350-edb4-49c9-b593-d223f7449a82
A "shared" term occurs when two entries in the `wp_term_taxonomy` table share a
single `term_id`, and thereby correspond to the same row in `wp_terms`. This
changeset stops the practice of creating shared terms: each new row in
`wp_term_taxonomy` will receive its own row in `wp_terms`. The new strategy
for term creation depends on whether the installation's database schema is up
to date for 4.1:
* If so, terms are allowed to be created with the same slug as an existing term, as long as they are in different taxonomies and do not share a parent. Thus, a new tag with the slug 'wordpress' can exist alongside a category with the slug 'wordpress'.
* If not, new terms will be forced to have unique slugs. Thus, on an installation containing a category with the slug 'wordpress', a new tag 'WordPress' will get the slug 'wordpress-2'.
Fixes#21950. See #5809.
git-svn-id: https://develop.svn.wordpress.org/trunk@30240 602fd350-edb4-49c9-b593-d223f7449a82
In case of edge cases where a duplicate term might exist in a replicated
database for a split second, these explicit query clauses ensure that
`term_exists()` will always recognize the oldest matched term as the
canonical one. See [30238] for background.
Props pento.
See #22023, #5809.
git-svn-id: https://develop.svn.wordpress.org/trunk@30239 602fd350-edb4-49c9-b593-d223f7449a82
In [30056], the UNIQUE index was removed from the 'slug' column of `wp_terms`.
While we have numerous checks in place to avoid the creation of unwanted
duplicate term+term_taxonomy pairs, it's possible that in certain edge cases -
such as during the lag caused by database replication, or a race condition
involving near-simultaneous creation of more than one term - we'll end up
unwittingly inserting two identical rows.
The current changeset minimizes this risk by introducing a failsafe mechanism
into `wp_insert_term()`. After a term and term_taxonomy are INSERTed, we check
to see whether the term just created is a duplicate of an existing term; if so,
we delete the new one and keep the old one. This prevents problems caused by
replication lag, because SELECT queries that take place after an INSERT will
hit the master database; it mitigates race conditions by enforcing that the
term that was created first (ie, the one with the lowest `term_id`) is
always the "canonical" one.
Props nacin, markjaquith.
See #22023, #5809.
git-svn-id: https://develop.svn.wordpress.org/trunk@30238 602fd350-edb4-49c9-b593-d223f7449a82
Also define the default values for `$before` and `$after` in the template tag documentation.
See [30223]. See #21995.
git-svn-id: https://develop.svn.wordpress.org/trunk@30224 602fd350-edb4-49c9-b593-d223f7449a82
* `get_the_archive_title()` and `the_archive_title()` for returning/displaying the title of the current term, date, post type, post format, or author archive.
* `get_the_archive_description()` and `the_archive_description()` for returning/displaying the description associated with the current term archive.
Fixes#21995
Props obenland, DrewAPicture
git-svn-id: https://develop.svn.wordpress.org/trunk@30223 602fd350-edb4-49c9-b593-d223f7449a82
* In `the_taxonomies()`, only document those arguments that are specific to the function. Arguments shared with `get_the_taxonomies()` should be documented in the later function's docblock.
* Add $args hash documentation to `get_the_taxonomies()`.
* Remove the redundant default argument definition in `the_taxonomies()`.
Fixes#27238.
git-svn-id: https://develop.svn.wordpress.org/trunk@30210 602fd350-edb4-49c9-b593-d223f7449a82
This parameter allows theme and plugin authors to specify the formatting they
would like on the term links as they are parsed into the taxonomy list.
Props hereswhatidid, dlh, davidjlaietta.
See #27238.
git-svn-id: https://develop.svn.wordpress.org/trunk@30209 602fd350-edb4-49c9-b593-d223f7449a82
The previous `in_array()` check was playing too loose with mixed types, such
that a string like '10_term_name' would incorrectly match a term_id 10.
Props nobinobi, realloc.
Fixes#29467.
git-svn-id: https://develop.svn.wordpress.org/trunk@30205 602fd350-edb4-49c9-b593-d223f7449a82
These tests check a number of the ways that different kinds of values for
`$terms` (integers that match term_id, strings that match term_id or name or
slug) are handled.
See #29467.
git-svn-id: https://develop.svn.wordpress.org/trunk@30204 602fd350-edb4-49c9-b593-d223f7449a82