Also correct phpdoc return tag on `WP_oEmbed_Controller::get_proxy_item()` and remove dead code in oEmbed controller phpunit tests.
Amends [40628].
See #40450.
Fixes#41299.
git-svn-id: https://develop.svn.wordpress.org/trunk@41047 602fd350-edb4-49c9-b593-d223f7449a82
Previously, these filters were being run once per post, but the changes in [41043] caused them to be run once per emoji found.
We will not stand idly by while this kind of unfair performance penalty is placed on the emoji literate. The filters are now run once only, emoji aficionados everywhere can rest easy, knowing their posts will be just as performant as their emoji-less cousins.
Props ocean90 for noticing this severe oversight.
See #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41046 602fd350-edb4-49c9-b593-d223f7449a82
- Older versions of PHP don't know how to `html_entity_decode()` emoji.
- The fall back regex was a little too broad, catching characters that aren't emoji.
See #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41045 602fd350-edb4-49c9-b593-d223f7449a82
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes#35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
[40514] introduced a bug that caused term queries to return some duplicates
when the `$taxonomies` array contained only taxonomies that were originally
registered with an `$args` array. We fix this bug by ensuring that
recursive `get_terms()` queries stop when all queried `$taxonomies` have
already been referenced.
Props bor0, atanasangelovdev.
Fixes#41010.
git-svn-id: https://develop.svn.wordpress.org/trunk@41037 602fd350-edb4-49c9-b593-d223f7449a82
Also, the `$taxonomy` parameter can accept either a string or array of taxonomies.
Props ohryan for the initial tip.
See #41017.
git-svn-id: https://develop.svn.wordpress.org/trunk@41034 602fd350-edb4-49c9-b593-d223f7449a82
The `WP_Widget::_register_one()` method is more guaranteed to be called as opposed to its wrapper `WP_Widget::_register()` which plugins may bypass for performance reasons.
Amends [40631], [40640].
See #35243, #32417.
Fixes#41021.
git-svn-id: https://develop.svn.wordpress.org/trunk@41028 602fd350-edb4-49c9-b593-d223f7449a82
This prevents "Empty Spam" and "Empty Trash" buttons from disappearing if there's only one page of comments in Spam/Trash.
Fixes#40975.
git-svn-id: https://develop.svn.wordpress.org/trunk@41022 602fd350-edb4-49c9-b593-d223f7449a82
Set view state properly when navigating history using the browser back/next button in the media library (grid view). Correctly handle navigating, search, image detail view and image edit mode. Also handle bookmarking/reloading.
Props kucrut, joemcgill, afercia.
Fixes#31846.
git-svn-id: https://develop.svn.wordpress.org/trunk@41021 602fd350-edb4-49c9-b593-d223f7449a82
Verify that `human_time_diff` works as expected for minute, hour and day intervals. Test that rounding works as expected when the time difference is near the rounding margin.
Props SGr33n.
Fixes#38773.
git-svn-id: https://develop.svn.wordpress.org/trunk@41018 602fd350-edb4-49c9-b593-d223f7449a82
This change standardizes some language in the parameter descriptions between the two hook docs in an effort to reduce confusion between the `$pre_option` pseudo-parameters and the new `$default` ones. `$pre_option` is the truthy value used to short-circuit the `get_*option()` call, `$default` is the value passed to the `get_*option()` returned in the event that 1) a short circuit isn't performed, 2) the option doesn't exist.
Props sc0ttkclark.
Fixes#41254.
git-svn-id: https://develop.svn.wordpress.org/trunk@41013 602fd350-edb4-49c9-b593-d223f7449a82
Check return value of `WP_Customize_Manager::get_changeset_post_data()` and return if error instead of assuming it is an array.
Amends [38810].
See #30937.
Fixes#41252.
git-svn-id: https://develop.svn.wordpress.org/trunk@41012 602fd350-edb4-49c9-b593-d223f7449a82
This was previously searching for the user ID, which isn't really what it was meant to do. As a result, the test can break if that number appears in any other user information.
git-svn-id: https://develop.svn.wordpress.org/trunk@41011 602fd350-edb4-49c9-b593-d223f7449a82
This ensures `$uploaderToggler` exists before checking length so any views
extending or scripts accessing this view, won't encounter errors that stop execution.
Props Blackbam, yahil.
Fixes#41231.
git-svn-id: https://develop.svn.wordpress.org/trunk@41009 602fd350-edb4-49c9-b593-d223f7449a82
Previously, changing these constants in `wp-tests-config` would cause PHPUnit to regenerate `wp-api-generated.js` with different values.
This commit uses the existing mechanism to also "freeze" all values that would change as a result of changing these constants.
Fixes#41123.
git-svn-id: https://develop.svn.wordpress.org/trunk@41006 602fd350-edb4-49c9-b593-d223f7449a82
Also update `WP_Customize_Widgets::$core_widget_id_bases` with the new list of core widgets.
Props obenland, westonruter.
See #40907, #40951.
git-svn-id: https://develop.svn.wordpress.org/trunk@41000 602fd350-edb4-49c9-b593-d223f7449a82
Previously, checks like `current_user_can( 'edit_term_meta', $term_id )`
returned the proper value, but generated a PHP notice due to the fact
that `get_term( $term_id )` could, in certain instances, return
`WP_Error` objects.
Props caercam.
Fixes#40891.
git-svn-id: https://develop.svn.wordpress.org/trunk@40999 602fd350-edb4-49c9-b593-d223f7449a82
Also adds an inline reference to the `session_token_manager` hook in the description.
Props Shelob9 for the initial patch.
Fixes#40102.
git-svn-id: https://develop.svn.wordpress.org/trunk@40998 602fd350-edb4-49c9-b593-d223f7449a82
This filter allows developers to modify the arguments passed to
`wp_get_object_terms()` before the query is run.
Props enrico.sorcinelli.
Fixes#35925.
git-svn-id: https://develop.svn.wordpress.org/trunk@40994 602fd350-edb4-49c9-b593-d223f7449a82
Meta capabilities use the capability `do_not_allow` to indicate a user should be blocked from performing a particular action. This ensures users can not have the capability as it would cause unexpected behaviour.
Props johnbillion.
Fixes#41059.
git-svn-id: https://develop.svn.wordpress.org/trunk@40993 602fd350-edb4-49c9-b593-d223f7449a82