Commit Graph

10754 Commits

Author SHA1 Message Date
Drew Jaynes 36e36e3b1d Docs: Make the DocBlock summary for `get_option()` more explicit and convert to using a third-person singular verb.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37876 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 17:28:30 +00:00
Jeremy Felt 269512cd6b Multisite: Remove unused `site_count` property from `WP_Site_Query`.
Related: [37837].

Props flixos90.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37875 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:32:07 +00:00
Jeremy Felt 90b85743a7 Multisite: Clear incomplete objects from cache in `get_blog_details()` when found.
In [37657], the `blog_id` and `site_id` properties were changed to private. Any `WP_Site` objects previously stored in cache with public properties should now be considered invalid. We can detect this by checking for these missing properties and clearing the dirty cache if found.

Props flixos90.
Fixes #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37874 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:28:35 +00:00
Sergey Biryukov b28ca0f4b8 Comments: Remove the assignment of an undocumented `$comment_count` property in `WP_Comment_Query::get_comments()`, which appears to be accidentally introduced in [34544].
Props flixos90.
Fixes #37187.

git-svn-id: https://develop.svn.wordpress.org/trunk@37873 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:27:49 +00:00
Konstantin Kovshenin 9b536c37d4 Themes: Wrap unusually long theme names on the Theme Details screen.
Props xavortm
Fixes #37033


git-svn-id: https://develop.svn.wordpress.org/trunk@37872 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:19:31 +00:00
Jeremy Felt 8cde06c4e4 Multisite: Set `WP_Network` `blog_id` property default to string as expected.
The `blog_id` property is always returned (and expected) as a string, so we should set it as one by default.

Props flixos90.
See #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37871 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 13:24:58 +00:00
Jeremy Felt 421888d9f4 Multisite: Change `WP_Network` `id` property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.


git-svn-id: https://develop.svn.wordpress.org/trunk@37870 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 13:22:36 +00:00
Jeremy Felt eb2ce329f1 Multisite: Cache `found_sites` and `max_num_pages` in `WP_Site_Query`.
This avoids a second uncached query used to determine found rows. Instead, we can cache the number of found sites and the max number of pages for reuse when the same query is requested in the future.

Props spacedmonkey.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37868 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 12:45:29 +00:00
Weston Ruter d3211979ae Customize: Always define functions `reflowPaneContents`, `findControlsForSettings`, and `_handleSettingValidities` on `wp.customize`.
Moves definitions of functions outside of a `jQuery.ready()` callback, as these functions needn't be deferred to DOM ready. This change also ensures that the functions are available if `customize-controls` is enqueued outside of the Customizer context, as the ready callback short-circuits if `_wpCustomizeSettings` is not defined. The `findControlsForSettings` and `_handleSettingValidities` functions were misplaced in r37700.

See #34893.
See #36944.
See #29071.


git-svn-id: https://develop.svn.wordpress.org/trunk@37867 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 11:54:20 +00:00
Peter Wilson 9ea1a7eb4f Posts: Fix back-compat for filters in get the modified time and date functions after [37738].
When no valid post exists for `get_the_modified_time` or `get_the_modified_date` calls, the result (`false`) is passed through the functions respective filters to maintain back-compat.

Introduces unit tests to ensure filters are applied and for the `get_the_modified_date` function.

Fixes #37059.


git-svn-id: https://develop.svn.wordpress.org/trunk@37866 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 11:29:13 +00:00
Sergey Biryukov 9853789382 Docs: Fix typo in `wp-includes/shortcodes.php` file description.
Props ixkaito.
Fixes #37175.

git-svn-id: https://develop.svn.wordpress.org/trunk@37865 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 10:14:08 +00:00
Sergey Biryukov 4a158e621d Database: Explicitly globalize `$wpdb` in `wp-settings.php` in case WordPress isn't loaded in global scope.
See [18993] for `$table_prefix`.

Props danielbachhuber.
Fixes #37123.

git-svn-id: https://develop.svn.wordpress.org/trunk@37864 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 10:05:20 +00:00
Drew Jaynes 8a7a62bb11 Docs: Add two simple usage examples to the DocBlock for `wp_redirect()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37863 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 07:45:31 +00:00
Drew Jaynes b36a6b44ed Docs: Improve the syntax and tensing within the DocBlock for `is_home()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37862 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 07:31:42 +00:00
Boone Gorges c97f234e6f Allow action and filter hooks to be deprecated.
When a filter or action hook is deprecated, the corresponding `apply_filters()`
or `do_action()` calls should be switched out with `apply_filters_deprecated()`
or `do_action_deprecated()`. The latter functions will throw a deprecation
before invoking the original hook.

Props solarissmoke, SergeyBiryukov, DrewAPicture.
Fixes #10441.

git-svn-id: https://develop.svn.wordpress.org/trunk@37861 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-25 19:56:19 +00:00
Boone Gorges 255aaa471e Fix orderby meta handling for `WP_Term_Query`.
In order to allow meta-related values of `orderby` to be handled properly,
the term query's `meta_query` object must run its `get_sql()` method before
`orderby` parsing.

Fixing this bug required addressing another bug in `WP_Meta_Query`, which
caused the table alias index not to be reset when calling `get_sql()`
multiple times on the same object.

Props littler.chicken.
Fixes #37151.

git-svn-id: https://develop.svn.wordpress.org/trunk@37860 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-25 16:22:55 +00:00
Gary Pendergast d4c360d186 Media: Prompt when deleting multiple items from the Media Library
We prompt when deleting a single item from the Media Library, but not when deleting multiple items. This inconsistency is now rectified.

Props southp.
Fixes #28235.



git-svn-id: https://develop.svn.wordpress.org/trunk@37859 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-24 15:55:26 +00:00
Pascal Birchler 044064dcce I18N: Remove HTML tags from translatable string in `wp-admin/maint/repair.php`.
Props anilbasnet.
Fixes #37147.

git-svn-id: https://develop.svn.wordpress.org/trunk@37858 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 16:11:47 +00:00
Pascal Birchler bdaede85d7 Posts: Add hooks for post sticky status changes.
This adds a new `post_stuck` action that fires when a post is made sticky and a `post_unstuck` action that fires when the sticky flag is removed again.

Props ojrask.
Fixes #35600.

git-svn-id: https://develop.svn.wordpress.org/trunk@37857 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 15:51:03 +00:00
Pascal Birchler 70693b520f Posts list table: Add a filter to disable the categories dropdown.
This allows one to short-circuit its output before any queries are run, similar to how it was done for the months dropdown in [31438].

Props davidmosterd for initial patch.
Fixes #36152.

git-svn-id: https://develop.svn.wordpress.org/trunk@37856 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 15:36:33 +00:00
Pascal Birchler d0555f9544 I18N: Enable unloading of text domains that have been loaded just in time.
[37415] removed the requirement to call `load_plugin_textdomain()` / `load_theme_textdomain()`. This caused `unload_textdomain()` to not work properly anymore in these cases.

With this change, unloaded text domains need to be explicitly loaded manually if you want to use them again.

Props swissspidy, ocean90.
Fixes #37113. See #34114.

git-svn-id: https://develop.svn.wordpress.org/trunk@37855 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 14:47:44 +00:00
Pascal Birchler 048bb7b250 Revisions: Remove unused post meta data during database upgrade.
Introduced in [23811], WordPress displayed some additional information for restored revisions for a short period of time. This was removed again in [25194], but the meta data was still being saved unnecessarily.

After 3 years and no plugins ever using this meta data, it's time to stop collecting it.

Fixes #36526.

git-svn-id: https://develop.svn.wordpress.org/trunk@37854 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 14:31:15 +00:00
Dominik Schilling (ocean90) a35a1a9c75 I18N: Add support for the Catalan flown dot in `remove_accents()`.
Props xavivars, SergeyBiryukov.
Fixes #37086.

git-svn-id: https://develop.svn.wordpress.org/trunk@37853 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 13:27:32 +00:00
Drew Jaynes f78e4becba Docs: Improve the formatting and usefulness of information in the DocBlock for `sanitize_text_field()`.
Also adds missing parameter and return descriptions.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37852 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 05:23:47 +00:00
Rachel Baker eadd8d0948 Utils: Update `wp.template` to match parameter changes to `_.template` in Underscore 1.8.3.
Removes passing a `null` value for the back-compat only `data` parameter to `_.template`.

Props jnylen0.
Fixes #36695. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37851 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-23 02:29:15 +00:00
Jeremy Felt 5640b2b02c Multisite: Move call of `get_blog_details()` inside `ms_site_check()`.
This allows the `ms_site_check` filter or `is_super_admin()` check to return `true` before `get_blog_details()` is used.

Props danielbachhuber.
Fixes #37118.


git-svn-id: https://develop.svn.wordpress.org/trunk@37850 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-22 21:33:20 +00:00
Drew Jaynes 6b35519559 Docs: Add some missing changelog entries to the DocBlock for `add_theme_support()`.
Part props sirjonathan.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37849 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-22 14:24:28 +00:00
Drew Jaynes e2705a8718 Docs: Correct the `$request` parameter datatype in the hook doc for the `posts_request` filter.
It's a string, not an array.

Props coffee2code.
Fixes #37142.


git-svn-id: https://develop.svn.wordpress.org/trunk@37848 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 22:21:55 +00:00
Drew Jaynes 75351068df Bump version number for nightly builds.
git-svn-id: https://develop.svn.wordpress.org/trunk@37847 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 22:06:28 +00:00
Nikolay Bachiyski 8b0e466232 Admin: escape URL-encoded permalinks
git-svn-id: https://develop.svn.wordpress.org/trunk@37801 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:45:54 +00:00
Rachel Baker f28d567989 Revisions: Change the capability needed to view revision diffs to `edit_post`.
git-svn-id: https://develop.svn.wordpress.org/trunk@37779 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:19:26 +00:00
Nikolay Bachiyski 6e9a0fb948 Admin: Escape attachment name in case it contains special characters
git-svn-id: https://develop.svn.wordpress.org/trunk@37774 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:18:27 +00:00
Joe McGill 93cae978dd Media: Improve handling of extensionless filenames.
This ensures files retain a filename after sanitization.

Fixes 37111.

git-svn-id: https://develop.svn.wordpress.org/trunk@37756 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 13:43:59 +00:00
Joe McGill b428df51e5 Media: Restore keyboard navigation of the media grid.
This changes the binding of event listeners in the Attachments Browser
to use `on` instead of `listenTo` for the `attachment:keydown:arrow` and
`attachment:details:shift-tab` events. The existing listeners broke
when we upgraded Backbone in [36546].

Props adamsilverstein.
Fixes #36900.

git-svn-id: https://develop.svn.wordpress.org/trunk@37755 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 13:34:19 +00:00
Drew Jaynes ce565d2fb2 Docs: Clarify documentation for `wp_logout_url()` and `wp_login_url()` and corresponding hooks to highlight whether HTML-encoded or un-encoded values should be expected.
The return from `wp_logout_url()` is HTML-encoded due to its value passing through `wp_nonce_url()` and thus `esc_html()`. Adversely `wp_login_url()` passes through no such escaping and therefore should not be expected to return an HTML-encoded value.

Props akibjorklund for the initial patch.
Fixes #34352.


git-svn-id: https://develop.svn.wordpress.org/trunk@37753 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-20 08:47:20 +00:00
Drew Jaynes 01bfb1342b Docs: Improve the summaries and return descriptions for `get_registered_nav_menus()` and `get_nav_menu_locations()`.
Props rabmalin for the initial patch.
Fixes #37106.


git-svn-id: https://develop.svn.wordpress.org/trunk@37752 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-20 08:25:16 +00:00
Andrew Ozz 6304560fb7 Editor, link checker:
- Add white outline for contrast on darker backgrounds.
- Change red colour in toolbar.

Props iseulde. Props rockwell15 for the initial patch.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@37751 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 13:00:30 +00:00
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