Commit Graph

34538 Commits

Author SHA1 Message Date
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
Konstantin Obenland
8c82515ab6 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 16:37:29 +00:00
Rachel Baker
15b4fa81d2 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.
Built from https://develop.svn.wordpress.org/trunk@37713


git-svn-id: http://core.svn.wordpress.org/trunk@37679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 14:51:27 +00:00
Boone Gorges
bd2fafae0a 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.
Built from https://develop.svn.wordpress.org/trunk@37712


git-svn-id: http://core.svn.wordpress.org/trunk@37678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 12:33:29 +00:00
Pascal Birchler
64ea32feea Fix tests after [37708].
See #36767.
Built from https://develop.svn.wordpress.org/trunk@37710


git-svn-id: http://core.svn.wordpress.org/trunk@37676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 11:55:28 +00:00
Pascal Birchler
629b43769b 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.
Built from https://develop.svn.wordpress.org/trunk@37708


git-svn-id: http://core.svn.wordpress.org/trunk@37674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 11:23:28 +00:00
Sergey Biryukov
247e33934c Permalinks: Avoid a PHP notice in get_permalink() if default category is unavailable.
Props Presskopp.
Fixes #36529.
Built from https://develop.svn.wordpress.org/trunk@37707


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


git-svn-id: http://core.svn.wordpress.org/trunk@37672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 22:46:27 +00:00
Sergey Biryukov
c4cdc9e7ad After [37702], correct the expected result in test_size_format().
See #37037.
Built from https://develop.svn.wordpress.org/trunk@37705


git-svn-id: http://core.svn.wordpress.org/trunk@37671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 22:13:27 +00:00