Commit Graph

35306 Commits

Author SHA1 Message Date
Peter Wilson
3d2f8ba836 HTTP API: Simplify wp_parse_url() to ensure consistent results.
[38694] revealed some URL formats were been parsed incorrectly, including those used by Google Fonts. This change simplifies the function to use placeholder values which cause PHP's parsing to behave consistently.

Props jrf, peterwilsoncc.
Fixes #36356.


git-svn-id: https://develop.svn.wordpress.org/trunk@38726 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 20:32:40 +00:00
Andrea Fercia
5ba47b2119 Accessibility: Remove target=_blank from the help tab links on several admin screens.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38145. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38725 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 20:26:09 +00:00
Gary Pendergast
f881c4e646 Emoji: Update some failing unit tests.
The changes in [38717] weren't reflected in the associated unit tests.

See #38113.



git-svn-id: https://develop.svn.wordpress.org/trunk@38724 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 10:37:59 +00:00
Andrea Fercia
050d2d9a25 Accessibility: Remove target=_blank from the Users and Widgets screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38217. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38723 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 07:09:12 +00:00
Andrea Fercia
5cd9a575eb Accessibility: Remove target=_blank from the Plugins, Themes, Media, Update, and Tools screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38215. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38722 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 07:07:17 +00:00
Andrea Fercia
240b114fe8 Accessibility: Remove target=_blank from the Network screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38159. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38721 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 07:02:48 +00:00
Andrea Fercia
0c829777f2 Accessibility: Remove target=_blank from the Settings screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38143. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38720 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 06:58:36 +00:00
afercia
2c01dadd40 Accessibility: Remove target=_blank from the old custom background/header help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38141. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38719 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 06:56:02 +00:00
Andrea Fercia
65e01d5951 Accessibility: Remove target=_blank from the comment/edit-comments help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38140. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38718 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 06:53:20 +00:00
Gary Pendergast
2f4f5aac44 Emoji: Add support for the upcoming Emoji 4 release.
Emoji 4 adds 32 new professions, (with variations for gender and skin tone), and updates 33 existing character for male and female variations.

Fixes #38113 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@38717 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 03:23:22 +00:00
Boone Gorges
5a6cfb0bb7 Docs: Improve description for term_exists() $term param.
Props Kenshino.
Fixes #37224.

git-svn-id: https://develop.svn.wordpress.org/trunk@38716 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 02:28:48 +00:00
boonebgorges
3b6202a4d2 Query: Add nicename and login params to user query.
New parameters are: `login`, `login__in`, `login__not_in`, `nicename`,
`nicename__in`, `nicename__not_in`.

`login__in` and `nicename__in` are also now valid values for the
'orderby' parameter.

Props ryanplas.
Fixes #36624.

git-svn-id: https://develop.svn.wordpress.org/trunk@38715 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 02:26:26 +00:00
Sergey Biryukov
0a23c4d206 Unit Tests: Remove unused variable in Tests_oEmbed::dataShouldNotMatchOembedRegex().
Props jrf.
See #38187.

git-svn-id: https://develop.svn.wordpress.org/trunk@38714 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 00:50:09 +00:00
Gary Pendergast
7e4e9f1ce7 Shortcodes: Add a do_shortcode_tag filter.
The addition of the `pre_do_shortcode_tag` in [38506] allows plugins to short-circuit the shortcode execution process, which is particularly helpful for caching expensive shortcodes.

The `do_shortcode_tag` is the corresponding part of that system - when a shortcode hasn't been executed previously, there needs to be a clean method of populating the cache.

Props flixos90.
Fixes #32790.



git-svn-id: https://develop.svn.wordpress.org/trunk@38713 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 00:38:45 +00:00
Konstantin Obenland
e3becde640 Tests: Add newly introduced theme to theme list.
Introduced in [38710].

See #37924.



git-svn-id: https://develop.svn.wordpress.org/trunk@38712 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 18:44:19 +00:00
Konstantin Obenland
9cfa200891 wpLists: Pass the current element to process() to properly register event handlers.
Fixes a bug where new categories couldn't be added from the post edit screen.
Introduced in [38599].

Props dlh.
Fixes #38174.


git-svn-id: https://develop.svn.wordpress.org/trunk@38711 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 18:38:43 +00:00
Konstantin Obenland
ab087dadfc Themes: Account for uppercase chars when managing themes.
Fixes a bug where the UI wasn't updated after deleting/updating a theme.

Also introduces unit tests for theme management ajax handlers. For now they're
focused on `wp_ajax_update_theme()` but they can include tests for other
handlers as well.

Props chrisjean for initial patch.
Fixes #37924.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@38710 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 18:12:57 +00:00
Andrea Fercia
395823c9cd Customize: Improve the widgets and menu items search.
- adds a "search" icon into the search fields
- adds a hidden description for the widget search field, targeted by `aria-describedby`
- adds the "clear-results" button to the widgets search
- removes the `change` and `search` events bound on the widget search, for these "live searches" WordPress should standardize on `input` (+ `keyup` when needed)
- adds property and function to keep track and update the number of the widgets search results
- the widgets search results are now announced via `wp.a11y.speak()`
- adds a visible and audible message when there are no widgets search results
- moves some CSS to `customize-controls.css`

Props ryankienstra, melchoyce, afercia.
Fixes #36908.


git-svn-id: https://develop.svn.wordpress.org/trunk@38709 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 16:27:55 +00:00
Pascal Birchler
bcf50fedcd Toolbar: Be more strict about adding a 'View Posts' link to the toolbar.
After [38634], this adjusts the behaviour to remove redundancy by not displaying the link if the latest posts are shown on the front page. In that scenario, the 'Visit Site' link already points to the latest posts.

Fixes #34113.

git-svn-id: https://develop.svn.wordpress.org/trunk@38708 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 08:37:27 +00:00
Pascal Birchler
25f3c04a58 Editor: Improve documentation for user_can_richedit().
Clarifies the various global variables used in the function.

Props gma992.
Fixes #37321.

git-svn-id: https://develop.svn.wordpress.org/trunk@38707 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 07:54:14 +00:00
Pascal Birchler
7387321059 Plugins: Fix odd typo introduced in [38703].
`even` should of course be `event`.

See #37973.

git-svn-id: https://develop.svn.wordpress.org/trunk@38706 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 07:06:12 +00:00
Pascal Birchler
f231e7233d I18N: Introduce a user-specific language setting.
By enabling the user to select their preferred locale when editing the profile, we allow for greater personalization of the WordPress admin and therefore a better user experience.

The back end will be displayed in the user's individual locale while the locale used on the front end equals the one set for the whole site. If the user didn't specify a locale, the site's locale will be used as a fallback. The new `locale` property of the `WP_User` class can be used to retrieve the user's locale setting.

Props ocean90, ipm-frommen, swissspidy.
Fixes #29783.

git-svn-id: https://develop.svn.wordpress.org/trunk@38705 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 07:03:41 +00:00
Pascal Birchler
d3afcc4e33 Import: Fix plugin activation link after installing an importer on multisite.
When installing the importer via Ajax, the activation link should be the same as if the page were reloaded.

Props joelcj91 for initial patch.
Fixes #37943.

git-svn-id: https://develop.svn.wordpress.org/trunk@38704 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 06:41:37 +00:00
Pascal Birchler
fd5d2a65ad Plugins: Fix checkbox selection when searching for installed plugins.
Since the plugin search works via Ajax, the JavaScript events need to delegated in order for the checkboxes to work properly.

Props afercia.
Fixes #37973.

git-svn-id: https://develop.svn.wordpress.org/trunk@38703 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 06:36:19 +00:00
Weston Ruter
a39953e1e3 Menus: Restore checkboxes in post type search which were lost in [38584].
The `$args` variable was being overridden instead of extended, therefore causing the `walker` to be dropped.

Fixes #33742.


git-svn-id: https://develop.svn.wordpress.org/trunk@38702 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 02:34:46 +00:00
Sergey Biryukov
eef4795716 Docs: Correct default value for next_text in paginate_links().
Props truongwp.
Fixes #38212.

git-svn-id: https://develop.svn.wordpress.org/trunk@38701 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-02 19:09:32 +00:00
Andrea Fercia
9732c3ff44 Accessibility: Editor, Publish meta box: remove a stray label and redundant CSS.
Also, adds a `role="button"` attribute to the "Edit" links.

Props iseulde.
Fixes #28411.


git-svn-id: https://develop.svn.wordpress.org/trunk@38700 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-02 14:37:54 +00:00
Peter Wilson
fe0ba53c44 Meta: Improve ID casting when getting, updating or deleting meta data.
Blindly casting IDs to absolute integers in `get_metadata_by_mid()`, `update_metadata_by_mid()` and `delete_metadata_by_mid()` can cause unexpected behaviour when a floating or negative number is passed.

Fixes #37746.


git-svn-id: https://develop.svn.wordpress.org/trunk@38699 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-01 06:27:27 +00:00
John Blackbourn
17ef6d8cfa Taxonomy: Introduce more fine grained capabilities for managing taxonomy terms.
This introduces the singular `edit_term`, `delete_term`, and `assign_term` meta capabilities for terms, and switches the base capability name for tags from `manage_categories` to `manage_post_tags` and the corresponding `edit_post_tags`, `delete_post_tags`, and `assign_post_tags`.

All of these capabilities ultimately map to `manage_categories` so by default there is no change in the behaviour of the capabilities for categories, tags, or custom taxonomies. The `map_meta_cap` filter and the `capabilities` argument when registering a taxonomy now allow for control over editing, deleting, and assigning individual terms, as well as a separation of capabilities for tags from those of categories.

Fixes #35614
Props johnjamesjacoby for feedback


git-svn-id: https://develop.svn.wordpress.org/trunk@38698 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:39:32 +00:00
John Blackbourn
ad6ef7c110 Role/Capability: Introduce tests that assert the primitive and meta capability tests test the correct capabilities.
Fixes #38191


git-svn-id: https://develop.svn.wordpress.org/trunk@38697 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:11:47 +00:00
John Blackbourn
ec49d4d3d1 Role/Capability: Correct some meta capabilities that were incorrectly listed as primitive capabilities in the role and capability tests.
See #38191


git-svn-id: https://develop.svn.wordpress.org/trunk@38696 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:10:27 +00:00
John Blackbourn
e18c88ae19 Role/Capability: Add explicit cases to map_meta_cap() for various meta capabilities that are used in core. This will allow more complete meta and primitive capability unit tests in #38191.
Fixes #38201


git-svn-id: https://develop.svn.wordpress.org/trunk@38695 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:05:30 +00:00
John Blackbourn
e0f4a218fb HTTP API: Add a $component parameter to wp_parse_url() to give it parity with PHP's parse_url() function.
Fixes #36356
Props jrf


git-svn-id: https://develop.svn.wordpress.org/trunk@38694 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 21:46:43 +00:00
Dominik Schilling (ocean90)
41fc5ba881 Embeds: Add oEmbed support for User, List and Like Twitter timelines.
Props earnjam.
Fixes #38003.

git-svn-id: https://develop.svn.wordpress.org/trunk@38693 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 21:42:01 +00:00
Dominik Schilling (ocean90)
f603891a41 Embeds: Update the oEmbed provider test suite.
* Dailymotion: Use an URL for an existing video.
* Facebook: Remove URLs which don't exist and update provider map for [38691].

See #32360.

git-svn-id: https://develop.svn.wordpress.org/trunk@38692 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 21:01:36 +00:00
Dominik Schilling (ocean90)
22d4eb63b6 Embeds: Add support for embedding Facebook photos of a user/page.
See #34737.

git-svn-id: https://develop.svn.wordpress.org/trunk@38691 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 20:39:32 +00:00
Joe Hoyle
2da297eeaf Options: Add Unit tests for register_setting.
Test `register_setting` with old and new style of arguments.

Props rmccue.
Fixes #37885.


git-svn-id: https://develop.svn.wordpress.org/trunk@38690 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 20:23:33 +00:00
Joe Hoyle
4c6d7c8498 REST API: Add filters to allow creating REST API middleware plugins.
Introduce two new filters: `rest_request_before_callbacks` and `rest_request_after_callbacks` to
assist REST API middleware plugins to perform pre-callback and cleanup hooks such as `switch_to_blog()`
or caching implementations.

Props jnylen0.
Fixes #35590.


git-svn-id: https://develop.svn.wordpress.org/trunk@38689 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 20:11:10 +00:00
Aaron Jorbin
8c3dd28ec7 Build/Test: Bump Autoprefixer to 6.5.0
Also includes a new prefixed value.

Changes:
6.5 “Einigkeit und Recht und Freiheit”
- Add defaults keyword to browsers requirements.
- Fix CSS Grid Layout support.
- Fix align-self cleaning.

6.4.1
- Fix node cloning after some PostCSS plugins.

6.4 “Hic et ubique terrarum”
- Add :any-link selector support.
- Add text-decoration-skip support.
- Add transition: duration property support.
- Fix -webkit- prefix for backface-visibility.
- Fix rad unit support in gradients (by 刘祺).
- Fix transition support in Opera 12.
- Removed Safari TP Grid prefixes support.

6.3.7
- Fix rare Cannot read property 'constructor' of null issue.

6.3.6
- Add Safari TP prefix support for Grid Layout.

6.3.5
- Fix duplicate prefixes for -ms-interpolation-mode.

6.3.4
- Show users coverage for selected browsers in info().

28.0
- Happy Birthday @nacin

See #38199




git-svn-id: https://develop.svn.wordpress.org/trunk@38688 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 17:33:57 +00:00
Ryan McCue
a4ac1123f8 Options: Move register_setting() from wp-admin to wp-includes.
With [38635], register_setting is now a more generic setting registration function and is usable outside of the admin.

See #37885.


git-svn-id: https://develop.svn.wordpress.org/trunk@38687 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 15:52:01 +00:00
Dominik Schilling (ocean90)
a245ff9c54 Add 'urn' to the list of URI protocols whitelisted by default.
Props geekysoft, jorbin.
Fixes #37300.

git-svn-id: https://develop.svn.wordpress.org/trunk@38686 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 13:14:54 +00:00
Dominik Schilling (ocean90)
5273c469d8 Add test for each whitelisted URI protocol in wp_allowed_protocols().
Move test from [25301] to the new file.

Fixes #38198.

git-svn-id: https://develop.svn.wordpress.org/trunk@38685 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 13:12:00 +00:00
Sergey Biryukov
335cb0223f Embeds: Escape periods in oEmbed regex.
Props jrf.
Fixes #38187.

git-svn-id: https://develop.svn.wordpress.org/trunk@38684 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 11:24:08 +00:00
Jeremy Felt
2a3ffbf498 Admin Bar: Remove unused ID ab-awaiting-mod from comment count.
This selector has been unused since [19516]. The (now) more appropriate `.awaiting-mod` is used instead.

Props Presskopp.
Fixes #37901.


git-svn-id: https://develop.svn.wordpress.org/trunk@38683 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 05:01:02 +00:00
Jeremy Felt
f484c20bc1 Multisite: Use get_sites() in get_blogs_of_user().
Previously, we looped through all of the site IDs found via user meta and ran `get_blog_details()` for each site. Now, we can pass all of the site IDs at once to `get_sites()` and receive full `WP_Site` objects.

To avoid possible issues with return type, sites are still processed into a standard object that also has a `userblog_id` property attached. Nothing is changed for non-multisite configurations.

Props flixos90.
Fixes #37061.


git-svn-id: https://develop.svn.wordpress.org/trunk@38682 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 04:34:18 +00:00
Jeremy Felt
824a10a8a6 Multisite: Ensure a consistent WP_Site return from get_site_by_path().
It is possible to short circuit `get_site_by_path()` using the `pre_get_site_by_path` filter. When this happens and a standard site object is provided, we can make sure it is upgraded to a proper `WP_Site` object before passing it on.

Props flixos90.
Fixes #37053.


git-svn-id: https://develop.svn.wordpress.org/trunk@38681 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 04:09:45 +00:00
Jeremy Felt
d5f0513164 Multisite: Use get_sites() in network upgrade.
Use `get_sites()` to generate the same query that was previously performed manually.

Props spacedmonkey, flixos90.
Fixes #37823.


git-svn-id: https://develop.svn.wordpress.org/trunk@38680 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 03:50:18 +00:00
Boone Gorges
8f30d56cdc Tests: Move get_the_excerpt() tests to their own file.
See #36934. Fixes #38196.


git-svn-id: https://develop.svn.wordpress.org/trunk@38679 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 03:23:05 +00:00
Boone Gorges
c4c80d3dd4 Tests: Reset post-related globals after each test.
Globals like `$pages` were leaking between tests, resulting in various
bits of weirdness.

Globals will kill WordPress. Globals are killing WordPress.

See #38196.

git-svn-id: https://develop.svn.wordpress.org/trunk@38678 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 03:15:36 +00:00
Dominik Schilling (ocean90)
907b5fc527 Taxonomy: Use WP_Term_Query in get_term_by().
`WP_Term_Query` already supports querying terms by 'slug', 'name', and 'term_taxonomy_id'. Its additional arguments allow us to generate nearly the same SQL queries as before.
This change has one yuge benefit: the term queries are now cached. 

Add tests to increase coverage of `get_term_by()`.

Props spacedmonkey, boonebgorges, johnjamesjacoby, pento, ocean90.
Fixes #21760.

git-svn-id: https://develop.svn.wordpress.org/trunk@38677 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-29 22:35:32 +00:00