Commit Graph

35239 Commits

Author SHA1 Message Date
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
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