Commit Graph

34646 Commits

Author SHA1 Message Date
Joe McGill f82e7ed434 Media: Add action to display attachments on the edit screen.
This adds a new action hook, `wp_edit_form_attachment_display` to
`edit_form_image_editor()`, which can be used as a fallback to render
previews of an attachment that isn't an image, audio, or video file
included in the media library.

Props georgestephanis.
Fixes #36502.
Built from https://develop.svn.wordpress.org/trunk@37879


git-svn-id: http://core.svn.wordpress.org/trunk@37820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 22:37:27 +00:00
Drew Jaynes 21ef286eef Docs: Further improve the note of caution within the DocBlock description for `query_posts()`.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@37878


git-svn-id: http://core.svn.wordpress.org/trunk@37819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 18:06:27 +00:00
Drew Jaynes 872f1c5d38 Docs: Add a note to the DocBlock for `query_posts()` to caution against general usage, including a pointer to the `pre_get_posts` action.
Also adds missing parameter and return descriptions.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@37877


git-svn-id: http://core.svn.wordpress.org/trunk@37818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 17:47:28 +00:00
Drew Jaynes 94980d89e0 Docs: Make the DocBlock summary for `get_option()` more explicit and convert to using a third-person singular verb.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@37876


git-svn-id: http://core.svn.wordpress.org/trunk@37817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 17:29:30 +00:00
Jeremy Felt 12809c4735 Multisite: Remove unused `site_count` property from `WP_Site_Query`.
Related: [37837].

Props flixos90.
See #35791.

Built from https://develop.svn.wordpress.org/trunk@37875


git-svn-id: http://core.svn.wordpress.org/trunk@37816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:33:28 +00:00
Jeremy Felt 9edd8df844 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.

Built from https://develop.svn.wordpress.org/trunk@37874


git-svn-id: http://core.svn.wordpress.org/trunk@37815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:29:28 +00:00
Sergey Biryukov bf2bea4987 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.
Built from https://develop.svn.wordpress.org/trunk@37873


git-svn-id: http://core.svn.wordpress.org/trunk@37814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:28:28 +00:00
Konstantin Kovshenin 3d0141fe04 Themes: Wrap unusually long theme names on the Theme Details screen.
Props xavortm
Fixes #37033

Built from https://develop.svn.wordpress.org/trunk@37872


git-svn-id: http://core.svn.wordpress.org/trunk@37813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:27:25 +00:00
Jeremy Felt 93a26a2a58 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.

Built from https://develop.svn.wordpress.org/trunk@37871


git-svn-id: http://core.svn.wordpress.org/trunk@37812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26:57 +00:00
Jeremy Felt 6f3f00ea97 Multisite: Change `WP_Network` `id` property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.

Built from https://develop.svn.wordpress.org/trunk@37870


git-svn-id: http://core.svn.wordpress.org/trunk@37811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26:29 +00:00
Nikolay Bachiyski c5d9d5cc18 Admin: escape URL-encoded permalinks
Built from https://develop.svn.wordpress.org/trunk@37801


git-svn-id: http://core.svn.wordpress.org/trunk@37766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 14:46:49 +00:00
Rachel Baker a2904cc309 Revisions: Change the capability needed to view revision diffs to `edit_post`.
Built from https://develop.svn.wordpress.org/trunk@37779


git-svn-id: http://core.svn.wordpress.org/trunk@37744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 14:22:26 +00:00
Nikolay Bachiyski 4372cdf45d Admin: Escape attachment name in case it contains special characters
Built from https://develop.svn.wordpress.org/trunk@37774


git-svn-id: http://core.svn.wordpress.org/trunk@37739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 14:20:55 +00:00
Joe McGill 2bdc11781d Media: Improve handling of extensionless filenames.
This ensures files retain a filename after sanitization.

Fixes 37111.
Built from https://develop.svn.wordpress.org/trunk@37756


git-svn-id: http://core.svn.wordpress.org/trunk@37721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 13:44:31 +00:00
Joe McGill f1dddc6bfb 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.
Built from https://develop.svn.wordpress.org/trunk@37755


git-svn-id: http://core.svn.wordpress.org/trunk@37720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 13:35:34 +00:00
Drew Jaynes 2eae9d3f46 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.

Built from https://develop.svn.wordpress.org/trunk@37753


git-svn-id: http://core.svn.wordpress.org/trunk@37718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-20 08:48:28 +00:00
Drew Jaynes eb7df1379b 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.

Built from https://develop.svn.wordpress.org/trunk@37752


git-svn-id: http://core.svn.wordpress.org/trunk@37717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-20 08:26:29 +00:00
Andrew Ozz 07cef1ce62 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.
Built from https://develop.svn.wordpress.org/trunk@37751


git-svn-id: http://core.svn.wordpress.org/trunk@37716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-19 13:01:28 +00:00
Pascal Birchler ddca3c1e01 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.
Built from https://develop.svn.wordpress.org/trunk@37750


git-svn-id: http://core.svn.wordpress.org/trunk@37715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-19 12:51:27 +00:00
Andrew Ozz ca25c94613 Grunt: when running `precommit` use regex to check which files have been modified.
Fixes #36528.
Built from https://develop.svn.wordpress.org/trunk@37749


git-svn-id: http://core.svn.wordpress.org/trunk@37714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-19 12:32:27 +00:00
Pascal Birchler 542e462d9d 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.
Built from https://develop.svn.wordpress.org/trunk@37748


git-svn-id: http://core.svn.wordpress.org/trunk@37713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-19 12:25:28 +00:00
Pascal Birchler a97f0a2c19 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.
Built from https://develop.svn.wordpress.org/trunk@37747


git-svn-id: http://core.svn.wordpress.org/trunk@37712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-19 12:02:29 +00:00
Pascal Birchler 62fdd6bd1a L10n: Add unit tests for the `override_load_textdomain` filter.
Fixes #36398.
Built from https://develop.svn.wordpress.org/trunk@37746


git-svn-id: http://core.svn.wordpress.org/trunk@37711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-18 10:10:28 +00:00
Pascal Birchler e176835791 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.
Built from https://develop.svn.wordpress.org/trunk@37745


git-svn-id: http://core.svn.wordpress.org/trunk@37710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-18 10:00:29 +00:00
Pascal Birchler ae56f468e3 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.
Built from https://develop.svn.wordpress.org/trunk@37744


git-svn-id: http://core.svn.wordpress.org/trunk@37709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-18 09:47:29 +00:00
Rachel Baker d7e743a286 Comments: Wrap or unwrap the List Table comment_date as comment status changes via Ajax.
Introduced in [36521].

Fixes #36742.
Props imath, adamsilverstein.
Built from https://develop.svn.wordpress.org/trunk@37743


git-svn-id: http://core.svn.wordpress.org/trunk@37708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 21:48:27 +00:00
Andrea Fercia dd5bc0d28e 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.
Built from https://develop.svn.wordpress.org/trunk@37742


git-svn-id: http://core.svn.wordpress.org/trunk@37707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 20:47:28 +00:00
Andrew Ozz accf240d37 Editor: after inserting a link detect if the URL is broken, first run.
Props iseulde, azaozz.
See #36638.
Built from https://develop.svn.wordpress.org/trunk@37741


git-svn-id: http://core.svn.wordpress.org/trunk@37706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 20:41:28 +00:00
Helen Hou-Sandí 8776694a33 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.

Built from https://develop.svn.wordpress.org/trunk@37740


git-svn-id: http://core.svn.wordpress.org/trunk@37705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 18:37:28 +00:00
Drew Jaynes 9afeafeff2 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.

Built from https://develop.svn.wordpress.org/trunk@37739


git-svn-id: http://core.svn.wordpress.org/trunk@37704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 16:06:31 +00:00
Peter Wilson 3b5bb5e067 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.

Built from https://develop.svn.wordpress.org/trunk@37738


git-svn-id: http://core.svn.wordpress.org/trunk@37703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 05:12:28 +00:00
Andrew Ozz c8d203e1a3 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.
Built from https://develop.svn.wordpress.org/trunk@37737


git-svn-id: http://core.svn.wordpress.org/trunk@37702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 03:02:29 +00:00
Jeremy Felt d242446e59 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.

Built from https://develop.svn.wordpress.org/trunk@37736


git-svn-id: http://core.svn.wordpress.org/trunk@37701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 00:03:29 +00:00
Jeremy Felt b4df848b6d 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.

Built from https://develop.svn.wordpress.org/trunk@37735


git-svn-id: http://core.svn.wordpress.org/trunk@37700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 23:09:28 +00:00
Andrea Fercia 6b7f68855b 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.
Built from https://develop.svn.wordpress.org/trunk@37734


git-svn-id: http://core.svn.wordpress.org/trunk@37699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 21:51:27 +00:00
Aaron Jorbin 5533b3f6c3 Output node and npm versions on travis
In order to make local debugging of travis easier, output the npm and node versions when travis runs

Built from https://develop.svn.wordpress.org/trunk@37730


git-svn-id: http://core.svn.wordpress.org/trunk@37696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 17:28:27 +00:00
Pascal Birchler bf3fdc35b3 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.
Built from https://develop.svn.wordpress.org/trunk@37729


git-svn-id: http://core.svn.wordpress.org/trunk@37695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 17:18:28 +00:00
Dominik Schilling 0756d8bec7 Media: Use the correct variable for the file object.
See #14244.
Built from https://develop.svn.wordpress.org/trunk@37728


git-svn-id: http://core.svn.wordpress.org/trunk@37694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 16:15:31 +00:00
Dominik Schilling 4e403b2752 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.
Built from https://develop.svn.wordpress.org/trunk@37727


git-svn-id: http://core.svn.wordpress.org/trunk@37693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 15:39:28 +00:00
Rachel Baker 228c60a222 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.
Built from https://develop.svn.wordpress.org/trunk@37726


git-svn-id: http://core.svn.wordpress.org/trunk@37692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 14:59:28 +00:00
Dominik Schilling 2a76ccac4e 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.
Built from https://develop.svn.wordpress.org/trunk@37724


git-svn-id: http://core.svn.wordpress.org/trunk@37690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 09:45:27 +00:00
Dominik Schilling 8c8b3ba5ff 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.
Built from https://develop.svn.wordpress.org/trunk@37723


git-svn-id: http://core.svn.wordpress.org/trunk@37689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 09:27:29 +00:00
Andrew Ozz e983399136 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.
Built from https://develop.svn.wordpress.org/trunk@37722


git-svn-id: http://core.svn.wordpress.org/trunk@37688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 04:54:29 +00:00
Boone Gorges 8603aa402a 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.
Built from https://develop.svn.wordpress.org/trunk@37721


git-svn-id: http://core.svn.wordpress.org/trunk@37687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 02:01:29 +00:00
Sergey Biryukov d50ac5598f 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.
Built from https://develop.svn.wordpress.org/trunk@37720


git-svn-id: http://core.svn.wordpress.org/trunk@37686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 18:52:28 +00:00
Sergey Biryukov 9b4718a21f Plugins: Normalize `WP_PLUGIN_DIR` in the test added in [37332], otherwise it fails on Windows.
See #29154.
Built from https://develop.svn.wordpress.org/trunk@37719


git-svn-id: http://core.svn.wordpress.org/trunk@37685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 18:31:29 +00:00
Sergey Biryukov 35cfaf0065 I18N: Revert the test added in [37716], as it causes errors when running the full suite.
See #36790.
Built from https://develop.svn.wordpress.org/trunk@37718


git-svn-id: http://core.svn.wordpress.org/trunk@37684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 18:05:27 +00:00
Sergey Biryukov b0bb179da7 I18N: Adjust the regex in `wp_maybe_decline_date()` to handle word boundaries correctly.
Props semil.
Fixes #36790.
Built from https://develop.svn.wordpress.org/trunk@37717


git-svn-id: http://core.svn.wordpress.org/trunk@37683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 17:45:30 +00:00
Sergey Biryukov 3c6265bcca I18N: Add a unit test for `wp_maybe_decline_date()`.
See #36790.
Built from https://develop.svn.wordpress.org/trunk@37716


git-svn-id: http://core.svn.wordpress.org/trunk@37682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 17:41:28 +00:00
Konstantin Obenland 2678153cd4 Twenty Ten: Revert pot changes after update test.
Introduced in [37714].


Built from https://develop.svn.wordpress.org/trunk@37715


git-svn-id: http://core.svn.wordpress.org/trunk@37681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 16:46:29 +00:00