Commit Graph

34547 Commits

Author SHA1 Message Date
Pascal Birchler
b2671c3880 Embeds: Improve performance when embedding a post from the current site.
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
2016-06-15 11:22:52 +00:00
Sergey Biryukov
57d2c46591 Permalinks: Avoid a PHP notice in get_permalink() if default category is unavailable.
Props Presskopp.
Fixes #36529.

git-svn-id: https://develop.svn.wordpress.org/trunk@37707 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 23:11:33 +00:00
Sergey Biryukov
2e79b18178 Themes: Make default "read more" link more accessible.
Add an `aria-label` with the post title to make it available for screen readers.

Props Kau-Boy.
Fixes #36572.

git-svn-id: https://develop.svn.wordpress.org/trunk@37706 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:45:10 +00:00
Sergey Biryukov
661f5a477e After [37702], correct the expected result in test_size_format().
See #37037.

git-svn-id: https://develop.svn.wordpress.org/trunk@37705 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:12:35 +00:00
Sergey Biryukov
62733745df Text Changes: Simplify two strings in wp_password_change_notification().
Add translator comments.

Props ramiy.
See #35736.

git-svn-id: https://develop.svn.wordpress.org/trunk@37704 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:08:02 +00:00
Sergey Biryukov
45d7737eb2 I18N: Add context and translator comments to Back to %s strings.
Fixes #37095.

git-svn-id: https://develop.svn.wordpress.org/trunk@37703 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 21:50:57 +00:00
SergeyBiryukov
aea4c0d86a In size_format() and wp_convert_bytes_to_hr(), replace kB with KB for consistency with other units.
Props Presskopp, dashaluna.
Fixes #37037.

git-svn-id: https://develop.svn.wordpress.org/trunk@37702 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 21:40:02 +00:00
Weston Ruter
2e81613be8 Customize: Ensure MediaControl fetches the necessary attachment data for rendering when dynamically added via JS.
Fixes #36521.
Props TimothyBlynJacobs, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@37701 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 19:27:41 +00:00
Weston Ruter
f26ccf6fac Customize: Update server-sent setting validation notifications as changes are entered.
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
2016-06-14 19:16:54 +00:00
DrewAPicture
9decae327d Docs: Update the documentation for get_site() and the get_site filter following the removal of the $output parameter in [37652].
Props flixos90.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37699 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 18:13:03 +00:00
Sergey Biryukov
7ad5c50b12 I18N: In remove_accents(), add support for de_CH and de_CH_informal.
Props grapplerulrich.
Fixes #37076.

git-svn-id: https://develop.svn.wordpress.org/trunk@37698 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 17:43:27 +00:00
Sergey Biryukov
4eab8aab82 Users: wp_signon() expects an array as the $credentials argument, not a string.
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
2016-06-14 15:33:06 +00:00
Sergey Biryukov
1a8ca6a167 Taxonomy: Introduce a redirect_term_location filter to change the redirect on term editing.
This complements the `redirect_post_location` filter added in [12260].

Props alexvandervegt.
Fixes #36367.

git-svn-id: https://develop.svn.wordpress.org/trunk@37696 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 15:05:21 +00:00
John Blackbourn
50a3c1c368 Upgrade/Install: Skip certificate verification when upgrading a network's sites. This avoids issues with self-signed certificates or otherwise invalid certificates.
Fixes #36975


git-svn-id: https://develop.svn.wordpress.org/trunk@37695 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 07:42:49 +00:00
Ryan McCue
87b095dae9 HTTP API: Update Requests.
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
2016-06-14 05:29:58 +00:00
Rachel Baker
af48ea92de Administration: Set a defined line-height for number type inputs to fix display issue in Safari.
Fixes #37024.
Props joelwills, kraftbj.

git-svn-id: https://develop.svn.wordpress.org/trunk@37693 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 02:06:36 +00:00
Boone Gorges
becae4f492 Query: Allow plugins to supply post results instead of having WP_Query fetch them from the database.
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
2016-06-14 01:59:25 +00:00
Boone Gorges
3132836080 Taxonomy: More specific cap check when processing category data on post save.
Props dlh.
Fixes #36379.

git-svn-id: https://develop.svn.wordpress.org/trunk@37691 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 01:36:59 +00:00
Aaron Jorbin
84a19f4a93 Bootstrap/Load. Adjust filters added in [37626].
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
2016-06-12 02:42:02 +00:00
Jeremy Felt
2b2dde968b Login: Fire wp_no_robots() in wp_die() only if function exists.
This covers cases where `wp_die()` is used before `general-template.php` is loaded.

Fixes #34401.


git-svn-id: https://develop.svn.wordpress.org/trunk@37689 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-12 00:33:27 +00:00
Drew Jaynes
034b6c025d Docs: Improve first-order clause documentation for the $meta_query parameter in the constructor for WP_Meta_Query.
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
2016-06-12 00:01:54 +00:00
Dominik Schilling (ocean90)
0461e41927 Upgrade: Trigger the upgrader_process_complete action for translation updates.
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
2016-06-11 17:43:17 +00:00
Drew Jaynes
3348efa466 Docs: Improve the return description for wp_get_post_categories() to include more information about possible return values.
Props jeherve for the initial patch.
Fixes #37002.


git-svn-id: https://develop.svn.wordpress.org/trunk@37686 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 17:07:35 +00:00
Dominik Schilling (ocean90)
979660717e Canonical: Introduce wp_get_canonical_url().
`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
2016-06-11 13:30:23 +00:00
Andrew Ozz
e65a667c9c Editor: prevent jumping when using the backspace button in the Text editor in Firefox and IE.
Fixes #37072.

git-svn-id: https://develop.svn.wordpress.org/trunk@37684 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 05:14:18 +00:00
Boone Gorges
b9d46425c0 Introduce term_taxonomy_id parameter for WP_Term_Query.
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
2016-06-11 03:48:03 +00:00
Boone Gorges
beebded867 Tests: Move WP_Tax_Query tests to a more appropriate file.
The file they were living in is the rightful home of `WP_Term_Query` tests.

See #37074.


git-svn-id: https://develop.svn.wordpress.org/trunk@37682 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 03:26:07 +00:00
Andrea Fercia
2aebf33f9d Plugin Install: fix edge-case where the tab=upload page can be accessed directly.
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
2016-06-10 22:38:57 +00:00
Andrea Fercia
18ef7d6225 Accessibility: Help text improvements.
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
2016-06-10 21:42:05 +00:00
Andrea Fercia
a177094f56 Accessibility: Customizer, make the menu items "clear search results" a button.
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
2016-06-10 21:21:09 +00:00
Joe McGill
0d020faa68 Media: Fix rendering of incorrect toolbar in the Edit view.
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
2016-06-10 21:11:28 +00:00
Drew Jaynes
831a186108 Boostrap: Move is_ssl() to wp-includes/load.php.
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
2016-06-10 18:55:33 +00:00
Joe McGill
73eb2c9cd4 Media: remove _wp_upload_dir_baseurl().
`_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
2016-06-10 16:51:15 +00:00
Dominik Schilling (ocean90)
72c0d63d05 I18N: Simplify the WordPress update notice for translators.
* 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
2016-06-10 15:53:27 +00:00
Peter Wilson
db0195c936 DOCS: Replace HTTP links with HTTPS.
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
2016-06-10 04:49:09 +00:00
Drew Jaynes
d470bd22dc Docs: Improve the DocBlock summary for add_theme_support().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37673 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 00:06:07 +00:00
Drew Jaynes
d008c4e088 Docs: Add documentation for the variadic second parameter, $args, accepted by add_theme_support().
h/t kevinwhoffman
Fixes #37067.


git-svn-id: https://develop.svn.wordpress.org/trunk@37672 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 00:02:34 +00:00
Drew Jaynes
5c645d8cde Docs: Improve documentation for the $feature parameter in the DocBlock for add_theme_support().
See #32246. See #37067.


git-svn-id: https://develop.svn.wordpress.org/trunk@37671 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-09 20:33:57 +00:00
Jeremy Felt
15a12ce4f0 Multisite: Introduce get_current_network_id()
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
2016-06-09 20:33:35 +00:00
Drew Jaynes
8f79db7e54 Docs: Add extensive documentation to the remove_accents() DocBlock outlining the accented characters core replaces.
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
2016-06-09 19:13:09 +00:00
Ella Iseulde Van Dorpe
644795a9dc TinyMCE: wptextpattern: fix for fast typing
Props jnylen0, iseulde.

Fixes #36585.



git-svn-id: https://develop.svn.wordpress.org/trunk@37668 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-09 19:06:25 +00:00
Jeremy Felt
363533d9b3 Multisite: Use to_array() method on WP_Site objects in wp_get_sites()
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
2016-06-09 18:09:25 +00:00
Jeremy Felt
56c98dd30a Tests: Split get_blog_details() test into individual tests
* 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
2016-06-09 15:57:37 +00:00
Jeremy Felt
ead348053b Tests: Move get_blog_details() tests to their own file
See #36566.


git-svn-id: https://develop.svn.wordpress.org/trunk@37665 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-09 05:40:45 +00:00
Rachel Baker
8910870205 Comments: Fix pagination totals in the response of the inline delete actions when filtering the List Table by comment_type.
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
2016-06-09 02:21:27 +00:00
Rachel Baker
0c990ffb73 Users: Stop WP_List_Table notices from persisting on pagination navigation.
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
2016-06-09 01:55:40 +00:00
Jeremy Felt
8de500d493 Tests: User a data provider for wp_get_sites() tests.
* 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
2016-06-09 00:27:46 +00:00
Andrew Ozz
510cff5fe6 Editor quickTags: when the user selects some text by triple-clicking, then wraps it in a tag, and the last selected char is \n, insert the closing tag before the line break.
Props JoshuaGoodwin azaozz.
Fixes #29571.

git-svn-id: https://develop.svn.wordpress.org/trunk@37661 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-09 00:24:56 +00:00
Jeremy Felt
8e380e50d8 Tests: Move wp_get_sites() tests to their own file
See #36566.


git-svn-id: https://develop.svn.wordpress.org/trunk@37660 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 22:46:38 +00:00
Andrew Ozz
0861054ca2 Editor, editor-expand: adjust the sidebar position when moving a postbox from one column to another.
Fixes #35230.

git-svn-id: https://develop.svn.wordpress.org/trunk@37659 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 22:36:47 +00:00