When an incomplete header is provided (eg, 'From' with an email address but no
name), ensure that the WP defaults are filled in properly.
Props valendesigns.
Fixes#30266.
git-svn-id: https://develop.svn.wordpress.org/trunk@32070 602fd350-edb4-49c9-b593-d223f7449a82
`get_permalink()` will return a non-pretty permalink for future posts, which
breaks some user workflows that expect View Post to lead to a page with the
pretty permalink.
Fixes#30910.
git-svn-id: https://develop.svn.wordpress.org/trunk@32002 602fd350-edb4-49c9-b593-d223f7449a82
Fall back to term ID if the sanitized slug is numeric or only contains hyphens.
props SergeyBiryukov, A5hleyRich, sgrant, davideugenepratt.
fixes#30883.
git-svn-id: https://develop.svn.wordpress.org/trunk@31979 602fd350-edb4-49c9-b593-d223f7449a82
Although this logic looks a little strange at this low level, it's the best location within the Upgrades code for it to happen.
Fixes#31811
git-svn-id: https://develop.svn.wordpress.org/trunk@31936 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the tests were using '/feed/' in their `go_to()` statements, but
testing nodes for URLs like '?p='. This mismatch created unpredictable results
when the run in certain sequences with other groups of unit tests.
See #31705.
git-svn-id: https://develop.svn.wordpress.org/trunk@31846 602fd350-edb4-49c9-b593-d223f7449a82
* Introduce a `__construct()` method, which can accept an array of query vars.
* Move query logic out of `query()` method and into a new `get_comments()` method.
* Ensure that `$this->comments` is set whenever `get_comments()` returns a value.
* Introduce a `parse_query()` method, where query vars are parsed with default values and the 'parse_comment_query' action is fired.
These changes bring `WP_Comment_Query` syntax closer to that of `WP_Query`.
Props westonruter, morganestes, boonebgorges.
Fixes#24826.
git-svn-id: https://develop.svn.wordpress.org/trunk@31793 602fd350-edb4-49c9-b593-d223f7449a82
`wp_insert_term()` protects against the creation of terms with duplicate names
at the same level of a taxonomy hierarchy. However, it's historically been
possible to override this protection by explicitly providing a value of `$slug`
that is unique at the hierarchy tier. This ability was broken in [31734], and
the current changeset restores the original behavior.
A number of unit tests are added and refactored in support of these changes.
See #17689 for discussion of a fix that was superceded by [31734]. This commit
retains the fix for the underlying bug described in that ticket.
See #31328.
git-svn-id: https://develop.svn.wordpress.org/trunk@31792 602fd350-edb4-49c9-b593-d223f7449a82
The introduction of a Customizer test that creates a new blog [31707] causes
`WP_INSTALLING` to be set by the time the `wp_get_archives()` tests run. This,
in turn, causes the query counts to vary in unpredictable ways.
See #31130.
git-svn-id: https://develop.svn.wordpress.org/trunk@31764 602fd350-edb4-49c9-b593-d223f7449a82
Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.
Props batmoo, joen and mkaz for the original plugin upon which this is based.
Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.
See #31242
git-svn-id: https://develop.svn.wordpress.org/trunk@31733 602fd350-edb4-49c9-b593-d223f7449a82
* Unset `wp_get_sidebars_widgets()`' non-admin cache var `$_wp_sidebars_widgets` in Customize theme preview.
* Add `WP_Customize_Setting::$dirty` so that settings can be initially-dirty when the Customizer loads.
* Mark `old_sidebars_widgets_data` setting initially-dirty.
* Mark all `sidebars_widgets` settings as initially-dirty during theme switch.
props westonruter.
see #31484.
git-svn-id: https://develop.svn.wordpress.org/trunk@31705 602fd350-edb4-49c9-b593-d223f7449a82
The new 'submit_button' and 'submit_field' parameters for `comment_form()`
allow developers to modify the markup of the submit button and its wrapper.
These params are accompanied by targeted 'comment_form_submit_button' and
'comment_form_submit_field' filters on the concatenated markup.
Props coffee2code, morpheu5, DrewAPicture, boonebgorges.
Fixes#15015.
git-svn-id: https://develop.svn.wordpress.org/trunk@31699 602fd350-edb4-49c9-b593-d223f7449a82
Make sure the caption is always set if found. Previously, if the caption was less than 80 characters, only the Title field would be set.
props beaulebens, ericlewis, bendoh, SergeyBiryukov.
fixes#22768.
git-svn-id: https://develop.svn.wordpress.org/trunk@31694 602fd350-edb4-49c9-b593-d223f7449a82
Recent commits have added the ability to order query results by specific
clauses of the 'meta_query' parameter (comments [31467], posts [31312] and
[31340]). The current changeset ports the same functionality to `WP_User_Query`.
Also introduced is the ability to pass the value of `$meta_key` to 'orderby'.
The internals of `WP_User_Query::prepare_users()` had to be reordered
somewhat to support these changes, primarily to ensure that the `meta_query`
object generates its SQL clauses before the 'orderby' parameter is parsed.
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31669 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ports a number of 'orderby' features from `WP_Query` and
`WP_Comment_Query`:
* Allow multiple 'orderby' values to be passed as a space-separated list.
* Allow multiple 'orderby' values to be passed as a flat array.
* Allow multi-dimensional 'orderby', with orderby fields as array keys and ASC/DESC as the corresponding values.
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31663 602fd350-edb4-49c9-b593-d223f7449a82
* In `WP_Query` and `WP_Comment_Query`, ensure that 'orderby' can parse multiple values for 'orderby' when passed as a space-separated string.
* In `WP_User_Query`, ensure that "shorthand" orderbys (like 'login' and 'name') are converted to their full versions (like 'user_login' and 'display_name').
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31662 602fd350-edb4-49c9-b593-d223f7449a82
This change makes the 'post_type' clause in `wp_list_authors()` redundant, so
we remove it. Third-party plugins using `get_posts_by_author_sql()` may have
similarly redundant clauses, but this won't change the results returned by the
SQL queries.
Also adds unit tests for `get_posts_by_author_sql()`.
Props pbearne.
Fixes#30354.
git-svn-id: https://develop.svn.wordpress.org/trunk@31653 602fd350-edb4-49c9-b593-d223f7449a82
[31628] made it possible to pass an `$autoload` param to `update_option()` that
applies when the option does not yet exist in the database. The current
changeset introduces parity for existing options: the `$autoload` setting
for existing options can be changed via the `$autoload` parameter. For internal
simplicity, `$autoload` is ignored for existing options when `$value` is not
also changed.
This changeset also moves `update_option()` tests into their own class.
Props dd32.
Fixes#26394.
git-svn-id: https://develop.svn.wordpress.org/trunk@31640 602fd350-edb4-49c9-b593-d223f7449a82
When creating an option via `add_option()`, the `$autoload` param allows you to
tell WP whether the option should be loaded as part of the 'alloptions' cache
during every pageload. `update_option()`, when used with a non-existent option
calls `add_option()` internally. The new `$autoload` param in `update_option()`
is passed along to `add_option()` in cases where the option does not yet exist.
The associated unit tests are skipped on multisite due to an issue that causes
`WP_INSTALLING` to force cache misses. See #31130.
Props codix, nofearinc, MikeHansenMe.
Fixes#26394.
git-svn-id: https://develop.svn.wordpress.org/trunk@31628 602fd350-edb4-49c9-b593-d223f7449a82
`WP_UnitTestCase::tearDown()` restores the test environment to the default
conditions, including rolling back the MySQL transaction that the test takes
place in, resetting globals, and unhooking test-specific filters. As such, all
teardown routines for specific tests should happen before the parent class's
`tearDown()` method is called. Failure to do so can cause database locks on
certain configurations, among other problems.
See #31537.
git-svn-id: https://develop.svn.wordpress.org/trunk@31622 602fd350-edb4-49c9-b593-d223f7449a82
The 'cpage' query var is only set when using `comments_template()` to display
comments. If displaying them in a context where 'cpage' is not yet set, the
default value should be 1, not 0.
Props MomDad, couturefreak.
Fixes#20319.
git-svn-id: https://develop.svn.wordpress.org/trunk@31617 602fd350-edb4-49c9-b593-d223f7449a82