Commit Graph

35381 Commits

Author SHA1 Message Date
John Blackbourn
d3dd6046d5 Role/Capability: Disregard the order of capabilities when testing that single site and multisite capability tests match.
See #38191


git-svn-id: https://develop.svn.wordpress.org/trunk@38802 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-16 23:35:33 +00:00
Andrew Ozz
6cccdf89ee TinyMCE: restore the monospace font in textareas in the TinyMCE UI. Make it same as in the Text editor.
Fixes #38125.

git-svn-id: https://develop.svn.wordpress.org/trunk@38801 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-16 22:50:28 +00:00
Andrea Fercia
7ea0f51f01 Editor: Add a role button to the Tags meta box tag cloud links.
For better accessibility, the tag cloud links in the Tags meta box should be
reported to assistive technologies as buttons. They don't navigate to a new
resource, instead they perform an action.

Fixes #38318.


git-svn-id: https://develop.svn.wordpress.org/trunk@38800 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-16 20:08:01 +00:00
Andrea Fercia
95feac1df5 Menus: Fix the posts-categories quick search.
On the Menus screen, events that trigger the posts-categories search need to be
delegated. This "boxes" may get dynamically rebuilt so events directly attached
to the search input field need to be delegated.

Fixes #38324.


git-svn-id: https://develop.svn.wordpress.org/trunk@38799 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-16 20:02:33 +00:00
Sergey Biryukov
fb7e12b9ad Docs: In get_pages() and wp_list_pages(), note that post_status argument can also be an array.
Adjust the alignment of default argument values for better readability.

Props birgire, desrosj.
Fixes #38136.

git-svn-id: https://develop.svn.wordpress.org/trunk@38798 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-16 01:09:12 +00:00
Andrew Ozz
a1cae16efe Accessible Tags autocomplete:
- Replace suggest.js with UI Autocomplete.
- Use the same settings like in the editor link toolbar.
- Abstract it and add in a new file, tags-suggest.js. Then make it a dependency for the Tags postbox(es) and Quick and Bulk Edit.
- Add `data-wp-taxonomy` on all input elements to improve handling in the UI for custom taxonomies.

Props afercia, azaozz.
See #33902.

git-svn-id: https://develop.svn.wordpress.org/trunk@38797 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 22:39:49 +00:00
Andrew Ozz
53bacc01c2 TinyMCE:
- Prevent applying Indent and Outdent while an image with a caption is selected. It doesn't do anything and breaks the caption elements.
- Keep all of the text when a caption `<dl>` was somehow changed.

Fixes #38313.

git-svn-id: https://develop.svn.wordpress.org/trunk@38796 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 21:37:41 +00:00
Andrea Fercia
7ce67a141d Administration: Better consistency for the Media, Add Plugins, and Add Themes toolbars.
Fixes the Add Themes toolbar padding. Standardizes the placeholders to no title
case and three trailing dots. Expands the Media search placeholder in
"Search media items..." for consistency with the Plugins and Themes toolbars.

Props mikeviele, jamesacero, mattking5000, koenschipper, dungengronovius.

Fixes #38010.


git-svn-id: https://develop.svn.wordpress.org/trunk@38795 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 21:32:08 +00:00
Weston Ruter
c601e0c682 Customize: Move Pages below Custom Links in available nav menu items panel.
Props ryankienstra, celloexpressions.
See #36984.


git-svn-id: https://develop.svn.wordpress.org/trunk@38794 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 21:20:34 +00:00
Andrew Ozz
e93607c37f Media modal: make it possible to reorder images by dragging on devices with both touch screen and mouse support.
Props adamsilverstein.
Fixes #31652.

git-svn-id: https://develop.svn.wordpress.org/trunk@38793 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 20:28:55 +00:00
Boone Gorges
e9ef25d9f6 Query: Allow the hyphen-prefix-for-search-exclusion feature to be disabled by filter.
WordPress 4.4 introduced "hyphen exclusion" for search terms, so that
"foo -bar" would return posts containing "foo" AND not containing "bar".
The new filter 'wp_query_use_hyphen_for_exclusion' allows developers
to disable this feature when it's known that their content will contain
semantically important leading hyphens.

Props chriseverson, choongsavvii.
Fixes #38099.

git-svn-id: https://develop.svn.wordpress.org/trunk@38792 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 20:05:40 +00:00
Rachel Baker
53753c6c3a Pings/Trackbacks: Add new pre_trackback_post action before a trackback is added to a post.
Props dshanske, rachelbaker.
Fixes #37007.

git-svn-id: https://develop.svn.wordpress.org/trunk@38791 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 19:38:17 +00:00
Rachel Baker
a94f468051 REST API: Support sites with index-style permalinks in get_rest_url().
Support the index-style permalinks (http://example.com/index.php/postName) when registering the REST API rewrite rules and within the `get_rest_url()` function. This allows sites that do not have mod_rewrite support to have almost pretty urls and have access to their REST API endpoints.

Props kraftbj.
Fixes #38182.

git-svn-id: https://develop.svn.wordpress.org/trunk@38790 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 19:29:08 +00:00
John Blackbourn
6b8d8c90a5 Themes: Improve the inline documentation for the get_*_template() functions by providing examples instead of verbose explanations.
Fixes #38249
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38789 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 14:19:08 +00:00
Pascal Birchler
ddeae5feee Themes: Do not show an update button if there's no update package.
This updates the list view to match the existing behaviour in the single theme modal.

Props tristangemus for initial patch.
Fixes #37774.

git-svn-id: https://develop.svn.wordpress.org/trunk@38788 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 13:32:29 +00:00
John Blackbourn
3083effa52 Users: Use the role name instead of the role display name when fetching the list of users with no role. This avoids false positives when dealing with user roles that, for example, contain spaces in the display name.
Props procodewp, choongsavvii
Fixes #38234


git-svn-id: https://develop.svn.wordpress.org/trunk@38787 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 12:04:50 +00:00
Jeremy Felt
ee259e073a Multisite: Maintain switched state in site icon/logo functions.
Adjusts `get_custom_logo()`, `get_site_icon_url()`, and `has_custom_logo()` so that when called in a switched state, the original switched stack is not adjusted.

Props achbed, flixos90.
Fixes #38253.


git-svn-id: https://develop.svn.wordpress.org/trunk@38786 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-13 22:27:15 +00:00
Gary Pendergast
595c76de1a KSES: Deprecate wp_kses_js_entities().
This function was originally introduced to fix an XSS attack in Netscape 4, which never affected any other browsers, or later versions of Netscape.

I'm willing to go out on a limb, and say that we've officially dropped security support for Netscape 4.

Props dmsnell, desrosj.
Fixes #33848.



git-svn-id: https://develop.svn.wordpress.org/trunk@38785 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-13 22:24:27 +00:00
Boone Gorges
7e8e642ead Taxonomy: Cache results of term count queries.
Fixes #38295.

git-svn-id: https://develop.svn.wordpress.org/trunk@38784 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-12 15:29:03 +00:00
Boone Gorges
a1531d97af Comments: When checking comments, returned error object should include HTTP status code.
The status code in the `WP_Error` `data` array is needed to send
headers in wp-comments-post.php, and was erroneously not included in
[38778].

Props needle, websupporter.
Fixes #36901.

git-svn-id: https://develop.svn.wordpress.org/trunk@38783 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-12 13:49:21 +00:00
Andrew Ozz
3b9841351a TinyMCE: prevent iOS Safari from expanding the iframe width beyond the container width.
Fixes #38289.

git-svn-id: https://develop.svn.wordpress.org/trunk@38782 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-12 03:35:46 +00:00
Jeremy Felt
1d2db9eade Multisite: Clarify that get_site_by_path() does not return exact matches.
Props stevenlinx.
Fixes #38152.


git-svn-id: https://develop.svn.wordpress.org/trunk@38781 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-12 01:09:29 +00:00
Andrew Ozz
23bf03c3be TinyMCE: update the charmap plugin to the latest dev. version. Fixes problems with inserting white space characters.
Fixes #37936.

git-svn-id: https://develop.svn.wordpress.org/trunk@38780 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 23:55:24 +00:00
Boone Gorges
2b641b0c17 Taxonomy: Specify taxonomy when populating cached object terms.
[38776] introduced a call to `get_term()` using only the term ID. This
causes problems in cases where shared terms have not been split. Since
we have the taxonomy available, there's no harm in passing it along to
`get_term()`.

Props dd32.
See #37291.

git-svn-id: https://develop.svn.wordpress.org/trunk@38779 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 04:05:34 +00:00
Boone Gorges
eb12311afb Comments: Abstract die() calls from comment submission routine.
Since 4.4, comment submission has been mostly abstracted into a function,
rather than being processed inline in wp-comments-post.php. This change
made it easier to write automated tests against the bulk of the comment
submission process. `wp_allow_comment()` remained untestable, however:
when a comment failed one of its checks (flooding, duplicates, etc),
`die()` or `wp_die()` would be called directly. This shortcoming posed
problems for any application attempting to use WP's comment verification
functions in an abstract way - from PHPUnit to the REST API.

The current changeset introduces a new parameter, `$avoid_die`, to the
`wp_new_comment()` stack. When set to `true`, `wp_new_comment()` and
`wp_allow_comment()` will return `WP_Error` objects when a comment check
fails. When set to `false` - the default, for backward compatibility -
a failed check will result in a `die()` or `wp_die()`, as appropriate.

Prior to this changeset, default comment flood checks took place in the
function `check_comment_flood_db()`, which was hooked to the
'check_comment_flood' action. This design allowed the default comment
flood routine to be bypassed or replaced using `remove_action()`.
In order to maintain backward compatibility with this usage, while
simultaneously converting the comment flood logic into something that
returns a value rather than calling `die()` directly,
`check_comment_flood_db()` has been changed into a wrapper function for
a call to `add_filter()`; this, in turn, adds the *actual* comment flood
check to a new filter, 'wp_is_comment_flood'. Note that direct calls
to `check_comment_flood_db()` will no longer do anything in isolation.

Props websupporter, rachelbaker.
Fixes #36901.

git-svn-id: https://develop.svn.wordpress.org/trunk@38778 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 03:42:28 +00:00
Dion Hulse
9ef4ac3567 Taxonomy: Avoid a fatal error in the_tags() in the event that get_the_term_list() returns a WP_Error.
Props michalzuber.
See #37291.


git-svn-id: https://develop.svn.wordpress.org/trunk@38777 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 03:26:11 +00:00
Boone Gorges
5fef526cca Taxonomy: Better error handling when fetching object terms from cache.
Since [37573], `get_object_term_cache()` has expected term IDs to be
stored in the taxonomy relationship cache. The function would then
reach directly into the 'terms' cache to fetch the data corresponding
to a given term, before returning a `WP_Term` object. This caused
problems when, for one reason or another, term data was cached
inconsistently:

* If the 'terms' cache is empty for a given term ID, despite the earlier call to `_prime_term_caches()`, `get_term()` would return an error object.
* If the array of cached term IDs contains an invalid ID, `get_term()` would return an error object.

We avoid these errors by no longer touching the 'terms' cache directly,
but running term IDs through `get_term()` and allowing that function to
reference the cache (and database, as needed). If `get_term()` returns
an error object for any of the cached term IDs, `get_object_term_cache()`
will return that error object alone. This change ensures that upstream
functions, like `get_the_terms()`, return `WP_Error` objects in a
predictable fashion.

Props dd32, michalzuber.
Fixes #37291.

git-svn-id: https://develop.svn.wordpress.org/trunk@38776 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 01:55:58 +00:00
Gary Pendergast
b87156d05f XML-RPC: Re-add a global $wpdb missed in [38768].
See #37699.



git-svn-id: https://develop.svn.wordpress.org/trunk@38775 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 01:42:19 +00:00
Andrew Ozz
f239c71648 TinyMCE: add support for custom dashicon for wp.mce.View.setLoader().
Props procodewp.
Fixes #37900.

git-svn-id: https://develop.svn.wordpress.org/trunk@38774 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 00:55:22 +00:00
Andrew Ozz
7b3132214e TiinyMCE: update to 4.4.3, changelog: https://www.tinymce.com/docs/changelog/#version443-september12016
Fixes #38081, #38245, #37507, #37808 and #38000.

git-svn-id: https://develop.svn.wordpress.org/trunk@38773 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-11 00:09:03 +00:00
Andrew Ozz
af80e92ee1 Editor: do not send the request for releasing the post lock on unload when post_ID or active_post_lock is missing.
Props dlh, adamsilverstein.
Fixes #38271.

git-svn-id: https://develop.svn.wordpress.org/trunk@38772 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-10 22:41:26 +00:00
Rachel Baker
08b94111cb REST API: Remove reference to the plugin in infrastructure activation test.
Also adds class exists checks for WP_REST_Request and WP_REST_Response.

Props kraftbj.
Fixes #38279.

git-svn-id: https://develop.svn.wordpress.org/trunk@38771 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-10 21:48:02 +00:00
Andrea Fercia
907d67572a Accessibility: Improve the UI controls to move the Menu items.
On the Menus screen, the links to move menu items behave like buttons: they
perform an action so they should be real buttons to be correctly reported to
assistive technologies. Since they're logically grouped controls, they should
also be wrapped in a `<fieldset>` element for better semantics and accessibility.

Props Cheffheid.
Fixes #35578.


git-svn-id: https://develop.svn.wordpress.org/trunk@38770 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-10 16:23:23 +00:00
John Blackbourn
0842857b5c Role/Capability: Add tests for all user roles that check custom capabilities that do not have any form of handling (eg. in a map_meta_cap filter).
See #38191


git-svn-id: https://develop.svn.wordpress.org/trunk@38769 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-10 14:39:35 +00:00
Gary Pendergast
6774e27ae7 General: Restore usage of $wpdb, instead of $this->db.
Hiding the `$wpdb` global behind a property decreases the readability of the code, as well as causing irrelevant output when dumping an object.

Reverts [38275], [38278], [38279], [38280], [38387].
See #37699.



git-svn-id: https://develop.svn.wordpress.org/trunk@38768 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-10 06:37:02 +00:00
Weston Ruter
81ae08cf40 Customize: Show Pages section first and pre-expanded in list of available nav menu items.
Props ryankienstra, westonruter.
Fixes #36984.


git-svn-id: https://develop.svn.wordpress.org/trunk@38767 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 23:40:53 +00:00
Weston Ruter
03b8796cad Customize: Improve message displayed in widgets panel when there are no widget areas currently displayed in the preview.
Props karmatosed, westonruter.
Fixes #36922.


git-svn-id: https://develop.svn.wordpress.org/trunk@38766 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 21:08:34 +00:00
Weston Ruter
f4779221a3 Customize: Ensure customize_validate_{$setting->id} filters apply on input post values for WP_Customize_Setting subclasses that neglect to apply the filter themselves.
Fixes #37638.


git-svn-id: https://develop.svn.wordpress.org/trunk@38765 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 20:07:16 +00:00
Peter Wilson
2216b8ba37 Emoji: Update Emoji CDN filter default for resource hints.
Updates the default value for the filter `emoji_svg_url` used in `wp_resource_hints()` to match the default used for the filter in `_print_emoji_detection_script()`.

See [38717], #38724.


git-svn-id: https://develop.svn.wordpress.org/trunk@38764 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 04:23:43 +00:00
John Blackbourn
b4f01bb97f Build/Test Tools: Continue eliminating randomness in tests.
See [38762]
See #37371


git-svn-id: https://develop.svn.wordpress.org/trunk@38763 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 01:29:04 +00:00
John Blackbourn
c91be6f1fe Build/Test Tools: Begin eliminating unnecessary randomness in tests.
Although unlikely, clashes in randomly generated strings could cause unexpected failures. In addition, most randomness is entirely unnecessary, is bad practice, and increases test time (however small it may be).

See #37371


git-svn-id: https://develop.svn.wordpress.org/trunk@38762 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-09 01:11:14 +00:00
John Blackbourn
b45f2feada Build/Test Tools: Revert [38759]. PHPUnit's @requires syntax was introduced in PHPUnit 3.7, but the tests for PHP 5.2 use PHPUnit 3.6 because it's the latest version that supports PHP 5.2.
Fixes #38256


git-svn-id: https://develop.svn.wordpress.org/trunk@38761 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-08 22:42:12 +00:00
John Blackbourn
471103de31 Media: Correct the hostname used in the wp_get_attachment_metadata() test.
See #36246


git-svn-id: https://develop.svn.wordpress.org/trunk@38760 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-08 12:04:39 +00:00
John Blackbourn
b3d15125a6 Build/Test Tools: Make use of PHPUnit's @requires notation.
Fixes #38256


git-svn-id: https://develop.svn.wordpress.org/trunk@38759 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-08 01:19:11 +00:00
John Blackbourn
3fad194f64 HTTP API: Remove an unnecessary duplicate HTTP request in the HTTP tests.
See #30017


git-svn-id: https://develop.svn.wordpress.org/trunk@38758 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-08 01:02:40 +00:00
John Blackbourn
8f5999fe47 HTTP API: Convert the POST redirect test to use a dataProvider in order for its speed to be more accurately measured.
See #38237


git-svn-id: https://develop.svn.wordpress.org/trunk@38757 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-08 00:29:20 +00:00
Andrew Ozz
6cbf1eebf8 TinyMCE: Allow pasting in image captions. Remove blocks and insert <br> tags instead, also remove elements that would break the caption like other images, video, audio, etc.
See #36211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38756 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 21:41:00 +00:00
John Blackbourn
1271cbd258 Themes: Remove paged.php from the theme template hierarchy.
The position of this template within the hierarchy is of so little use that zero themes in the WordPress.org theme directory make use of it. It's second only to `index.php` in the hierarchy, meaning that any archive template such as `category.php` or `archive.php` will be chosen before it.

Fixes #38162
Props ryankienstra for initial patch


git-svn-id: https://develop.svn.wordpress.org/trunk@38755 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 21:02:39 +00:00
Dominik Schilling (ocean90)
8448857427 Menus: Hide controls in the search tab if no items are found.
Props sayedwp, afercia, tywayne, abrightclearweb.
Fixes #35576.

git-svn-id: https://develop.svn.wordpress.org/trunk@38754 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 20:55:25 +00:00
Dominik Schilling (ocean90)
70ae852c69 Taxonomy: On wp-admin/term.php, don't show a 'Back to' link which links to the current page.
Fixes #37573.

git-svn-id: https://develop.svn.wordpress.org/trunk@38753 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-07 20:12:35 +00:00