Commit Graph

11317 Commits

Author SHA1 Message Date
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
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)
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
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
Joe McGill
c953f0aae0 Media: Align input and button heights in attachment details.
This tweaks the padding of the text inputs in image settings boxes on
image edit screens to match the height of the scale button.

Props eliorivero.
Fixes #37806.

git-svn-id: https://develop.svn.wordpress.org/trunk@38626 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 02:17:54 +00:00
Joe McGill
4da705a7db Media: Make media library searchable by filename.
This applies a new private function, `_filter_query_attachment_filenames()`,
to the `post_clauses` filter hook during `wp_ajax_query_attachments()` and
`wp_edit_attachments_query_vars()` to include `_wp_attached_file` post meta
in search queries performed from the media library or in a `WP_Media_List_Table`.

Props wonderboymusic, DrewAPicture, joemcgill, swissspidy.
Fixes #22744.

git-svn-id: https://develop.svn.wordpress.org/trunk@38625 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 01:44:07 +00:00
Weston Ruter
7079459b77 Customize: Let static_front_page section be contextually active based on whether there are any published pages.
If there are no pages when the customizer is opened, the `static_front_page` section will be hidden. As soon as a page is created in the customizer session, the `static_front_page` section will be revealed. Previously the section would not be registered if there were no pages. Page stubs created via nav menus will appear in the `dropdown-pages` controls for `page_for_posts` and `page_on_front`, and such page stubs will thus cause the `static_front_page` section to appear. Plugins that facilitate page creation in the customizer by filtering `get_pages` will also cause the section to appear.

See #34923.
Fixes #38013.


git-svn-id: https://develop.svn.wordpress.org/trunk@38624 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 00:46:54 +00:00
Sergey Biryukov
849c5de6d5 Docs: Correct two references to plugins in the $args parameter description for themes_api().
Props hideokamoto.
Fixes #37939.

git-svn-id: https://develop.svn.wordpress.org/trunk@38623 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-19 16:45:44 +00:00
Sergey Biryukov
b733c05fbc Docs: Correct a comment and @return entry in WP_Upgrader::create_lock().
Props markshep.
Fixes #38089.

git-svn-id: https://develop.svn.wordpress.org/trunk@38622 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-18 20:15:46 +00:00
Boone Gorges
acd49dc883 Pass taxonomy name to actions in term-relationship CRUD functions.
Props Takahashi_Fumiki.
Fixes #38006.

git-svn-id: https://develop.svn.wordpress.org/trunk@38621 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-18 18:52:56 +00:00
Sergey Biryukov
e7def1dae2 XML-RPC: Avoid a PHP notice in ::pingback_ping() if page title was not found.
Props RedSand.
Fixes #36727.

git-svn-id: https://develop.svn.wordpress.org/trunk@38620 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-18 14:25:13 +00:00
John Blackbourn
bc0a601889 Upgrade/Install: Automatically log users in after installation.
This change means that after entering their site's settings upon installation, users are immediately logged in and redirected to the admin dashboard, instead of being presented with the 'Success!' screen and then being asked to log in. This reduces friction and reduces the number of steps for installation.

Fixes #34084


git-svn-id: https://develop.svn.wordpress.org/trunk@38619 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-18 11:41:53 +00:00
Weston Ruter
87dc042623 Customize: Ensure nav menu items lacking a label use the title from the original object.
Use original title as placeholder for label and in control title. Prevent original title from overriding empty label in initial setting values.

Fixes #38015.


git-svn-id: https://develop.svn.wordpress.org/trunk@38618 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-17 21:49:49 +00:00
Andrea Fercia
998c06222f Plugins: style the primary action link in the non-js "Installing Plugin" page.
Props curdin, ericlewis, melchoyce, karmatosed.
Fixes #36430.


git-svn-id: https://develop.svn.wordpress.org/trunk@38617 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-17 16:22:03 +00:00
Andrea Fercia
aa021ff89f Accessibility: Standardize the remove/delete/cancel links in the Menus screen and Publish meta boxes.
The `submitdelete` CSS class is used in various places across the admin for some
"red" action links. It is worth simplifying this rule for further improvements
related to color contrast.

- simplifies a non-standard styling for the "Remove/Cancel" links in the Menus screen
- underlines all the "Move to trash/Delete" red links in all the Publish meta boxes
- fixes CSS classes usage for all the Publish meta boxes primary buttons
- fixes broken layout for the old Link Manager publish meta box

Props karmatosed, hugobaeta, monikarao, afercia.
Fixes #37969, #37018. See #37448, #37138, #27314.


git-svn-id: https://develop.svn.wordpress.org/trunk@38616 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-17 15:38:40 +00:00
Aaron D. Campbell
6eb3e0bf5f Media: Improved media titles when created from filename.
Preserves spaces and generally creates more accurate, cleaner titles from filenames of uploaded media.

Props joemcgill.
Fixes #37989.



git-svn-id: https://develop.svn.wordpress.org/trunk@38614 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-17 05:41:27 +00:00
Pascal Birchler
a803a33c04 Menus: Use strict comparison for the condition added in [38612].
See #37846.

git-svn-id: https://develop.svn.wordpress.org/trunk@38613 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-15 16:55:19 +00:00
Pascal Birchler
98e386c6f9 Menus: Remove 'sub item' label when removing the sub item's parent.
Props rnoakes3rd, adamsilverstein.
Fixes #37846.

git-svn-id: https://develop.svn.wordpress.org/trunk@38612 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-15 16:09:21 +00:00
Sergey Biryukov
784d45b279 I18N: Correct context for Next/Previous strings in get_the_posts_pagination().
Props FlorianBrinkmann.
Fixes #37952.

git-svn-id: https://develop.svn.wordpress.org/trunk@38611 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-15 09:19:11 +00:00
Sergey Biryukov
a82723c64e Docs: Use a third-person singular verb for register_post_type_args filter added in [34242].
See #37770.

git-svn-id: https://develop.svn.wordpress.org/trunk@38610 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:57:13 +00:00
Sergey Biryukov
2f9762b668 Docs: Use a third-person singular verb for {$type}_template_hierarchy filter added in [38385].
See #14310.

git-svn-id: https://develop.svn.wordpress.org/trunk@38609 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:53:47 +00:00
Sergey Biryukov
8a5002d424 Docs: Use a third-person singular verb for smilies filter added in [38504].
See #35905.

git-svn-id: https://develop.svn.wordpress.org/trunk@38608 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:52:24 +00:00
Sergey Biryukov
ba1188f111 Docs: Use a third-person singular verb for wp_doing_ajax filter added in [38334].
See #25669.

git-svn-id: https://develop.svn.wordpress.org/trunk@38607 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:50:10 +00:00
Sergey Biryukov
eea5f80861 Docs: Use a third-person singular verb in the DocBlock summary for get_theme_file_uri(), get_parent_theme_file_uri(), get_theme_file_path(), and get_parent_theme_file_path(), introduced in [38578].
See #18302.

git-svn-id: https://develop.svn.wordpress.org/trunk@38606 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:47:31 +00:00
Sergey Biryukov
ada795380b Docs: Use a third-person singular verb for theme_file_uri, parent_theme_file_uri, theme_file_path, and parent_theme_file_path filters added in [38578].
See #18302.

git-svn-id: https://develop.svn.wordpress.org/trunk@38605 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:44:28 +00:00
Sergey Biryukov
94c9edd8d4 Docs: Add a @since entry for the post_password_required filter introduced in [38603].
Use a third-person singular verb for the filter description.

See #38056.

git-svn-id: https://develop.svn.wordpress.org/trunk@38604 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:36:18 +00:00
Aaron Jorbin
5d1ca8e2d0 Posts: Add filter to allow overriding post_password_required return
Post Passwords are incredibly inflexible. One Password per site at a time and other limitations that can't really be changed without a backwards compatibility break.  This adds the ability for sites to change the password behavior such as doing per post passwords or allowing multiple passwords to be set in a browser. The possibilities are YUGE.

Additionally, it allows for a behavior other than returning a html form when a password is needed. This is important for non website use cases (such as in a restful API).

Fixes #38056. See #16483.
Props rmccue.



git-svn-id: https://develop.svn.wordpress.org/trunk@38603 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 21:27:16 +00:00
Helen Hou-Sandi
683f7bc4d3 Customizer: Better hover/focus state for section titles and available widgets.
The 4px border pattern is found in a number of places across the admin, including plugins, notices, and Press This.

props celloexpressions, folletto, hugobaeta.
see #29158.



git-svn-id: https://develop.svn.wordpress.org/trunk@38602 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 16:14:20 +00:00
Joe Hoyle
433b4fbfba REST API: Enable sanitize_callback to return WP_Error.
Give developers the opportunity to reject incoming data without using the validation callback. It also enables us to do sanitization and validation in one function in instances where this could be useful.

Props websupporter, rmccue.
Fixes #37560.


git-svn-id: https://develop.svn.wordpress.org/trunk@38601 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-14 15:49:37 +00:00
Sergey Biryukov
6f37c963de XML-RPC: Check the minimum number of arguments in ::wp_getUsersBlogs() and ::blogger_getUsersBlogs().
Props kitchin for initial patch.
Fixes #29750.

git-svn-id: https://develop.svn.wordpress.org/trunk@38600 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 23:16:15 +00:00
Konstantin Obenland
ddeab090e5 Make wpList easier to contribute to.
Uses more semantic variable names and adds function and inline documentation.

Props rommelxcastro for parallel work in #34917.
Fixes #36264.


git-svn-id: https://develop.svn.wordpress.org/trunk@38599 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 22:23:30 +00:00
Sergey Biryukov
ca8f1c024a Media: Remove an extra space in style attribute in wp_video_shortcode() after [30082].
Props danielpietrasik.
Fixes #38040.

git-svn-id: https://develop.svn.wordpress.org/trunk@38597 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 13:44:33 +00:00
Sergey Biryukov
8533eae95a Docs: Synchronize docblocks for WP_Site_Query::__construct() and get_sites() after the changes in [37735], [38008], [38103], and [38336].
Props MaximeCulea.
Fixes #38039.

git-svn-id: https://develop.svn.wordpress.org/trunk@38596 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 13:19:57 +00:00
Sergey Biryukov
90a332c3f2 Docs: Correct description for domain and path arguments in WP_Network_Query::__construct().
See #32504.

git-svn-id: https://develop.svn.wordpress.org/trunk@38595 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 13:09:52 +00:00
Gary Pendergast
2950eb8ea2 Formatting: Update autop() to match wpautop().
[38592] changed the behaviour of `wpautop()` , so it's nice to change `autop()` to match.

Interestingly, this change isn't necessary for the functionality to work - #4857 didn't affect content that had been run through `autop()` at some point, as `autop()` would add a single line break before block elements, then `wpautop()` would later add a second line break, making it work correctly.

Props nacin for finding out about [38592] on Twitter, and DMing me to remind me to review `autop()`.
See #4857.



git-svn-id: https://develop.svn.wordpress.org/trunk@38594 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 06:02:23 +00:00
Gary Pendergast
52c566f5dc Docs: Fix an outdated comment.
[38592] changed the functionality of `wpautop()`, but didn't update the associated comment to match.

Fixes #4857.



git-svn-id: https://develop.svn.wordpress.org/trunk@38593 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 04:00:31 +00:00
Gary Pendergast
61a95da031 Formatting: Add an extra line break before block elements in wpautop().
`wpautop()` considers double line breaks to be the separator between block level HTML elements. By adding two line breaks before a block element, this allows us to process the text before a block element correctly.

Fixes #4857.



git-svn-id: https://develop.svn.wordpress.org/trunk@38592 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-12 07:05:28 +00:00
Gary Pendergast
7511fe88cc Database: Normalise index names in dbDelta().
When comparing index definitions, normalise the index names to lower case, as they are not case sensitive within MySQL.

Fixes #34874.



git-svn-id: https://develop.svn.wordpress.org/trunk@38591 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-12 05:08:17 +00:00
Gary Pendergast
f54b5428c4 Database: Increase the size of wp_posts.post_password to 255 characters.
Longer passwords and passphrases are much more common than when post passwords were introduced all those eons ago, so let's increase the length of the `post_password` field from 20 to 255 characters.

The password will continue to be stored in plaintext, as the ability for the post author to view the password is a commonly used feature.

Trivia: this was the last 3 digit Trac ticket to be closed.

Props skippy, nazgul, iandunn, adamsilverstein, pento.
Fixes #881.



git-svn-id: https://develop.svn.wordpress.org/trunk@38590 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-12 02:27:55 +00:00
Gary Pendergast
0998de889d Bootstrap: Use dirname() when loading class-wp-hook.php from plugin.php.
To allow `plugin.php` to be loaded before the rest of WordPress is loaded, it cannot rely on WordPress constants, such as `ABSPATH` and `WPINC`.

Instead, we can assume that `class-wp-hook.php` will be in the same directory as `plugin.php`, so `dirname( __FILE__ )` will give us the correct path to load from.

Props pento, dd32.
Fixes #37707.



git-svn-id: https://develop.svn.wordpress.org/trunk@38589 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-12 01:49:46 +00:00
Weston Ruter
d21f8b8869 Docs: Fix phpdoc and jsdoc typos introduced in [38584] and [38587], respectively.
See #33742.
See #20714.


git-svn-id: https://develop.svn.wordpress.org/trunk@38588 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-11 18:45:59 +00:00
Weston Ruter
44dbc815c8 Customize: Implement previewing of form submissions which use the GET method.
This finally allows the search results template to navigated to in the customizer preview.

Fixes #20714.


git-svn-id: https://develop.svn.wordpress.org/trunk@38587 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-11 05:04:39 +00:00
Boone Gorges
37e983416b Query: Eliminate unnecessary wp_list_filter() call in get_queried_object().
The refactor in [30711] swapped out the old `queries` property for the
new `queried_terms`, but should also have gotten rid of the now-
superfluous `wp_list_filter()` call.

Fixes #37962.

git-svn-id: https://develop.svn.wordpress.org/trunk@38586 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-09 19:48:26 +00:00
Boone Gorges
6adcd15435 Query: Avoid PHP notice in get_queried_object() when query contains NOT EXISTS tax query.
Props johnjamesjacoby.
See #37962.

git-svn-id: https://develop.svn.wordpress.org/trunk@38585 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-09 19:36:22 +00:00
Weston Ruter
6c8c98fe5b Menus: Prevent non-published posts/pages from being returned in search results for adding as nav menu items.
Re-use the same query vars in searching as when listing posts. Aligns with behavior of nav menus in customizer.

Fixes #33742.
Props welcher, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@38584 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-09 04:59:01 +00:00
John Blackbourn
e7b058117a Themes: Add the non-encoded form of the queried item slug to the template hierarchy when the slug contains non-ASCII characters.
This affects category, tag, and custom taxonomy archives, and single posts, pages, and custom post types.

Fixes #37655


git-svn-id: https://develop.svn.wordpress.org/trunk@38583 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-09 00:47:17 +00:00
Gary Pendergast
bafd8c92f2 Database: Fall back to utf8 when utf8mb4 isn't supported.
Sometimes, `DB_CHARSET` will be set to `utf8mb4`, even if the current setup doesn't support `utf8mb4`. After [38442], this can cause significant character set failures, causing the connection to fall back to `latin1`.

Instead of doing this, we now check that the connection supports `utf8mb4` before trying to use it, and fall back to `utf8` when we need to.

Fixes #37982 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@38580 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 23:48:05 +00:00
John Blackbourn
d651c9c90e Taxonomy: Revert accidental changes introduced in [38578].
See #18302


git-svn-id: https://develop.svn.wordpress.org/trunk@38579 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 22:57:22 +00:00
John Blackbourn
2aef21a55b Themes: Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes.
The most useful function this introduces is `get_theme_file_uri()`, which returns the URL to the specified file in the child theme if it exists, and falls back to the URL to the specified file in the parent theme. This allows parent themes to reference files (including enqueuing CSS and JavaScript files) that can be overridden by the child theme simply by existing.

This change also introduces `get_theme_file_path()`, which is the file path equivalent of `get_theme_file_uri()`.

Finally, `get_parent_theme_file_uri()` and `get_parent_theme_file_path()` are also introduced, which allow a theme to specifically reference a file URL or file path in the parent theme. These can be used as replacements for `get_template_directory_uri()` and `get_template_directory()` respectively, for consistency.

Props johnbillion, georgestephanis, gma992.
Fixes #18302


git-svn-id: https://develop.svn.wordpress.org/trunk@38578 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 22:53:57 +00:00
Weston Ruter
8bae522ea8 Customize: Prevent widget previewing logic from building invalid jQuery selectors when sidebars are registered without a class name in before_widget.
Fixes #37993.


git-svn-id: https://develop.svn.wordpress.org/trunk@38577 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 15:44:08 +00:00
John Blackbourn
b875264a73 Formatting: Don't send an HTTP status code in wp_send_json() by default. This avoids clobbering an HTTP status code that may have been set prior to calling this function.
Props westonruter
See #35666


git-svn-id: https://develop.svn.wordpress.org/trunk@38576 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 13:44:32 +00:00
Peter Wilson
7ed5f4f9d5 Menus: Fix notices thrown by classes extending Walker_Nav_Menu.
Methods in `Walker_Nav_Menu` can be called with multiple, incompatible `$args` objects so an `insset()` check is required to avoid throwing notices.

Introduced in [38523].

Fixes #35206.


git-svn-id: https://develop.svn.wordpress.org/trunk@38575 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 07:05:32 +00:00
Peter Wilson
3cc19c17f3 Menus: Improve documentation of new $item_spacing argument.
Adds `@since` tags for and improves description of the new `$item_spacing` argument added to `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()` in [38523].

Props johnbillion for copy.
See #35206.


git-svn-id: https://develop.svn.wordpress.org/trunk@38574 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 05:30:32 +00:00
Drew Jaynes
45c799d84a Docs: Fix minor formatting for inline docs in WP_Hook following its introduction in [38571].
See #17817.


git-svn-id: https://develop.svn.wordpress.org/trunk@38573 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 04:16:39 +00:00
Aaron Jorbin
57530f4b73 Permalinks: Ensure Pending Review Posts permalink posts link to the draft
[34670] made the displayed permalink clickable. For posts that were pending review, the permalink wasn't being properly generated so the link wouldn't go to the preview.

Props knutsp, enshrined.
Fixes #37423.



git-svn-id: https://develop.svn.wordpress.org/trunk@38572 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 04:04:22 +00:00
Gary Pendergast
61abf68e6d Hooks: Add the new class WP_Hook, and modify hook handling to make use of it.
Filters and actions have been the basis of WordPress' plugin functionality since time immemorial, they've always been a reliable method for acting upon the current state of WordPress, and will continue to be so.

Over the years, however, edge cases have cropped up. Particularly when it comes to recursively executing hooks, or a hook adding and removing itself, the existing implementation struggled to keep up with more complex use cases.

And so, we introduce `WP_Hook`. By changing `$wp_filter` from an array of arrays, to an array of objects, we reduce the complexity of the hook handling code, as the processing code (see `::apply_filters()`) only needs to be aware of itself, rather than the state of all hooks. At the same time, we're able te handle more complex use cases, as the object can more easily keep track of its own state than an array ever could.

Props jbrinley for the original architecture and design of this patch.
Props SergeyBiryukov, cheeserolls, Denis-de-Bernardy, leewillis77, wonderboymusic, nacin, jorbin, DrewAPicture, ocean90, dougwollison, khag7, pento, noplanman and aaroncampbell for their testing, suggestions, contributions, patch maintenance, cajoling and patience as we got through this.
Fixes #17817.



git-svn-id: https://develop.svn.wordpress.org/trunk@38571 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 03:54:13 +00:00
John Blackbourn
84e8dcdf01 Menus: Correct the docblocks for Walker_Nav_Menu, wp_nav_menu(), and walk_nav_menu_tree().
This corrects the parameter type for the `$args` and `$item` parameters passed throughout these functions, class methods, and hooks.

See #24587
See #35206
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38559 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-07 16:14:49 +00:00
Jeremy Felt
8079863586 Media: Sanitize upload filename.
git-svn-id: https://develop.svn.wordpress.org/trunk@38538 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-07 13:54:57 +00:00
Andrea Fercia
2fc85993ca Widgets: Make the Delete/Remove links red.
For consistency and accessibility, all the UI controls that perform destructive
actions should be red.

Props monikarao, lukecavanagh, patilswapnilv, ibachal.
See #35622.
Fixes #37016.


git-svn-id: https://develop.svn.wordpress.org/trunk@38536 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-07 09:51:04 +00:00
Pascal Birchler
b87c245902 Upgrade/Install: Sanitize file name in File_Upload_Upgrader.
git-svn-id: https://develop.svn.wordpress.org/trunk@38524 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-06 17:25:22 +00:00
Peter Wilson
0c88ec217d Menus: Add white space option to wp_nav_menu() and wp_list_pages().
Adds an `item_spacing` option to the arguments array for the functions `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()`. `item_spacing` is a boolean accepting either `preserve` or `discard`.

Previously, certain CSS choices could result in a site's layout changing if `wp_nav_menu()` fell back to the default `wp_list_pages()` due to differences in the whitespace within the HTML. The new argument ensures a function outputs consistant HTML while maintaining backward compatibility.

Fixes #35206.


git-svn-id: https://develop.svn.wordpress.org/trunk@38523 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-06 09:05:45 +00:00
Andrea Fercia
02355cbdb5 Accessibility: Improve the Customizer and Theme Installer initial focus.
The Customizer and Theme Installer open in full overlays that need to receive 
focus. Also, keyboard navigation should be constrained within the overlays. Using
CSS `visibility` to hide all the content except the overlays, makes them the only
available and focusable content and allows browsers to handle focus natively.

See #29158.
Fixes #33228, #27705.


git-svn-id: https://develop.svn.wordpress.org/trunk@38520 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-04 21:50:22 +00:00
Sergey Biryukov
669ec7953e Script Loader: Correct default value for $src in wp_enqueue_script() and wp_enqueue_style().
Props Frank Klein for initial patch.
See #37770.

git-svn-id: https://develop.svn.wordpress.org/trunk@38519 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-04 04:08:11 +00:00