Commit Graph

35306 Commits

Author SHA1 Message Date
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
Andrea Fercia
7be45216c4 Accessibility: Handle focus when closing the media modal.
When closing the media modal, by default focus should be moved back to the UI
control that was clicked to open the modal. The only exception is when inserting
images into the Visual or Text editor.

Fixes #38142.


git-svn-id: https://develop.svn.wordpress.org/trunk@38652 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-25 21:32:10 +00:00
Boone Gorges
cf6f354fa8 Allow 'role' parameters to be passed to wp_dropdown_users().
`wp_dropdown_users()` contains a whitelist of function params that are
passed through to `get_users()`. `role`, `role__in`, and `role__not_in`
have now been added to this whitelist.

Props sillybean.
Fixes #38135.

git-svn-id: https://develop.svn.wordpress.org/trunk@38651 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-25 17:44:24 +00:00
Boone Gorges
cc807d5a91 Pass comment ID to get_page_of_comment filter.
Introduced in [34808].

Props zhildzik.
Fixes #38155.

git-svn-id: https://develop.svn.wordpress.org/trunk@38650 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-25 17:32:37 +00:00
Weston Ruter
b12ff9487d Customize: Opt to disable IE8 support via conditional comments instead of using unreliable Array.prototype.indexOf feature detection.
Deprecate/remove `WP_Customize_Manager::customize_preview_html5()` and remove `document.head` polyfill, both of which were only in place for IE8 support.

Props ryankienstra, westonruter.
Fixes #38021.


git-svn-id: https://develop.svn.wordpress.org/trunk@38649 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-25 04:34:34 +00:00
Weston Ruter
f3e8e7735d Customize: Re-architect and harden panel/section UI logic.
Removes contents for sections and panels from being logically nested (in the DOM) in order to eliminate many issues related to using `margin-top` hacks. The element containing the link to expand the content element for panels and sections is now a sibling element to its content element: the content is removed from being nested at initialization. The content element is now available in a `contentContainer` property whereas the head element (containing the link to open the construct) is in a `headContainer` property. The existing `container` property is now a jQuery collection that contains both of these elements. Since the head element is no longer in an ancestor element to the `content` element, the `aria-owns` property is now used to maintain the relationship between the `headContainer` and the `contentContainer`. These changes are also accompanied by an improvement to the animation performance for the sliding panes.

Props delawski, celloexpressions.
Fixes #34391.
Fixes #34344.
Fixes #35947.


git-svn-id: https://develop.svn.wordpress.org/trunk@38648 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-23 22:22:09 +00:00
Eric Andrew Lewis
c75fb5e9ca Allow custom bulk actions in admin list tables.
Bulk action filtering was introduced in 3.1, but only to remove default bulk actions, not add new ones.

Bulk actions can now be registered for all admin list table dropdowns via the `bulk_actions-{get_current_screen()->id}` filter. Handling custom bulk actions can be performed in the corresponding and newly introduced `handle_bulk_actions-${get_current_screen()->id}` filter.

Props scribu, flixos90, Veraxus.
See #16031.



git-svn-id: https://develop.svn.wordpress.org/trunk@38647 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-23 20:32:48 +00:00
Sergey Biryukov
8bc6917cc3 I18N: Add support for Serbian crossed D in remove_accents().
Props Krstarica for the report.
Fixes #38078.

git-svn-id: https://develop.svn.wordpress.org/trunk@38646 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-23 00:06:24 +00:00
Sergey Biryukov
1c2d321ed3 Docs: Add home and commentpaged as accepted values for user_trailingslashit filter.
Props sebastian.pisula.
Fixes #37734.

git-svn-id: https://develop.svn.wordpress.org/trunk@38645 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-22 22:53:01 +00:00
Sergey Biryukov
42dfc674b7 Docs: Add documentation for wp-admin/js/inline-edit-tax.js.
Props atimmer, boblinthorst.
Fixes #37571.

git-svn-id: https://develop.svn.wordpress.org/trunk@38644 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-22 18:49:26 +00:00
Sergey Biryukov
b34a53e715 Docs: Add documentation for wp-admin/js/postbox.js.
Props atimmer, andizer.
Fixes #37365.

git-svn-id: https://develop.svn.wordpress.org/trunk@38643 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-22 18:46:34 +00:00
Andrea Fercia
0a23a8405d Accessibility: Fix the Customizer available menu items toggles focus for Safari and VoiceOver.
In rare circumstances, for example buttons with icons and no visible text,
`user-select: none;` may trigger a bug that happens only when using Safari and
VoiceOver and doesn't allow focusable elements to receive focus correctly.
Worth reminding `user-select: none;` is a non-standard property and should be
used with care especially now that `::selection` is almost universally supported.

Fixes #37589.


git-svn-id: https://develop.svn.wordpress.org/trunk@38642 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-22 14:58:41 +00:00
Sergey Biryukov
c259123537 Docs: Correct @see entry for clean_url().
Props rabmalin.
Fixes #38126.

git-svn-id: https://develop.svn.wordpress.org/trunk@38641 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-22 09:39:15 +00:00
Andrea Fercia
e5fc724dd0 Accessibility: Add Themes Feature Filter form improvements.
- adds "Apply Filters" and "Clear" at the end of the form
- changes the "Feature Filter", "Apply Filters", "Clear", and "Edit" links in `<button>` elements
- removes a leftover from [27963]
- clarifies one button text and adds an `aria-label` attribute
- adds a `wp.a11y.speak()` message when clicking on "Apply Filters" and no features are selected

Fixes #38086.


git-svn-id: https://develop.svn.wordpress.org/trunk@38640 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-21 17:53:29 +00:00
ocean90
005a01da4a Comments: Revert [38298].
Instead use the correct comparison operator which was changed in [38297].

Fixes #37416.

git-svn-id: https://develop.svn.wordpress.org/trunk@38639 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-21 17:37:02 +00:00
Andrea Fercia
9bfbc3570b Administration: Fix the main background color for the Light color scheme.
Props trepmal.
Fixes #38004.


git-svn-id: https://develop.svn.wordpress.org/trunk@38638 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-21 17:35:42 +00:00
Sergey Biryukov
9ee1f662cb Editor: Improve post.js documentation.
Props jipmoors, boblinthorst.
Fixes #38118.

git-svn-id: https://develop.svn.wordpress.org/trunk@38637 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-21 08:56:28 +00:00
Jeremy Felt
2515aab673 Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38636 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 21:38:08 +00:00
Joe Hoyle
201f9d2864 Options: Build out register_setting like register_meta.
`register_setting` can now be passed an array arguments to specify meta-data about the setting,
much like using the `register_meta` API. Of note, it will now accept a `show_in_rest` arg to
hint the inclusion of the setting in the REST API. `get_registered_settings()` is available
as a utility to get all registered settings.

Props rmccue, aaroncampbell.
Fixes #37885.




git-svn-id: https://develop.svn.wordpress.org/trunk@38635 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 20:51:18 +00:00
Pascal Birchler
acb43ecc0b Toolbar: Add a 'View Posts' link to the toolbar when on the post listing screen.
This adds a new link to visit the post type archive if the post type supports it. Also introduces a new `view_items` label to `get_post_type_labels()`.

Props paulwilde, akibjorklund, swissspidy.
Fixes #34113.

git-svn-id: https://develop.svn.wordpress.org/trunk@38634 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 20:01:55 +00:00
Dominik Schilling (ocean90)
debaea8a7c Multisite: Show always domain and path when deleting a site.
Add a missing translators comment.

Props ian.edington.
Fixes #37309.

git-svn-id: https://develop.svn.wordpress.org/trunk@38633 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 19:54:26 +00:00
Jeremy Felt
576a4cba5e Multisite: Use get_networks() in get_main_network_id().
The manual query for the main network ID can now be replaced with a cached `get_networks()` query. This allows us to eliminate the `primary_network_id` cache key entirely.

Props spacedmonkey.
Fixes #37218.


git-svn-id: https://develop.svn.wordpress.org/trunk@38632 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 18:46:52 +00:00
jeremyfelt
e0ef4132fe Multisite: Provide $join as a possible SQL clause to the sites_clauses filter.
Previously, `compact()` provided a non existent `$join` and could cause confusion for anyone attempting to extend `WP_Site_Query` with their own tables. This aligns with the current behavior in `WP_Network_Query`.

Props johnjamesjacoby.
Fixes #37922.


git-svn-id: https://develop.svn.wordpress.org/trunk@38631 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 17:48:42 +00:00
Jeremy Felt
9bb6bd0f89 Multisite: Add annotations for extended WP_Site properties.
Props ryanplas.
Fixes #37932.


git-svn-id: https://develop.svn.wordpress.org/trunk@38630 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 17:21:03 +00:00
Sergey Biryukov
d9e0272707 Docs: Correct the description of {$taxonomy}_term_new_form_tag hook, making it more consistent with other *_form_tag hooks.
Props BjornW.
Fixes #38104.

git-svn-id: https://develop.svn.wordpress.org/trunk@38629 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 13:32:33 +00:00
Dominik Schilling (ocean90)
a679078121 Customize: Add wp-util as a dependency for customize-controls.
Fixes #38107.

git-svn-id: https://develop.svn.wordpress.org/trunk@38628 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 13:23:49 +00:00
Weston Ruter
3521b2f30f Customize: Remove IE8 access to customizer to discontinue support.
Uses feature detection for `Array.prototype.indexOf` since it is not implemented in IE8.

Props ryankienstra.
See #38021.


git-svn-id: https://develop.svn.wordpress.org/trunk@38627 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 04:01:58 +00:00