Commit Graph

36182 Commits

Author SHA1 Message Date
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
Ryan McCue 60b09f3005 Options: Add missing since for register_setting argument.
[38635] added support for extra arguments on registration, but was not documented.

See #37885.


git-svn-id: https://develop.svn.wordpress.org/trunk@38676 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-29 21:11:44 +00:00
Sergey Biryukov 84b67c9e6b Docs: Correct 'Since' version number for Cloudup in `oembed_providers` filter description.
Props jrf.
Fixes #38188.

git-svn-id: https://develop.svn.wordpress.org/trunk@38675 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-29 17:12:07 +00:00
Rachel Baker 93553e5e10 Comments: Introduce the `wp_update_comment_data` filter.
Filters the comment data immediately before it is updated in the database. 

Props frankiet, dshanske, DrewAPicture.
Fixes #36302.

git-svn-id: https://develop.svn.wordpress.org/trunk@38674 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-29 13:46:07 +00:00
Joe McGill 0d0e2bf2ba Media: Use `wp_basename()` to create attachment titles from filenames.
In [38294], `pathinfo()` was used with the `PATHINFO_BASENAME` constant to
get the basename of the file to be used as an attachment title, which depends
on PHP locale and can cause issues with UTF-8 characters. This uses
`wp_basename()` instead, which is a more i18n-friendly version of `basename()`.

Props SergeyBiryukov.
Fixes #37608, #37989.

git-svn-id: https://develop.svn.wordpress.org/trunk@38673 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-29 01:20:10 +00:00
Andrea Fercia ee7f970ffa Administration: Improve the usage of the button CSS classes.
Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 19:53:07 +00:00
Aaron Jorbin 02cf2a731f Pings/Trackbacks: Add filter argument to fetching of pingbacks_url in `X-pingback` header
It is possible to delegate pingback processing to a service function outside of WordPress itself. All other calls in default themes (and likely other themes) uses `bloginfo` which automatically adds the filter argument of "display".  This adds consistency.

Props dshanske.
Fixes #34633.



git-svn-id: https://develop.svn.wordpress.org/trunk@38671 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 19:27:25 +00:00
Pascal Birchler 9e028d2fd9 Docs: Improve parameter description for `wp_parse_args()`.
Props dimadin for initial patch.
Fixes #38167.

git-svn-id: https://develop.svn.wordpress.org/trunk@38670 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 08:40:24 +00:00
Boone Gorges b9e342c2f4 Set default value of 'max_depth' in `get_comment_reply_link()`.
Introduced in [8878].

Props d4z_c0nf.
Fixes #38170.

git-svn-id: https://develop.svn.wordpress.org/trunk@38669 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 04:19:46 +00:00
Weston Ruter c286c27747 Customize: Fix focusing on controls for widgets and nav menu items after [38648].
Shift-click on nav menu items was not expanding the nav menu section, and shift-clicking on widgets would not always result in focus being added to an element in the control's container.

See #34391.


git-svn-id: https://develop.svn.wordpress.org/trunk@38668 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 04:19:37 +00:00
Boone Gorges 81ecd4da98 Taxonomy: Use `WP_Term_Query` when querying for object terms.
The new 'object_ids' parameter for `WP_Term_Query` allows queries for
terms that "belong to" a given object. This change makes it possible
to use `WP_Term_Query` inside of `wp_get_object_terms()`, rather than
assembling a SQL query.

The refactor has a couple of benefits:
* Less redundancy.
* Better consistency in accepted arguments between the term query functions. See #31105.
* Less redundancy.
* Object term queries are now cached. The `get_object_term_cache()` cache remains, and will be a somewhat less fragile secondary cache in front of the query cache (which is subject to frequent invalidation).
* Less redundancy.

A small breaking change: Previously, if a non-hierarchical taxonomy had
terms that had a non-zero 'parent' (perhaps because of a direct SQL
query), `wp_get_object_terms()` would respect the 'parent' argument.
This is in contrast to `WP_Term_Query` and `get_terms()`, which have
always rejected 'parent' queries for non-hierarchical taxonomies. For
consistency, the behavior of `get_terms()` is being applied across the
board: passing 'parent' for a non-hierarchical taxonomy will result in
an empty result set (since the cached taxonomy hierarchy will be empty).

Props flixos90, boonebgorges.
See #37198.

git-svn-id: https://develop.svn.wordpress.org/trunk@38667 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 03:54:36 +00:00
Sergey Biryukov 36e22efdfd Text Changes: Unify two more permission error messages.
Props ramiy.
Fixes #38158. See #34521.

git-svn-id: https://develop.svn.wordpress.org/trunk@38666 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 00:16:44 +00:00
Sergey Biryukov 01e8552fd6 Text Changes: Unify two permission error messages in `wp-admin/network/site-users.php`.
Props ramiy.
Fixes #38178. See #34521.

git-svn-id: https://develop.svn.wordpress.org/trunk@38665 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 23:51:12 +00:00
Jeremy Felt b97b0b4203 Multisite: Use `get_home_url()` instead of `get_blogaddress_by_id()` in `wp-activate.php`.
`get_home_url()` is a better fit for the "View your site" link and can be properly filtered. This is the last remaining use of `get_blogaddress_by_id()` in core.

Props boboudreau, spacedmonkey.
Fixes #26855.


git-svn-id: https://develop.svn.wordpress.org/trunk@38664 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 21:35:25 +00:00
Dominik Schilling (ocean90) 736edc7c91 Toolbar: Split tests added in [38660] and add a multisite specific test.
See #37949.

git-svn-id: https://develop.svn.wordpress.org/trunk@38663 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 20:10:31 +00:00
Jeremy Felt 3387a838b5 Multsite: Flush output buffer after `readfile()` in `ms-files.php`.
Props fuscata, MikeLittle for testing, iamfriendly for testing.
Fixes #14730.


git-svn-id: https://develop.svn.wordpress.org/trunk@38662 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 20:05:00 +00:00
Dominik Schilling (ocean90) 2f4105d524 Toolbar: Don't run the test from [38660] for multisite.
See #37949.

git-svn-id: https://develop.svn.wordpress.org/trunk@38661 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 19:37:23 +00:00
Dominik Schilling (ocean90) 0bab64c370 Toolbar: Update links to the about page if current user can't access the dashboard of the current site.
Add missing focus styling for menu items with an icon.

Fixes #37949.

git-svn-id: https://develop.svn.wordpress.org/trunk@38660 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 19:00:35 +00:00
Jeremy Felt 8fcec07595 Multisite: Use `get_sites()` instead of a database lookup in `get_id_from_blogname()`.
Because queries generated via `get_sites()` are cached, we can remove the `get_id_from_blogname` cache key.

Props flixos90.
Fixes #38175.


git-svn-id: https://develop.svn.wordpress.org/trunk@38659 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 18:17:23 +00:00
Jeremy Felt 1f143d995b Multisite: Handle `get_id_from_blogname()` lookups when the network domain has `www.`.
Previously, if a network's domain started with `www.` in a subdomain configuration, a slug lookup with `get_id_from_blogname()` would not match an existing site. A similar lookup in a subdirectory configuration would work fine.

This strips `www.` from the network's domain in a subdomain configuration during the lookup and returns the site as expected.

Adds tests which would previously fail in a subdomain configuration, but now pass in both configurations.

Props igmoweb, flixos90.
Fixes #34450.


git-svn-id: https://develop.svn.wordpress.org/trunk@38658 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 17:56:53 +00:00
Jeremy Felt 61f014b9fc Multisite: Remove redundant `is_multisite()` checks in network admin templates.
`wp-admin/network/admin.php` is required by all of the individual network templates and begins with an `is_multisite()` check of its own. Because of this, we can remove the 26 other checks in the individual templates.

Props flixos90.
Fixes #37447.


git-svn-id: https://develop.svn.wordpress.org/trunk@38657 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 15:38:47 +00:00
Jeremy Felt 4799f61d23 Multisite: Replace `die()` with `wp_die()` in site users list table.
`wp_die()` is available and appropriate when checking capabilities while processing list table actions.

Props imath.
Fixes 38151.


git-svn-id: https://develop.svn.wordpress.org/trunk@38656 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 15:26:21 +00:00
Dominik Schilling (ocean90) a1e9fbfc14 Multisite: Allow to set the site language of a new site to English.
An empty string in `WPLANG` is used to define the site language as `en_US`. The `! empty()` check didn't catch this case so that `wpmu_create_blog()` fell back to the network setting.

Fixes #36918.

git-svn-id: https://develop.svn.wordpress.org/trunk@38655 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-26 18:38:32 +00:00
John Blackbourn fa48bfa1d2 Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available.
Fixes #35452


git-svn-id: https://develop.svn.wordpress.org/trunk@38654 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-26 17:01:48 +00:00
John Blackbourn 6d05c7db0d Administration: Remove the `input` qualifier for the `.regular-text` class rule. This allows for other elements such as textareas to be styled with the same width as regular text inputs.
Fixes #20928
Props curdin


git-svn-id: https://develop.svn.wordpress.org/trunk@38653 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-26 16:45:22 +00:00