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
`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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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
[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
`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
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
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
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