Commit Graph

10717 Commits

Author SHA1 Message Date
Pascal Birchler 6bf5465f67 Menus: Fix `_wp_expand_nav_menu_post_data()` for PHP 5.2.
[37748] introduced `_wp_expand_nav_menu_post_data()` together with an `array_replace_recursive()` compatibility function for PHP 5.2.
Even though that compat function is tried and tested in other projects like BuddyPress, we need to add additional `isset()` checks in order to avoid 'Undefined index' notices in our case.

See #36590.

git-svn-id: https://develop.svn.wordpress.org/trunk@37750 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:50:15 +00:00
Pascal Birchler 3f050f87c3 Menus: Support nested array variables in POST data when saving menus.
[36510] allowed larger menus to be created in the Edit Menu screen by JSON-encoding the entire form into a single input field. However, it did not correctly handle nested arrays.

This introduces a new `_wp_expand_nav_menu_post_data()` helper function to handle this POST data which uses `array_replace_recursive()` internally. Since the latter is only available on PHP 5.3+, we add a compatibility function to ensure PHP 5.2 support.

Props ericlewis, neverything, swissspidy.
Fixes #36590 for trunk. See #14134.

git-svn-id: https://develop.svn.wordpress.org/trunk@37748 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:24:23 +00:00
Pascal Birchler d40f2eed2c Permalinks: Validate custom permalink structures.
Custom permalink structures require at least one valid structure tag, e.g. `%postname%`. If none is included, it would leave users with broken permalinks.
Let's make sure this won't happen by validating the permalink structure.

Adds unit tests.

Props rockwell15 for initial patch.
Fixes #35936.

git-svn-id: https://develop.svn.wordpress.org/trunk@37747 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:01:11 +00:00
Pascal Birchler c3394e2c93 Embeds: Improve height calculation for slow loading images.
When the featured image takes longer to load, the browser might not know its exact dimensions yet and therefore sends an incorrect document height to the embedding site.

By sending the document's height again after the featured image has been loaded, we ensure that the iframe doesn't get cut off.

Fixes #35657.

git-svn-id: https://develop.svn.wordpress.org/trunk@37745 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-18 09:59:54 +00:00
Pascal Birchler ddd6c2d94d Embeds: Remove support for Google Video.
While the service has been retired for years, it now has completely stopped working. Thus there is no reason to keep it.

Props Viper007Bond.
Fixes #36304.

git-svn-id: https://develop.svn.wordpress.org/trunk@37744 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-18 09:46:17 +00:00
Rachel Baker cf783103fc Comments: Wrap or unwrap the List Table comment_date as comment status changes via Ajax.
Introduced in [36521].

Fixes #36742.
Props imath, adamsilverstein.

git-svn-id: https://develop.svn.wordpress.org/trunk@37743 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 21:47:58 +00:00
Andrea Fercia 090ecc34f9 Accessibility: Theme Installer, make the "Upload Theme" button... a button.
UI controls that "do something" on a page shouldn't be links. This link behaves
like a toggle to expand the uploader panel and should be a `button` element with
an aria-expanded attribute. Also:

- improves consistency with the Plugin uploader
- keeps the themes list visible when the uploader is open
- displays a notice when JavaScript is off
- adds some `hide-if-no-js` CSS classes
- removes the `themes.router.navigate()` "upload" route: seems unnecessary and breaks history

Fixes #35457.

git-svn-id: https://develop.svn.wordpress.org/trunk@37742 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 20:46:08 +00:00
Andrew Ozz faf7576562 Editor: after inserting a link detect if the URL is broken, first run.
Props iseulde, azaozz.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@37741 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 20:40:04 +00:00
Helen Hou-Sandi 265fabc1c4 Use numeric font weights instead of keywords.
When Open Sans was in use, the `300`, `400`, and `600` weights were loaded. `400` is the equivalent of `normal`; however, `bold` is equivalent to `700`, not `600`. With the move to system fonts, we need to be specific rather than relying on the lack of a `700` weight. Not all system fonts include a `600` weight; in those instances, they will use the `bold`/`700` weight.

The WordPress CSS Coding Standards have been updated accordingly.

props coderste.
see #36753.


git-svn-id: https://develop.svn.wordpress.org/trunk@37740 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 18:36:03 +00:00
Drew Jaynes bfdf00cb83 Docs: Add a missing summary and `@since` version to the DocBlock for `WP_MS_Sites_List_Table::prepare_items()`.
Also adds a changelog entry for 4.6.0 noting the changeover to `get_sites()`.

Fixes #36675. See #21837, #24833 and #33185.


git-svn-id: https://develop.svn.wordpress.org/trunk@37739 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 16:05:43 +00:00
Peter Wilson 54f1c097a6 Posts: Add `$post` parameter to modified date and time functions.
Unifies the APIs for getting a post's modified date or time with getting a post's date or time.

Adds the `$post` parameter to the functions `get_the_modified_date` and `get_the_modified_time`.

Adds the `$post` parameter to the filters `get_the_modified_date` and `get_the_modified_time`.

Props Soean, lukecavanagh.
Fixes #37059.


git-svn-id: https://develop.svn.wordpress.org/trunk@37738 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 05:11:29 +00:00
Andrew Ozz 0f319917c4 Autosave: improve the notice when the sessionStorage autosave is different than the content.
- Make it higher priority than the server autosave.
- Change it so the editors undo and redo can be used.
- Replace the restore link with a button.
- Add better explanation/help.

See #37025.

git-svn-id: https://develop.svn.wordpress.org/trunk@37737 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 03:01:32 +00:00
Jeremy Felt 96d7eadb0c Multisite: Use `WP_Site_Query` to power `WP_MS_Sites_List_Table`.
`WP_Site_Query` provides for a cleaner `prepare_items()` method. It significantly improves the search experience in the sites list table:

* In a subdomain configuration, domain and path are searched for a provided terms.
* In a subdirectory configuration, path is searched for a provided term.
* The full domain is searched in a subdomain configuration rather than the portion not matching the network's domain.
* Terms are searched as `%term%` by default. Adding `*` in the middle of a term will search `%te%rm%`.

Props flixos90, Fab1en.
Fixes #33185, #24833, #21837, #36675.


git-svn-id: https://develop.svn.wordpress.org/trunk@37736 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-17 00:02:05 +00:00
Jeremy Felt 3d56328372 Multisite: Add search column support to `WP_Site_Query`.
`domain` and/or `path` can be used to specify which column(s) should be searched.

See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37735 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 23:08:30 +00:00
Andrea Fercia 0cda9e306c Accessibility: Remove the ARIA roles from the `wp.a11y.speak()` live regions.
When Firefox repaints some elements, NVDA may announce "alert" even when there's
no actual message dispatched to the live region. The NVDA implementation differs
from other screen readers and is currently under discussion. To avoid a subpar
user experience better to remove the roles since they're basically redundant.

Fixes #36289.

git-svn-id: https://develop.svn.wordpress.org/trunk@37734 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 21:50:39 +00:00
Pascal Birchler 931440e375 Embeds: Enforce a valid post ID when embedding a post from the current site.
Otherwise `wp_filter_pre_oembed_result()` could erroneously return the HTML of the current post instead of the intended result.

Props kraftbj.
See #36767.

git-svn-id: https://develop.svn.wordpress.org/trunk@37729 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 17:17:32 +00:00
Dominik Schilling (ocean90) eefd425f66 Media: Use the correct variable for the file object.
See #14244.

git-svn-id: https://develop.svn.wordpress.org/trunk@37728 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 16:14:25 +00:00
Dominik Schilling (ocean90) 41823be421 Media: Pass allowed file extensions to Plupload.
Plupload's `mime_types` filter (http://www.plupload.com/docs/Options#filters.mime_types) allows us to inform a user about an unsupported file before the file gets uploaded.

Props polevaultweb.
Fixes #14244.

git-svn-id: https://develop.svn.wordpress.org/trunk@37727 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 15:38:12 +00:00
Rachel Baker 7a4e523b5e REST API: Include X-Robots-Tag: noindex header in REST API responses to prevent endpoints from being indexed by search engines.
Prevent duplicate content issues with search engines and REST API endpoint response data.

Fixes #36390.
Props m_uysl for the initial patch.

git-svn-id: https://develop.svn.wordpress.org/trunk@37726 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 14:58:28 +00:00
Dominik Schilling (ocean90) f50f50cd0b Customize: Separate preview and actions in the site icon control.
Reverts [37456] to allow users to remove/change a site icon even if the attachment has corrupt/missing data about sizes.

Fixes #36749.

git-svn-id: https://develop.svn.wordpress.org/trunk@37724 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 09:44:21 +00:00
Dominik Schilling (ocean90) 62bd8ecdd7 External Libraries: Update Backbone to version 1.3.3.
Changelog: https://cdn.rawgit.com/jashkenas/backbone/1.3.3/index.html#changelog
Diff: https://github.com/jashkenas/backbone/compare/1.2.3...1.3.3

Includes a unit test to ensure that the minified version doesn't include `sourceMappingURL`.

Props adamsilverstein.
Fixes #37099.

git-svn-id: https://develop.svn.wordpress.org/trunk@37723 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 09:26:06 +00:00
Andrew Ozz 70afec2875 Media: properly refresh the position of the Plupload shim so it moves over the Select Files button or off the screen. Fixes selecting files in MS Edge on the Media grid and Media -> Add New screens.
Fixes #37039.

git-svn-id: https://develop.svn.wordpress.org/trunk@37722 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 04:53:42 +00:00
Boone Gorges e1cfb25e79 Query: `set_found_posts()` must run immediately after main query.
If not run immediately after, the `SELECT FOUND_ROWS()` query might refer to
a different query, such as the one used to populate the post cache for a split
query.

Introduced in [37692].

Fixes #36687.

git-svn-id: https://develop.svn.wordpress.org/trunk@37721 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 02:00:02 +00:00
Sergey Biryukov b1f3926bcb Embeds: In `WP_oEmbed::get_provider()` and `WP_oEmbed::get_html()`, parse the `$args` string to an array, as we treat it as an array later.
See #37071.

git-svn-id: https://develop.svn.wordpress.org/trunk@37720 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 18:51:32 +00:00
Sergey Biryukov 89304a579f I18N: Adjust the regex in `wp_maybe_decline_date()` to handle word boundaries correctly.
Props semil.
Fixes #36790.

git-svn-id: https://develop.svn.wordpress.org/trunk@37717 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 17:44:45 +00:00
Konstantin Obenland 86af710a3d Twenty Ten: Revert pot changes after update test.
Introduced in [37714].



git-svn-id: https://develop.svn.wordpress.org/trunk@37715 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 16:45:27 +00:00
Konstantin Obenland 4dd1d9bef9 Update/Install: Shiny Updates v2.
Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.

Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.



git-svn-id: https://develop.svn.wordpress.org/trunk@37714 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 16:36:07 +00:00
Rachel Baker 1d115078eb Comments: Do not flag a comment as a duplicate if the `comment_author_email` is provided but not a match.
This reduces the strictness of the duplicate check a little, but does prevent false duplicates for emoji or +1 comments by authors with matching names. The current logic was introduced all the way back in [2894].

Fixes #37093.

git-svn-id: https://develop.svn.wordpress.org/trunk@37713 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 14:50:38 +00:00
Boone Gorges ade41fc2cf Query: After [37692], don't skip `set_found_posts()` when no posts are found.
The 'found_posts' filter must continue to run for plugins manipulating post
results via filter.

Props dd32.
Fixes #36687.

git-svn-id: https://develop.svn.wordpress.org/trunk@37712 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 12:32:25 +00:00
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 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
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
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
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
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
Jeremy Felt 91f24a7b4e Multisite: Fix `switch(` spacing after [37657]
Fixes #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37658 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 04:47:52 +00:00
Jeremy Felt c64d63e51a Multisite: Allow access to network and site properties using current naming conventions
* Add magic `__get()`, `__set()`, and `__isset()` methods to `WP_Site` and `WP_Network.
* Provide `(int) $network->site_id` for `(string) $network->blog_id`
* Provide `(int) $site->id` for `(string) $site->blog_id`
* Provide `(int) $site->network_id` for `(string) $site->site_id`

Props flixos90, jeremyfelt.
Fixes #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37657 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 04:13:04 +00:00
Boone Gorges 1eaf38088f Add a note about uniqueness to the doc block for `get_term_by()`.
`get_term_by()` always returns a single term, even when more than one term
matches the query parameters. The new note warns developers to use
`get_terms()` when such ambiguity may result.

Fixes #36878.

git-svn-id: https://develop.svn.wordpress.org/trunk@37656 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 04:07:47 +00:00
Boone Gorges ca05a4b43d Comments: In `wp_list_comments()`, queries with custom pagination params should obey default `comment_status` logic.
When custom pagination parameters are passed to `wp_list_comments()`, a
secondary query must be performed to fetch the proper comments. See [36157].
This query should show comments of the same `comment_status` as the default
query initialized in `comments_template()`: show only comments that are
approved, or those that are unapproved but belong to the current user.

Props smerriman.
Fixes #37048.

git-svn-id: https://develop.svn.wordpress.org/trunk@37655 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 04:00:18 +00:00
Jeremy Felt 6da085cfe4 Multisite: Deprecate `wp_get_sites()`
Defer to the new `get_sites()` replacement, offering fresh (...or cached) `WP_Site` objects via the new `WP_Site_Query`.

Props flixos90.
Fixes #36994.


git-svn-id: https://develop.svn.wordpress.org/trunk@37653 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 03:02:34 +00:00
Jeremy Felt 53ec2e744d Multisite: Remove the output parameter from `get_site()`
Full `WP_Site` objects should be expected from `get_site()` rather than arrays.

In the single (soon to be deprecated) use of arrays for this in core, we can cast the result to `(array)` for back-compat.

See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37652 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-08 02:47:48 +00:00
Jeremy Felt 727a94b710 Admin: Allow for the consistent filtering of `auth_redirect_scheme`
Fixes #37047.


git-svn-id: https://develop.svn.wordpress.org/trunk@37651 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-07 20:48:24 +00:00
Dominik Schilling (ocean90) 30b1f09c21 Widgets: Revert [37425] and [37427].
The change can cause fatal errors under certain conditions, like when the subclass has a different function signature for `widget()` or doesn't even implement the method.

See #35981.

git-svn-id: https://develop.svn.wordpress.org/trunk@37648 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 21:50:29 +00:00
Rachel Baker 25c3618138 REST API: Create the general `wp_check_jsonp_callback()` function for validating JSONP callback functions.
Move the REST API JSONP callback validation check into a separate function named `wp_check_jsonp_callback()`. This allows plugins to use the built-in validation when handling JSONP callbacks.
Extremely Important Note: If you send JSONP in your custom response, make sure you prefix the response with `/**/`. This will mitigate the Rosetta Flash exploit. You should also send the `X-Content-Type-Options:nosniff` header, or even better, use the REST API infrastructure.

Props rmccue.
Fixes #28523.

git-svn-id: https://develop.svn.wordpress.org/trunk@37646 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 21:33:30 +00:00
Dominik Schilling (ocean90) 9da22fc4d9 Template: Pass `$blog_id` to the `get_custom_logo` filter.
Props achbed, juanfra.
Fixes #36639.

git-svn-id: https://develop.svn.wordpress.org/trunk@37645 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 21:23:38 +00:00
Drew Jaynes 885d38edc8 Nav Menus: Move the `Walker_Nav_Menu` class to its own file.
The new class-walker-nav-menu.php file is loaded in nav-menu-template.php for backward compatibility purposes.

Fixes #37035. See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@37640 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 15:17:46 +00:00
Drew Jaynes 9b5026a06e Docs: Relocate some `@see` tags and add missing `@access` tags to method and property DocBlocks in `Walker_Nav_Menu`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37639 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 05:46:20 +00:00
Drew Jaynes bc4136f6db Docs: Reformat several parameter descriptions in `Walker_Nav_Menu` to directly reference `wp_nav_menu()` rather than use inline `@see` tags.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37638 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 05:44:29 +00:00
Ryan McCue f08e167be8 Autoload: Add missed @since tags to SPL shim.
See #36926.


git-svn-id: https://develop.svn.wordpress.org/trunk@37637 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 03:58:10 +00:00
Ryan McCue e6092b8b07 Autoload: Introduce shim for SPL autoloading.
For PHP 5.2, SPL can be disabled. As SPL provides the support for multiple autoloaders, this needs to be shimmed if not available.

Fixes #36926.


git-svn-id: https://develop.svn.wordpress.org/trunk@37636 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 03:23:38 +00:00
Dominik Schilling (ocean90) 5259f34578 Upgrader: Don't use `Language_Pack_Upgrader_Skin::before()` and `Language_Pack_Upgrader_Skin::after()` when translations are up to date.
Avoids a PHP notice since `Language_Pack_Upgrader_Skin::before()` tries to access a non-existent update.
Also, change the `up_to_date` string to use the plural form because translations are only updated in bulk mode.

Fixes #36615.

git-svn-id: https://develop.svn.wordpress.org/trunk@37635 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-05 12:21:38 +00:00
Boone Gorges a77ffd8e83 Taxonomy: No, really, don't pass results of 'count' query through 'get_terms' filter.
[37623] used the wrong parameter name (count=true instead of fields=count).

For greater flexibility and forward compatibility with other potential changes
to the return value of `get_terms()`, we now do a looser check: any non-array
value is excluded from the filter.

Fixes #36992.

git-svn-id: https://develop.svn.wordpress.org/trunk@37634 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-04 12:19:15 +00:00
Gary Pendergast e7bbb482d6 Editor: 'undefined' !== 'undefiend'
Fix a typo in [37630].

See #36662.



git-svn-id: https://develop.svn.wordpress.org/trunk@37632 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-03 04:53:21 +00:00
Andrew Ozz 7d82fb2ee0 Editor: do not use the `modal-open` class to determine when the wpLink modal is open. This is a class used in Bootstrap and may be present when wpLink is not open. Store the open/closed state instead.
Fixes #36662.

git-svn-id: https://develop.svn.wordpress.org/trunk@37630 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 23:57:32 +00:00
Jeremy Felt 6792df6fab Multisite: Remove superfluous code from `network_edit_site_nav()`
* Remove output buffering.
* Remove `esc_attr()` when outputting hard coded class names.
* Update documentation.

Fixes #15800.


git-svn-id: https://develop.svn.wordpress.org/trunk@37629 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 22:28:17 +00:00
Jeremy Felt 9bbc0df8d8 Multisite: Replace `$wpdb->blog` queries in `get_site_by_path()` with `get_sites()`
Props spacedmonkey, DrewAPicture.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37628 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 21:45:20 +00:00
Andrew Ozz 245709dcd1 Auto-embedding:
- We already match URLs on their own line, add another regex to match URLs in their own paragraphs.
- Always exclude the `\s<>"` characters when matching.
- Add more unit tests.

Props iseulde, azaozz.
Fixes #25387.

git-svn-id: https://develop.svn.wordpress.org/trunk@37627 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 21:23:43 +00:00
Aaron Jorbin f1fdf6a1e8 Introduce filters for skipping parts of the bootstrap process
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See https://github.com/wp-cli/wp-cli/issues/177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See https://github.com/wp-cli/wp-cli/pull/164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.


git-svn-id: https://develop.svn.wordpress.org/trunk@37626 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 18:46:51 +00:00
Boone Gorges 1f5147bf83 Comments: Improve caching for hierarchical queries.
Hierarchical comment queries work by first fetching the IDs of top-level
comments, and then filling the descendant tree one level at a time based on the
top-level results. When top-level comment IDs are found in the cache,
`WP_Comment_Query` does not generate the SQL used to fetch these comments. In
this case, the `fill_descendants()` query does not have enough information
to fill children. As a result, descendant comments were failing to be filled
in cases where the top-level comments were found in the cache.

This was a minor bug previously, because comment caches were not maintained
between pageloads. Since comment caches are now persistent [37613], the problem
becomes evident anywhere that a persistent object cache is in use.

The solution is to cache parent-child relationships, so that when top-level
comments are found in the cache, descendant comments should be found there as
well.

Fixes #36487.

git-svn-id: https://develop.svn.wordpress.org/trunk@37625 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 18:27:43 +00:00
Rachel Baker 230f2986fb Comments: Remove debugging code left in `WP_Comments_List_Table->get_views()`.
Originally introduced in [9556] and leftover from [15578].

Props dabnpits.
Fixes #36938.

git-svn-id: https://develop.svn.wordpress.org/trunk@37624 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 15:06:29 +00:00
Boone Gorges f6a2067d37 Taxonomy: Don't pass results of 'count' query through 'get_terms' filter.
Use of the 'get_terms' filter was consolidated in [37572], with the
introduction of `WP_Term_Query`. At that time, the result of 'count=true'
queries began being filtered by 'get_terms'. This breaks existing 'get_terms'
callbacks, which often assume that the returned value will be an array or a
`WP_Error` object.

Props JustinSainton.
Fixes #36992.

git-svn-id: https://develop.svn.wordpress.org/trunk@37623 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 14:37:55 +00:00
Boone Gorges ab228ff84d Remove unused variable from `get_terms()`.
Missed in [37572]. See #35381.

Props JustinSainton.
See #36992.

git-svn-id: https://develop.svn.wordpress.org/trunk@37622 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 14:28:35 +00:00
Andrew Ozz 5f4b2877f9 Editor wpLink: swap the order of `innerText` and `textContent` to avoid getting styled text in IE.
Props dougwollison.
Fixes #36783.

git-svn-id: https://develop.svn.wordpress.org/trunk@37621 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 03:08:02 +00:00
Jeremy Felt 21fa6e2e9b Multisite: Replace `$wpdb->blog` queries in `ms-functions.php` with `get_sites()`
`get_sites()` is now used in:
* `domain_exists()`
* `wp_update_network_site_counts()`
* `get_blog_id_from_url()`

Props spacedmonkey, jeremyfelt.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37620 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 02:25:56 +00:00
Andrew Ozz 3afb9f4839 Editor: ensure the page is refreshed when the users navigate to it with the Back or Forward buttons. In these cases the browsers usually load the page from (memory) cache and it contains the old editor content.
Fixes #35852.

git-svn-id: https://develop.svn.wordpress.org/trunk@37619 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 01:29:25 +00:00
Jeremy Felt 014fda7a20 Multisite: Bump `last_changed` cache on site update and creation
When a site is added, updated, or deleted, the `site_ids` cache for a query will no longer be reliable. Bumping `last_changed` will force a new query for site IDs.

See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37618 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-02 00:58:40 +00:00
Jeremy Felt caf0e9a151 Multisite: Replace `wp_get_sites()` internals with `get_sites()`
`get_sites()` should be considered a replacement for `wp_get_sites()`. Backward compatibility is maintained in the meantime by using `get_site()` to populate the return data with associative arrays rather than `WP_Site` objects.

Props spacedmonkey, flixos90.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37617 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 23:38:40 +00:00
Jeremy Felt e97e6bce70 Multisite: Introduce get_sites()
`get_sites()` is a wrapper for `WP_Site_Query`.

Props spacedmonkey, DrewAPicture.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37616 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 23:20:39 +00:00
Drew Jaynes 23aa6afccb Docs: Improve return descriptions for `get_the_category()` and `get_the_term()` to specifically notate that an array of `WP_Term` objects is returned on success.
See #32246. 


git-svn-id: https://develop.svn.wordpress.org/trunk@37615 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 22:45:19 +00:00
Boone Gorges b3dcb1ad05 Use `clean_comment_cache()` in `wp_insert_comment()`.
Previously, only the 'last_changed' incrementor was manually invalidated, since
the newly created comment did not yet exist in the cache. However, this created
an inconsistency with the other comment CRUD functions, which result in the
'clean_comment_cache' action firing.

Props spacedmonkey.
See #36906.

git-svn-id: https://develop.svn.wordpress.org/trunk@37614 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 21:55:19 +00:00
Boone Gorges ecd5e349a6 Make the 'comment' cache group persistent.
'comment' was made non-persistent in [7986], to address the difficulty of
reliable cache invalidation. Since then, the comment system has improved such
that we can be more confident that caches are being busted as needed.

Props spacedmonkey.
Fixes #36906.

git-svn-id: https://develop.svn.wordpress.org/trunk@37613 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 21:25:46 +00:00
Andrea Fercia d3f419c53c Accessibility: improve the color contrast in the Edit Comment "Status" box.
The current orange and red used for the radio button labels in the Edit Comment
"Status" box don't have a sufficient color contrast ratio with the background.
Removing the colors improves accessibility and consistency.

See #35659, #35622.
Fixes #36967.

git-svn-id: https://develop.svn.wordpress.org/trunk@37611 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 17:50:50 +00:00
Andrea Fercia 2e54e6cb85 Accessibility: match the visual and tab order in the Media Modal grid.
By moving the Details sidebar after the attachments grid, the tab order is
greatly improved for keyboard users and matches the logical and visual order.

Fixes #36909.

git-svn-id: https://develop.svn.wordpress.org/trunk@37610 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 17:38:04 +00:00
Rachel Baker 6655a8d48a Comments: Break the inline display of comment content urls on the Moderate Comment screen
Uses the CSS rule `word-break: break-all`.

Fixes #36568.

git-svn-id: https://develop.svn.wordpress.org/trunk@37607 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 16:04:53 +00:00
Ella Iseulde Van Dorpe aa6e844435 Editor: autoresize fixes for text
* Resize on backspace.
* Don't make it smaller than the minimum height.

Props azaozz, iseulde.

See #36482.



git-svn-id: https://develop.svn.wordpress.org/trunk@37603 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 10:23:17 +00:00
Gary Pendergast bc975d28d4 Database: Split the logic of `wpdb::init_charset()` into a separate method.
The logic for determining the appropriate character set and collation to use is becoming more complex, particularly with the recent additions of [37522] and [37523]. As `init_charset()` has side effects, and makes use of constants instead of parameters, it's not possible to unit test this logic.

This commit splits the logic part of `init_charset()` out into a new method, `wpdb::determine_charset()`, along with appropriate unit tests.

See #32105, #37522.

Fixes #36917.



git-svn-id: https://develop.svn.wordpress.org/trunk@37601 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 02:37:20 +00:00
Boone Gorges 9b19a33952 Ensure that `get_terms()` can accept querystring-style arguments.
Prior to [37572], arguments passed to `get_terms()` were passed immediately
through `wp_parse_args()`, which made it possible to pass arguments as a
querystring (`hide_empty=0`) rather than an array
(`array( 'hide_empty' => false )`). [37572] moved default argument parsing
into `WP_Term_Query`, while assuming that arguments passed to `get_terms()`
would be formatted as an array.

To provide compatibility, we now parse all args passed to `get_terms()` into
an array before processing.

See #35381.

git-svn-id: https://develop.svn.wordpress.org/trunk@37599 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-31 12:53:27 +00:00
Dion Hulse dd472b7d2e Updates: Only use the filename component of URLs to form part of the temporary filename.
Previously we were passing the entire URL to `wp_tempnam()` (incorrectly) which caused the query string to be used as part of the temporary filename.
We now only use the file component of a url such as `https://example.com/filename.zip?arg1=1&arg2=2....&arg100=100` to prevent a long filename.

Fixes #34938


git-svn-id: https://develop.svn.wordpress.org/trunk@37598 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-31 02:20:58 +00:00
Andrew Ozz 37704c5cb8 TinyMCE: check if `wp.mce.views` exists before loading the wpview plugin. Fixes a js error when the rest of the media scripts are not loaded.
Fixes #36977.

git-svn-id: https://develop.svn.wordpress.org/trunk@37597 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 22:04:18 +00:00
Ella Iseulde Van Dorpe 9e9aeac12b Editor: better resizing for text editor
* Use `scrollHeight` to resize the text editor.
* Don't scroll the cursor into view when under the text editor's toolbar, it
  involves cloning the content which is quite slow.

Props iseulde, azaozz.

See #36482.



git-svn-id: https://develop.svn.wordpress.org/trunk@37596 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 20:31:57 +00:00
Boone Gorges cb5b8479f0 In `WP_Meta_Query`, don't cast `meta_value` to `CHAR`.
`CHAR` is redundant, since the `meta_value` column is `LONGTEXT`. Meanwhile,
use of `CAST()` causes MySQL to ignore any index that the administrator may
have added to the column.

A number of automated tests were doing searches for `CAST` in the SQL strings
generated by `WP_Meta_Query` (for reasons unrelated to the `CAST()` behavior).
These tests have been updated to expect the new query format.

Props ericlewis.
Fixes #36625.

git-svn-id: https://develop.svn.wordpress.org/trunk@37594 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 04:35:16 +00:00
Boone Gorges 23d0c953d2 Don't clear object relationship caches on term update.
Since [37573], object relationship caches (`{$taxonomy}_relationships`)
contain term IDs rather than term objects. See #36814. As such, it's no longer
necessary to clear these caches when a term is updated; none of the data that's
changed on update (name, description, count, etc) is stored in the relationship
cache.

Fixes #36251.

git-svn-id: https://develop.svn.wordpress.org/trunk@37593 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 04:10:16 +00:00
Drew Jaynes 8e79f0fb3d Docs: Ensure hook and duplicate hook docs directly precede all instances of the `image_memory_limit` filter.
Hook docs must directly precede hooks in order for the Code Reference parser to correctly identify them as such.

Fixes #36968. 


git-svn-id: https://develop.svn.wordpress.org/trunk@37592 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 02:13:57 +00:00
Drew Jaynes a66277f245 Docs: Correct a duplicate filter comment for the `image_memory_limit` hook to point to the correct file.
Props bobbingwide.
See #36968.


git-svn-id: https://develop.svn.wordpress.org/trunk@37591 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 02:09:46 +00:00
Tammie 5664f0d6ea Twenty Elevent Ephemera widget fix for caching in Customizer preview.
Fixes #36429. Props anneschmidt, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@37590 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-29 16:05:46 +00:00
Boone Gorges c96858b0f2 Allow term meta lazy-loading to be selectively disabled in `WP_Query`.
The process of lazy-loading can be resource intensive for object that have
terms in large numbers of taxonomies and are running a persistent object cache.
This new parameter allows the feature to be disabled in these cases.

Props DBrumbaugh10Up.
See #36953.

git-svn-id: https://develop.svn.wordpress.org/trunk@37589 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-28 03:09:09 +00:00
Aaron Jorbin 13350c95e4 Bootstrap/Load: Load plugin.php earlier in wp-settings.php
In order to allow non-web initializations of WordPress (such as through wp-cli) to modify things like the check for maintenance mode, plugins.php and the associated functions must be available much earlier. The use of these functions earlier than the loading of plugins is not recommended in most use cases.

Fixes #36819. See #34936.
Props jorbin, danielbachhuber for documentation.


git-svn-id: https://develop.svn.wordpress.org/trunk@37588 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 19:19:12 +00:00
Drew Jaynes e890bfae0d Docs: Improve documentation for `wp_generate_tag_cloud()` default arguments by formatting them into in a hash-notation.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37587 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:59:12 +00:00
Drew Jaynes 6695126f24 Docs: Improve formatting in the DocBlock for `sanitize_bookmark_field()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37586 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:15:58 +00:00
Drew Jaynes 1942855ada Docs: Standardizes and improves DocBlock summaries for the `__get()`, `__set()`, `__isset()`, and `__unset()` magic methods in `wpdb`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37585 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:11:47 +00:00
Rachel Baker 3ba3c42728 Comments: Display approved comments on the Edit Post screen to users without the `edit_comment` capability.
Matches logic in `wp_dashboard_recent_comments()` where we display approved comments regardless of the edit permission.

Props jfarthing84 for initial patch.
Fixes #24648. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37584 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 14:09:29 +00:00
Dominik Schilling (ocean90) 35a7acb459 Database: Normalize index definitions in `dbDelta()`.
`dbDelta()` compares the index definitions against the result of `SHOW INDEX FROM $table_name`. This requires a specific format so indices are not unnecessarily re-created. This format wasn't ensured, until now.

* Parse the raw index definition to extract the type, name and columns so a normalized definition can be built (#20263, #34873).
* Standardize on uppercase types (#34871) and on 'KEY'. 'INDEX' is only a synonym for 'KEY'.
* Escape index names with backticks (#20263).
* Normalize columns: Ignore ASC and DESC definitions (#34959), remove whitespaces (#34869) and escape column names with backticks (#20263).
* Add backticks to all index change queries (#20263).

Props ocean90, pento, kurtpayne.
Fixes #20263, #34869, #34871, #34873, #34959.

git-svn-id: https://develop.svn.wordpress.org/trunk@37583 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 11:56:20 +00:00
Peter Wilson 531ceb899e Customize: Run autoprefixer following [37476]
Adds prefixes to box-shadow and transition properties.

See #34893



git-svn-id: https://develop.svn.wordpress.org/trunk@37582 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 05:14:25 +00:00
Gary Pendergast c7f8735698 Setup: Sanity check for invalid table prefixes.
There are some table prefixes (for example, `7e1_`), which MySQL will try and parse as values when they're note quoted in backticks. Because not everything remembers to quote their table names, it's best if we just discourage their use during setup.

Fixes #36422.



git-svn-id: https://develop.svn.wordpress.org/trunk@37581 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 01:53:09 +00:00
Dominik Schilling (ocean90) ea970f17ad Plugins: Fix order of arguments for the `strpos()` function added in [37562].
See #36706.

git-svn-id: https://develop.svn.wordpress.org/trunk@37580 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 23:14:52 +00:00
Drew Jaynes f4a4bb77f5 Docs: Remove unnecessary backtick-escaping around two function references in the DocBlock for `get_object_term_cache()`.
Known classes, methods, and functions are now auto-linked and formatted in the Code Reference. :-)

See [37573]. See #36814.


git-svn-id: https://develop.svn.wordpress.org/trunk@37578 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 15:21:45 +00:00
Drew Jaynes 08e8157d25 Docs: Link up a reference to the `get_terms_args` filter in the hook doc for `get_terms_defaults`.
See #35381. See #36921.


git-svn-id: https://develop.svn.wordpress.org/trunk@37577 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 15:16:26 +00:00
Boone Gorges e613d97234 Pass the proper values to `get_terms` action.
* `$term_query` should be passed.
* Second and third params should come from the `$term_query->query_vars` array, so that they're fully parsed.

These changes were missed in [37572].

Props flixos90, sebastian.pisula.
See #35381.
Fixes #36951.

git-svn-id: https://develop.svn.wordpress.org/trunk@37576 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 14:55:38 +00:00
Dominik Schilling (ocean90) 8119c1b473 Version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@37575 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 10:05:21 +00:00
Gary Pendergast a51a68fb75 Database: Add support for `SPATIAL` keys to `dbDelta()`.
`dbDelta()` already supported spatial fields (by virtue of not checking field types), so it's nice to round that out with spatial key support, too.

Fixes #36948.



git-svn-id: https://develop.svn.wordpress.org/trunk@37574 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:58:13 +00:00
Boone Gorges 96b71d7d89 Store only term IDs in object term relationships caches.
Previously, objects containing all data about a term were stored in each
object's term cache. Besides being wasteful, this approach caused invalidation
issues, as when a modified term count required a flush for all objects
belonging to the term.

Backward compatibility is maintained for plugins that continue to put object
data directly into the `{$taxonomy}_relationships` cache bucket.

Fixes #36814.

git-svn-id: https://develop.svn.wordpress.org/trunk@37573 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:49:10 +00:00
Boone Gorges 8b9bdaccd2 Introduce `WP_Term_Query` and use in `get_terms()`.
`WP_Term_Query` is modeled on existing query classes, such as those used
for comments and users. It provides a more consistent structure for generating
term queries, and should make it easier to add new functionality in the future.

Props flixos90, boonebgorges.
See #35381.

git-svn-id: https://develop.svn.wordpress.org/trunk@37572 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:32:30 +00:00
Drew Jaynes 0b56d3fd1b Docs: Reorder argument descriptions in the DocBlock for `wp_list_categories()` to match the default arguments list and improve reading at a glance.
Props birgire for the initial patch.
Fixes #36693.


git-svn-id: https://develop.svn.wordpress.org/trunk@37571 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:39:32 +00:00
Dominik Schilling (ocean90) 7878f8f9ea Upgrade: Allow update checks on `upgrader_process_complete` to be run during Ajax requests.
Fixes missing translation updates during shiny updates.

Fixes #36914.

git-svn-id: https://develop.svn.wordpress.org/trunk@37570 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:35:07 +00:00
Drew Jaynes 2b9ea8de78 Docs: Add missing documentation for the `style` argument in the DocBlock for `wp_list_categories()`.
Props birgire for the initial patch.
See #36693.


git-svn-id: https://develop.svn.wordpress.org/trunk@37569 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:34:41 +00:00
Drew Jaynes add75910c9 Docs: Add missing `@access` tags to methods in `WP_oEmbed_Controller`.
See [34903].

Props ramiy.
Fixes #36297.


git-svn-id: https://develop.svn.wordpress.org/trunk@37568 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:21:11 +00:00
Boone Gorges a378749df6 Fix termmeta pre-fetching in `wp_get_object_terms()`.
[34529] introduced logic intended to prime the termmeta cache for certain
values of the `fields` parameter. There were a few bugs:

* The `all_with_object_id` param was misspelled.
* `term_id` was used instead of `ids`.
* The values being passed to `update_termmeta_cache()` in the case where `fields=ids` was not correct.

All of these would result in a failure to pre-fetch termmeta in some cases.

Props dlh.
Fixes #36932.

git-svn-id: https://develop.svn.wordpress.org/trunk@37567 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:44:00 +00:00
Boone Gorges 1d3511ba8c In `get_bookmarks()`, don't cache if 'orderby=rand'.
Props lukecavanagh, prettyboymp, c3mdigital, MikeHansenMe.
Fixes #18356.

git-svn-id: https://develop.svn.wordpress.org/trunk@37565 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:29:01 +00:00
Drew Jaynes a27b379144 Docs: Update the return description for `get_preview_post_link()` to note that it can also return null.
Props chris_dev, swissspidy.
See #35915.


git-svn-id: https://develop.svn.wordpress.org/trunk@37564 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:24:33 +00:00
Dominik Schilling (ocean90) a34e38513f Plugins: In `get_plugin_data()` use the plugin slug for the text domain when no text domain is defined in the header.
Fixes #36706.

git-svn-id: https://develop.svn.wordpress.org/trunk@37562 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:53:38 +00:00
Drew Jaynes ba9e51c4a5 Docs: Correct DocBlock descriptions for the `$before`, `$after`, `$link_before`, and `$link_after` arguments for `wp_nav_menu()`.
* `$before` falls before the link markup starts
* `$after` falls after the link markup ends
* `$link_before` falls before the link text
* `$link_after` falls after the link text

Props wp_smith for the initial patch.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37561 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:16:45 +00:00
Drew Jaynes 32418ef8ed Docs: Standardize DocBlock summaries for hooks that serve to "print" something to use third-person singular verbs.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37560 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:04:37 +00:00