* Move the array processing to a new function, `_wp_post_revision_data()`.
* Make both functions accept a post array or a `WP_Post` object.
* Always apply the `_wp_post_revision_fields` filter and pass the post data to it.
Fixes#13382.
git-svn-id: https://develop.svn.wordpress.org/trunk@36659 602fd350-edb4-49c9-b593-d223f7449a82
Similar to `get_post_types()`, this new function returns a list of post type names that support a specific feature.
Props wpsmith, barryceelen, swissspidy.
Fixes#34010.
git-svn-id: https://develop.svn.wordpress.org/trunk@36652 602fd350-edb4-49c9-b593-d223f7449a82
This new helper function is used by the pluggable functions `wp_get_current_user()` and `get_currentuserinfo()`, which was previously being called by the former before [36311]. Without it, infinite loops could be caused when plugins implement these functions, as they are now called the other way around.
Fixes#19615.
git-svn-id: https://develop.svn.wordpress.org/trunk@36651 602fd350-edb4-49c9-b593-d223f7449a82
This prevents showing a blank iframe by first checking if a message was successfully received from it.
Fixes#35894.
git-svn-id: https://develop.svn.wordpress.org/trunk@36648 602fd350-edb4-49c9-b593-d223f7449a82
When ordering search results, exact matches in the post excerpt are weighted
above those in post content, but below those in the post title.
Props swissspidy, sebastian.pisula.
FIxes#35762.
git-svn-id: https://develop.svn.wordpress.org/trunk@36647 602fd350-edb4-49c9-b593-d223f7449a82
Introduces `WP_Customize_Partial::check_capabilities()` for parity with `WP_Customize_Control::check_capabilities()`.
See #27355.
Fixes#35914.
git-svn-id: https://develop.svn.wordpress.org/trunk@36643 602fd350-edb4-49c9-b593-d223f7449a82
Also updates documentation for the first parameter, `$current_user`, to clarify that it holds the `WP_User` object for the _current_ user, not the one being deleted.
Props usermrpapa.
Fixes#35063.
git-svn-id: https://develop.svn.wordpress.org/trunk@36640 602fd350-edb4-49c9-b593-d223f7449a82
Files inside the `wp-admin` directory may not be publicly available. This copies the blue WordPress logo to `wp-includes/images`.
Props thewanderingbrit.
Fixes#35322.
git-svn-id: https://develop.svn.wordpress.org/trunk@36635 602fd350-edb4-49c9-b593-d223f7449a82
This new function can be used to add inline JavaScript before and after enqueued scripts, just like `wp_add_inline_style()` works for CSS.
Props atimmer, abiralneupane, ocean90, swissspidy.
Fixes#14853.
git-svn-id: https://develop.svn.wordpress.org/trunk@36633 602fd350-edb4-49c9-b593-d223f7449a82
`WP_Query` allows random ordering; `'orderby' => 'rand'` translates to
`ORDER BY RAND()`. This syntax results in random ordering that is not
consistent from request to request. MySQL supports the passing of a seed value
to random sorts, such as `ORDER BY RAND(3)`, which will return the same
random value each time it's called. `WP_Query` now supports this syntax, by
passing `RAND(3)` (or whatever integer seed value you'd like) as the value
of `'orderby'`.
Props hlashbrooke.
Fixes#35692.
git-svn-id: https://develop.svn.wordpress.org/trunk@36632 602fd350-edb4-49c9-b593-d223f7449a82
This comes handy if you use WordPress without posts, means `$wp_query` contains no results.
Props prettyboymp, hakre, prettyboymp, Denis-de-Bernardy, ethitter, ocean90.
Fixes#10722.
git-svn-id: https://develop.svn.wordpress.org/trunk@36629 602fd350-edb4-49c9-b593-d223f7449a82
Another chapter in the Storied Annals of Weird `in_array()` Behavior:
`in_array( 4, array( "4-cool-dudes" ) );` resolves to `true`, such that
`is_page( 4 )` was returning true for posts with the name `'4-cool-dudes'`.
We work around this behavior by ensuring that values passed to the `is_`
methods are cast to strings before the `in_array()` checks. ID checks still
work as expected; see #24674.
Props mikejolley, swissspidy, boonebgorges.
Fixes#35902.
git-svn-id: https://develop.svn.wordpress.org/trunk@36625 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that widgets appearing after a nested sidebar will continue to be selective refreshable.
See #27355.
git-svn-id: https://develop.svn.wordpress.org/trunk@36623 602fd350-edb4-49c9-b593-d223f7449a82
Ensures that intentional backslashes (e.g. "\o/") can be used in:
* Site title
* Site description
* Nav menu name
* Custom Menu widget title
* Tag Cloud widget title
* Text widget body if can't `unfiltered_html`
The latter three are also fixed on the widgets admin page.
Fixes#35898.
git-svn-id: https://develop.svn.wordpress.org/trunk@36622 602fd350-edb4-49c9-b593-d223f7449a82
Introduces `wp_authenticate_email_password()` which is hooked into `authenticate` after `wp_authenticate_username_password()`.
Props Denis-de-Bernardy, ericlewis, vhomenko, MikeHansenMe, swissspidy, ocean90.
Fixes#9568.
git-svn-id: https://develop.svn.wordpress.org/trunk@36617 602fd350-edb4-49c9-b593-d223f7449a82
Changes default image compression quality from '90' to '82'.
This reduces generated image file sizes by ~25% while
keeping DSSIM < 0.0023, with both Imagick and GD.
Props @joemcgill, @dnewton.
See #33642.
git-svn-id: https://develop.svn.wordpress.org/trunk@36615 602fd350-edb4-49c9-b593-d223f7449a82
`get_terms()` has historically required that a taxonomy be specified when
querying terms. This requirement is related to the fact that terms could
formerly be shared between taxonomies, making `$taxonomies` critical for
disambiguation. Since terms can no longer be shared as of 4.4, it'
s desirable to be able to query for terms regardless of what taxonomy they're in.
Because it's now optional to pass taxonomies, it's no longer necessary to have
`$taxonomies` as the first (and required) parameter for `get_terms()`. The new
function signature is `get_terms( $args )`, where 'taxonomy' can (optionally) be
passed as part of the `$args` array. This syntax is more consistent with
functions like `get_users()` and `get_posts()`.
We've maintained backward compatibility by always giving precedence to the old
argument format. If a second parameter is detected, or if it's detected that
the first parameter is a list of taxonomy names rather than an `$args` array,
`get_terms()` will parse the function arguments in the legacy fashion.
Props flixos90, swissspidy, DrewAPicture, boonebgorges.
Fixes#35495.
git-svn-id: https://develop.svn.wordpress.org/trunk@36614 602fd350-edb4-49c9-b593-d223f7449a82
This was a regression introduced in [36510] which caused menu item fields to not save field content with backslashes in them.
Props westonruter.
See #14134.
git-svn-id: https://develop.svn.wordpress.org/trunk@36613 602fd350-edb4-49c9-b593-d223f7449a82
After [36053] don't show a warning about something users can't change
because there's no control exposed in the UI for that. The Revisions
screen is probably a better place to show a more complete information.
Fixes#35029.
git-svn-id: https://develop.svn.wordpress.org/trunk@36612 602fd350-edb4-49c9-b593-d223f7449a82
Short-circuits components from initializing their hooks needlessly if current user lacks required capability.
Fixes#35895.
git-svn-id: https://develop.svn.wordpress.org/trunk@36611 602fd350-edb4-49c9-b593-d223f7449a82