This removes usage of `each()` which is deprecated in PHP 7.2.
Props ayeshrajans
See #40109
Fixes #41525
Built from https://develop.svn.wordpress.org/trunk@41636
git-svn-id: https://core.svn.wordpress.org/trunk@41471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These two tests assume a certain level of indentation in code which does not conform to core's coding
standards and will hopefully be corrected at some point in #41057.
See #41057
Built from https://develop.svn.wordpress.org/trunk@41635
git-svn-id: https://core.svn.wordpress.org/trunk@41470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes #40673.
Built from https://develop.svn.wordpress.org/trunk@41634
git-svn-id: https://core.svn.wordpress.org/trunk@41469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes usage of `each()` and usage of text strings passed to `assert()`.
Props bor0
Fixes #41526
Built from https://develop.svn.wordpress.org/trunk@41633
git-svn-id: https://core.svn.wordpress.org/trunk@41468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The inline documentation for `wpdb::prepare()` was kind of confusing, and didn't describe some of the behaviour correctly.
Fixes #41983.
Built from https://develop.svn.wordpress.org/trunk@41632
git-svn-id: https://core.svn.wordpress.org/trunk@41467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If DB errors are shown during installation, the table prefix test will also show an error, even though we're deliberately trying to generate that error.
Fixes #40655.
Built from https://develop.svn.wordpress.org/trunk@41631
git-svn-id: https://core.svn.wordpress.org/trunk@41466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When switching between post editor modes, the current cursor position and selection is now preserved. This allows authors to switch modes without losing the context of where they were in the document.
Props biskobe.
Fixes #41962.
Built from https://develop.svn.wordpress.org/trunk@41630
git-svn-id: https://core.svn.wordpress.org/trunk@41465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
IPv4 addresses are scarce, overworked, and underpaid. They're ready to retire, but we just won't let them go. If you care about their wellbeing, switch to IPv6 today.
Props schlessera, birgire.
Fixes #41722.
Built from https://develop.svn.wordpress.org/trunk@41629
git-svn-id: https://core.svn.wordpress.org/trunk@41464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To bring Core into line with the changes to `$wpdb->prepare()` in WordPress 4.8.2, query placeholders shouldn't be quoted.
Props jrf, johnjamesjacoby.
Fixes #41983.
Built from https://develop.svn.wordpress.org/trunk@41628
git-svn-id: https://core.svn.wordpress.org/trunk@41463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`pre_cache_alloptions` is run before the alloptions array is inserted into the cache, and is valuable for sanity checking the options, particularly if your caching scheme has size limitations.
`alloptions` is run before returning the alloptions array, and is useful for when you have extra information that alloptions should return.
Props sebastian.pisula, keesiemeijer.
Fixes #33958.
Built from https://develop.svn.wordpress.org/trunk@41627
git-svn-id: https://core.svn.wordpress.org/trunk@41462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
Built from https://develop.svn.wordpress.org/trunk@41626
git-svn-id: https://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Switching the available roles and the current user's capabilities no longer happens in `switch_to_blog()` and `restore_current_blog()`, instead it has been moved to a new function `wp_switch_roles_and_user()` which is hooked into the site switching process. This allows to improve performance by temporarily unhooking the function when roles and capabilities do not need to be switched.
This change ensures that switching available roles now works closer to switching user capabilities, particularly the changes in [41624]. A new `WP_Roles::for_site( $site_id )` method has been introduced, and the `WP_Roles::_init()` method has been deprecated. It is furthermore possible to retrieve the site ID for which the available roles are currently initialized through a new `WP_Roles::get_site_id()`.
Props johnjamesjacoby, flixos90.
Fixes #38645.
Built from https://develop.svn.wordpress.org/trunk@41625
git-svn-id: https://core.svn.wordpress.org/trunk@41460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While it has always been possible to initialize a user's roles and capabilities for another site than the current one in a multisite, the actual roles available were not switched prior to this change, possibly causing invalid roles to show up or actually valid capabilities not being available.
In order to fix this bug in a clean way, relevant parts of the `WP_User` class have been refactored. The ID of the site for which capabilities are currently initialized are now stored in a private property `WP_User::$site_id`. The `WP_User::for_blog( $blog_id )` and `WP_User::_init_caps( $cap_key )` methods have been deprecated in favor of `WP_User::for_site( $site_id )`. In addition, a new method `WP_User::get_site_id()` has been introduced to retrieve the site ID for which the user's capabilities are currently initialized.
Props ryanduff, jeremyfelt, flixos90.
Fixes #36961.
Built from https://develop.svn.wordpress.org/trunk@41624
git-svn-id: https://core.svn.wordpress.org/trunk@41459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See #38741
Built from https://develop.svn.wordpress.org/trunk@41623
git-svn-id: https://core.svn.wordpress.org/trunk@41458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Given the new WordPress browsers support policy, the `screen-reader-text` css
class used in the admin can be updated to use modern CSS and correct syntax. See
https://github.com/wpaccessibility/a11ythemepatterns/blob/master/read-more-links/style.css
Worth noting the `clip` property is deprecated and kept for IE11 and Edge.
- uses `clip-path` for modern browsers
- keeps `clip` for old browsers and update its value to a correct syntax
- resets `clip-path` to `none` where the class is used to dynamically reveal elements
- removes an old rule that made `screen-reader-text` completely invisible in the help tabs `#screen-meta`
- standardizes the rule across CSS files
Fixes #40970.
Built from https://develop.svn.wordpress.org/trunk@41622
git-svn-id: https://core.svn.wordpress.org/trunk@41457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- uses button elements for the toggles
- uses `aria-expanded` on the toggles to communicate to assistive technologies the panels expanded/collapsed state
- adds the "circular focus" style to the toggles to give users a clear indication of the currently focused element
- standardizes CSS class names to `.toggle-indicator` and `.handlediv` as these names are already used across the admin for similar controls
Props monikarao, xavortm, mihai2u, Kopepasah.
Fixes #37013.
Built from https://develop.svn.wordpress.org/trunk@41621
git-svn-id: https://core.svn.wordpress.org/trunk@41456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See #42009
Built from https://develop.svn.wordpress.org/trunk@41620
git-svn-id: https://core.svn.wordpress.org/trunk@41455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See #40764.
Built from https://develop.svn.wordpress.org/trunk@41619
git-svn-id: https://core.svn.wordpress.org/trunk@41454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is used after updating a taxonomy term in the link to return to the term listing screen.
Props benoitchantre
Fixes #41898
Built from https://develop.svn.wordpress.org/trunk@41618
git-svn-id: https://core.svn.wordpress.org/trunk@41453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See #38181
Built from https://develop.svn.wordpress.org/trunk@41616
git-svn-id: https://core.svn.wordpress.org/trunk@41451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props spacedmonkey
See #38741
Built from https://develop.svn.wordpress.org/trunk@41614
git-svn-id: https://core.svn.wordpress.org/trunk@41449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Calling the `count_users()` function is expensive, regardless of the counting strategy that's used, and it gets
slower the more users there are on a site. In order to speed up the Users screen in the admin area, calling
`count_users()` can be avoided entirely while still displaying the total count for users.
This introduces some new functions:
* `wp_is_large_user_count()`
* `wp_get_active_user_count()`
* `wp_update_active_user_count()`
A corresponding `wp_is_large_user_count` filter is also introduced.
Props tharsheblows, johnbillion
Fixes #38741
Built from https://develop.svn.wordpress.org/trunk@41613
git-svn-id: https://core.svn.wordpress.org/trunk@41448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props imath.
Fixes #41407.
Built from https://develop.svn.wordpress.org/trunk@41612
git-svn-id: https://core.svn.wordpress.org/trunk@41447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props afragen.
Fixes #40764.
Built from https://develop.svn.wordpress.org/trunk@41611
git-svn-id: https://core.svn.wordpress.org/trunk@41446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props ocean90.
See #40820.
Built from https://develop.svn.wordpress.org/trunk@41610
git-svn-id: https://core.svn.wordpress.org/trunk@41445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props ocean90.
See #37430.
Built from https://develop.svn.wordpress.org/trunk@41609
git-svn-id: https://core.svn.wordpress.org/trunk@41444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This unifies the layout and wording of error messages on both the plugins screen and the themes screen.
Props tinkerbelly, juhise, Ankit K Gupta, m1tk00, swissspidy, mrahmadawais, danieltj.
Fixes #37430.
Built from https://develop.svn.wordpress.org/trunk@41608
git-svn-id: https://core.svn.wordpress.org/trunk@41443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props obenland.
See #40820.
Built from https://develop.svn.wordpress.org/trunk@41607
git-svn-id: https://core.svn.wordpress.org/trunk@41442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props bor0.
Fixes #40673.
Built from https://develop.svn.wordpress.org/trunk@41606
git-svn-id: https://core.svn.wordpress.org/trunk@41441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes #41996#40956
Built from https://develop.svn.wordpress.org/trunk@41604
git-svn-id: https://core.svn.wordpress.org/trunk@41439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Amends [41597].
See #39896.
Built from https://develop.svn.wordpress.org/trunk@41603
git-svn-id: https://core.svn.wordpress.org/trunk@41438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props davilera.
Fixes #40820.
Built from https://develop.svn.wordpress.org/trunk@41601
git-svn-id: https://core.svn.wordpress.org/trunk@41436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After [37798], this fixes embeds coming from a different site in the network.
Props imath.
Fixes #40673. See #36767.
Built from https://develop.svn.wordpress.org/trunk@41600
git-svn-id: https://core.svn.wordpress.org/trunk@41435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props swissspidy.
Fixes #41984.
Built from https://develop.svn.wordpress.org/trunk@41599
git-svn-id: https://core.svn.wordpress.org/trunk@41434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changes the highlighted tag buttons accordingly when selecting one of the commong permalink settings.
Deprecates `options_permalink_add_js()` as that JavaScript isn't added inline anymore.
Fixes #29872.
Built from https://develop.svn.wordpress.org/trunk@41598
git-svn-id: https://core.svn.wordpress.org/trunk@41433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Autosaved changes made on top of `auto-draft` changesets get written on top of the `auto-draft` itself, similar to how autosaves for posts will overwrite post drafts.
* Autosaved changes made to saved changesets (e.g. `draft`, `future`) will be placed into an autosave revision for that changeset and that user.
* Opening the Customizer will now prompt the user to restore their most recent auto-draft changeset; if notification is dismissed or ignored then the auto-draft will be marked as dismissed and will not be prompted to user in a notification again.
* Customizer will no longer automatically supply the `changeset_uuid` param in the `customize.php` URL when branching changesets are not active.
* If user closes Customizer explicitly via clicking on X link, then autosave auto-draft/autosave will be dismissed so as to not be prompted again.
* If there is a changeset already saved as a `draft` or `future` (UI is forthcoming) then this changeset will now be autoloaded for the user to keep making additional changes. This is the linear model for changesets.
* To restore the previous behavior of the Customizer where each session started a new changeset, regardless of whether or not there was an existing changeset saved, there is now a `customize_changeset_branching` hook which can be filtered to return `true`.
* `wp.customize.requestChangesetUpdate()` now supports a second with options including `autosave`, `title`, and `date`.
* The window `blur` event for `customize.php` has been replaced with a `visibilitychange` event to reduce autosave requests when clicking into preview window.
* Adds `autosaved` and `branching` args to `WP_Customize_Manager`.
* The `changeset_uuid` param for `WP_Customize_Manager` is extended to recognize a `false` value which causes the Customizer to defer identifying the UUID until `after_setup_theme` in the new `WP_Customize_Manager::establish_loaded_changeset()` method.
* A new `customize_autosaved` query parameter can now be supplied which is passed into the `autosaved` arg in `WP_Customize_Manager`; this option is an opt-in to source data from the autosave revision, allowing a user to restore autosaved changes.
Props westonruter, dlh, sayedwp, JoshuaWold, melchoyce.
See #39896.
Built from https://develop.svn.wordpress.org/trunk@41597
git-svn-id: https://core.svn.wordpress.org/trunk@41430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props stevenlinx.
Fixes #41619.
Built from https://develop.svn.wordpress.org/trunk@41596
git-svn-id: https://core.svn.wordpress.org/trunk@41429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improves color contrast and readability, and reuses a core design pattern.
Props kekkakokkers, monopine, Travel_girl, afercia, melchoyce, karmatosed.
Fixes #31604.
Built from https://develop.svn.wordpress.org/trunk@41595
git-svn-id: https://core.svn.wordpress.org/trunk@41428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Merges orphaned widgets into the inactive sidebar when switching themes.
Props bpayton.
See #39693.
Built from https://develop.svn.wordpress.org/trunk@41594
git-svn-id: https://core.svn.wordpress.org/trunk@41427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props xkon.
Fixes #41529.
Built from https://develop.svn.wordpress.org/trunk@41593
git-svn-id: https://core.svn.wordpress.org/trunk@41426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props xkon.
Fixes #40959.
Built from https://develop.svn.wordpress.org/trunk@41592
git-svn-id: https://core.svn.wordpress.org/trunk@41425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props ramiy.
Fixes #41667.
Built from https://develop.svn.wordpress.org/trunk@41591
git-svn-id: https://core.svn.wordpress.org/trunk@41424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Galleries are managed in the widget in the same way they are managed in the post editor, both using the media manager.
* Gallery widget is merged from the Core Media Widgets v0.2.0 feature plugin and it extends `WP_Widget_Media` in the same way as is done for image, audio, and video widgets.
* Model syncing logic is updated to support booleans and arrays (of integers).
* Placeholder areas in media widgets are now clickable shortcuts for selecting media.
* Image widget placeholder is updated to match gallery widget where clicking preview is shortcut for editing media.
Props westonruter, joemcgill, timmydcrawford, m1tk00, obenland, melchoyce.
See #32417.
Fixes #41914.
Built from https://develop.svn.wordpress.org/trunk@41590
git-svn-id: https://core.svn.wordpress.org/trunk@41423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props manchumahara.
Fixes #41924.
Built from https://develop.svn.wordpress.org/trunk@41589
git-svn-id: https://core.svn.wordpress.org/trunk@41422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Props ramiy.
Fixes #41643.
Built from https://develop.svn.wordpress.org/trunk@41588
git-svn-id: https://core.svn.wordpress.org/trunk@41421 1a063a9b-81f0-0310-95a4-ce76da25c4cd