When the post being embedded is from the same site, there's no reason to do an HTTP request for it. The data can be fetched directly using `get_oembed_response_data()`.
Fixes#36767 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@37708 602fd350-edb4-49c9-b593-d223f7449a82
Send back setting validities with full refreshes and selective refreshes so that invalid settings can have notifications displayed immediately before attempting save, and so that these notifications can be cleared as soon as the input is corrected.
* Splits out JS logic for listing controls into separate methods `wp.customize.Setting.prototype.findControls()` and `wp.customize.findControlsForSettings()`.
* Adds a `setting` property to the `data` on notifications added to controls that are synced from their settings.
* Adds `selective-refresh-setting-validities` message sent from preview to pane.
* Changes `WP_Customize_Manager::validate_setting_values()` to return when settings are valid as well as invalid.
* Adds `WP_Customize_Manager::prepare_setting_validity_for_js()`.
* Add setting validities to data exported to JS in Customizer Preview and in selective refresh responses.
Fixes#36944.
git-svn-id: https://develop.svn.wordpress.org/trunk@37700 602fd350-edb4-49c9-b593-d223f7449a82
If an empty string was passed, redeclare it as an empty array to avoid a warning and a fatal error in PHP 7.1.0 Alpha 1.
Props simonvik.
Fixes#37071.
git-svn-id: https://develop.svn.wordpress.org/trunk@37697 602fd350-edb4-49c9-b593-d223f7449a82
This introduces a minimum value of 1 second for timeouts passed to cURL.
Internally, cURL uses alarm() for interrupts, which accepts a second-resolution timeout. Any values lower than 1 second are instantly failed rather than being rounded upwards. While this makes the experience worse for those using asynchronous DNS lookups, there's no way to detect which DNS resolver is being used from PHP.
See #33055, #8923.
git-svn-id: https://develop.svn.wordpress.org/trunk@37694 602fd350-edb4-49c9-b593-d223f7449a82
Returning a non-null value from the new `posts_pre_query` filter will cause
`WP_Query` to skip its database query, so that posts data can be provided from
elsewhere. This is useful in cases where post data may be mirrored in a
separate location, such as an external search application.
Developers should note that the `WP_Query` properties generally used to
calculate pagination - specifically, `found_posts` and `max_num_pages`, which
are determined by default in `set_found_posts()` - must be provided explicitly
when using the `posts_pre_query` filter; since `WP_Query` will not be
contacting the database, it will have no access to `SELECT FOUND_ROWS()`.
The `WP_Query` instance is passed to `posts_pre_query` by reference, so that
these properties can be set manually if needed.
Props jpdavoutian, tlovett1.
Fixes#36687.
git-svn-id: https://develop.svn.wordpress.org/trunk@37692 602fd350-edb4-49c9-b593-d223f7449a82
These adjustments improve the documentation for the filters and adjust the names make them more consistent with other filters already in core.
See #34936.
Props DrewAPicture, ocean90, jorbin
git-svn-id: https://develop.svn.wordpress.org/trunk@37690 602fd350-edb4-49c9-b593-d223f7449a82
First-order meta query clauses are defined as clauses that have either a 'key' or 'value' array key. When using named first-order clauses in meta queries to order results in the parent query, `WP_Meta_Query` can additionally accept first-order clauses at the sub-clause level, which was not previous documented.
Fixes#32659.
git-svn-id: https://develop.svn.wordpress.org/trunk@37688 602fd350-edb4-49c9-b593-d223f7449a82
This brings `Language_Pack_Upgrader` in line with the core, theme, and plugin upgrader.
Props ronalfy.
Fixes#36872.
git-svn-id: https://develop.svn.wordpress.org/trunk@37687 602fd350-edb4-49c9-b593-d223f7449a82
`wp_get_canonical_url()` encapsulates the URL logic of `rel_canonical()` to provide a consistent way to retrieve the canonical URL for a post.
The new filter `get_canonical_url` allows to customize the canonical URL.
Props joostdevalk, jipmoors, DrewAPicture, ocean90.
Fixes#36168.
git-svn-id: https://develop.svn.wordpress.org/trunk@37685 602fd350-edb4-49c9-b593-d223f7449a82
Allows the fetching of terms based on `term_taxonomy_id`, or an array of
`term_taxonomy_ids`.
Props spacedmonkey.
Fixes#37074.
git-svn-id: https://develop.svn.wordpress.org/trunk@37683 602fd350-edb4-49c9-b593-d223f7449a82
The `?tab=upload` page still exists for no-js support and for users who may
access it directly (e.g. from bookmarks or history) or plugins doing the same.
In this page, the "Browse plugins" link should always behave like a link.
Fixes#35429.
git-svn-id: https://develop.svn.wordpress.org/trunk@37681 602fd350-edb4-49c9-b593-d223f7449a82
Avoid references to "visual" positions in favour of positions in the document
structure. The help text shouldn't assume users can see.
Also, in the Posts screen don't mention specific types of posts and use a more
generic text instead.
Props odysseygate, pansotdev, zakb8.
Fixes#34761.
git-svn-id: https://develop.svn.wordpress.org/trunk@37680 602fd350-edb4-49c9-b593-d223f7449a82
For Web standards and accessibility, always prefer native controls instead of
`span` or `div` elements.
Fixes#36903.
git-svn-id: https://develop.svn.wordpress.org/trunk@37679 602fd350-edb4-49c9-b593-d223f7449a82
This switches event binding in `wp.media.controller.EditImage` to use `on`
instead of `listenTo` to restore rendering of the correct toolbar when the
`toolbar:render:edit-image` event fires. The existing listeners broke
when we upgraded Backbone in [36546].
Props adamsilverstein.
Fixes#36861 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@37678 602fd350-edb4-49c9-b593-d223f7449a82
Moving to load.php introduces parity with other commonly evaluated `is_*()` functions such as `is_admin()` or `is_multisite()`. It also makes `is_ssl()` available much earlier in the loading process, such as for use in drop-ins like advanced-cache.php.
Props johnjamesjacoby.
Fixes#35844.
git-svn-id: https://develop.svn.wordpress.org/trunk@37677 602fd350-edb4-49c9-b593-d223f7449a82
`_wp_upload_dir_baseurl()` is a private function introduced in 4.4
as part of the "responsive images" feature. It was for runtime
caching of the URL to the uploads directory. It is deprecated in
4.5 with the introduction of `wp_get_upload_dir()`.
Outside core, it's only used as part of a back-compat shim in the
original feature plugin for responsive images (ricg-responsive-images),
which includes its own version of the function definition, so it's
safe to remove from core.
Fixes#36375.
git-svn-id: https://develop.svn.wordpress.org/trunk@37676 602fd350-edb4-49c9-b593-d223f7449a82
* Make codex URL and accessibility text separate strings.
* Add translator comments.
Props ramiy for initial patch.
Fixes#35721.
git-svn-id: https://develop.svn.wordpress.org/trunk@37675 602fd350-edb4-49c9-b593-d223f7449a82
Replaces unsecure links in documentation and translator comments with their secure versions.
Props johnpgreen, netweb
Fixes#36993
git-svn-id: https://develop.svn.wordpress.org/trunk@37674 602fd350-edb4-49c9-b593-d223f7449a82
Similar to `get_current_blog_id`, this can be used to get the ID of the `$current_site` global. If not available, it will fallback to the main network ID. In single site, this will return 1.
Props spacedmonkey, flixos90.
Fixes#33900.
git-svn-id: https://develop.svn.wordpress.org/trunk@37670 602fd350-edb4-49c9-b593-d223f7449a82
Covers:
* Currency signs
* Decompositions for Latin-1 Supplement
* Decompositions for Latin Extended-A
* Decompositions for Latin Extended-B
* Vowels with diacritic (Chinese, Hanyu Pinyin)
* Characters replaced for the `de_DE`, `de_DE_formal`, and `da_DK` locales
Props john_schlick for the initial work.
Props DrewAPicture, ocean90.
See #34677.
git-svn-id: https://develop.svn.wordpress.org/trunk@37669 602fd350-edb4-49c9-b593-d223f7449a82
When an object with private properties is cast directly to an array, those properties are no longer available with their original keys.
Props @flixos90.
See #36717.
git-svn-id: https://develop.svn.wordpress.org/trunk@37667 602fd350-edb4-49c9-b593-d223f7449a82
* One test per method
* Clarify existing tests.
* Add test for passing a "blog slug" string to `get_blog_details()`.
* Shared fixture of sites.
* Reduce number of sites created to only those necessary.
* Remove unnecessary networks creation.
See #36566.
git-svn-id: https://develop.svn.wordpress.org/trunk@37666 602fd350-edb4-49c9-b593-d223f7449a82
Within the Ajax action `_wp_ajax_delete_comment_response()` if the comment_type query var is set, fallback to the previous `$total - 1` value instead of getting an incorrect value from `wp_comment_count()`.
Fixes#36991.
git-svn-id: https://develop.svn.wordpress.org/trunk@37664 602fd350-edb4-49c9-b593-d223f7449a82
Adds the keyboard navigation query vars to `wp_removable_query_args()` and passes the results of said function to remove_query_var() inside the WP_List_Table pagination method.
Props EFAREM for the initial patch.
Fixes#35620.
git-svn-id: https://develop.svn.wordpress.org/trunk@37663 602fd350-edb4-49c9-b593-d223f7449a82
* Convert existing tests into a data provider and clarify expectations.
* Add shared test fixtures in preparation for future tests.
This passes with the `wp_get_sites()` from 4.5 and the deprecated version in trunk.
See #36566.
git-svn-id: https://develop.svn.wordpress.org/trunk@37662 602fd350-edb4-49c9-b593-d223f7449a82