WordPress' code just... wasn't.
This is now dealt with.
Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes#41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
This allows showing a name when only the first or last name is provided.
Props shital-patel, antipole.
Fixes#42713.
git-svn-id: https://develop.svn.wordpress.org/trunk@42256 602fd350-edb4-49c9-b593-d223f7449a82
This change means that only the leading portion of a locale code gets passed to MediaElement, removing problems that arise from locales such as `de_DE_formal` and `pt_PT_ao90`.
Props erich_k4wp, blobfolio, flixos90, ocean90, joemcgill, SergeyBiryukov.
Fixes#42574
git-svn-id: https://develop.svn.wordpress.org/trunk@42251 602fd350-edb4-49c9-b593-d223f7449a82
`rest_url()` inconsistent addes slashes to the passed path depending on whether the site has pretty permalinks enabled. Apart from being inconsistent, this also caused the unit tests to fail when pretty permalinks are enabled.
Props frank-klein.
Fixes#42452. See #41451.
git-svn-id: https://develop.svn.wordpress.org/trunk@42250 602fd350-edb4-49c9-b593-d223f7449a82
We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.
Disabling the `Squiz.Strings.ConcatenationSpacing.PaddingFound` rule for these blocks stops the extra whitespace from being removed.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42249 602fd350-edb4-49c9-b593-d223f7449a82
This fixes theme editing on Windows platforms where `validate_file()` will return `2` on a full file path.
Fixes#42609.
git-svn-id: https://develop.svn.wordpress.org/trunk@42244 602fd350-edb4-49c9-b593-d223f7449a82
While caching here seemed like a good idea in theory, in practice the cache would be often stale causing development issues.
We exclude common folders (such as `node_modules`) from the scanning to avoid directories which are not useful to the end-user, so as long as those exclusion lists are held up this shouldn't cause too much of a degredation in the future.
We may consider adding caching here again in the future if it's determined that it is really needed.
Props precies, ibenic, mariovalney, schlessera, and all the others who commented on the ticket(s).
This partually reverts [41806].
See #6531.
Fixes#42573.
git-svn-id: https://develop.svn.wordpress.org/trunk@42242 602fd350-edb4-49c9-b593-d223f7449a82
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
Using a filename which was generated from `time()` could cause two processes to try to use the same filename, causing unexpected behaviour.
Props jrchamp, bikecrazyy.
Fixes#42265.
git-svn-id: https://develop.svn.wordpress.org/trunk@42224 602fd350-edb4-49c9-b593-d223f7449a82
This corrects the value when the user's language is set to `English (United States)` but the site language is not.
Props ocean90, afercia
Fixes#42242
git-svn-id: https://develop.svn.wordpress.org/trunk@42220 602fd350-edb4-49c9-b593-d223f7449a82
When the setup process reads `wp-config-sample.php`, it assumes that there are no spaces inside the brackes of the `define()`s. Unfortunately, this doesn't match our coding standards, so will no longer work correctly once we start enforcing them.
This also improves coding standards of the generated `wp-config.php` file.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42218 602fd350-edb4-49c9-b593-d223f7449a82
This pattern occurs a handful of times across the codebase:
`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`
Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42217 602fd350-edb4-49c9-b593-d223f7449a82
The fix in [41821] caused numeric folder names to be reindexed to 0..n when in the root directory (for example, `my-plugin/24/`).
Props edo888.
See #41524.
Fixes#42628 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42214 602fd350-edb4-49c9-b593-d223f7449a82
The `meta_box_cb` argument was introduced in [25572] to allow plugin
authors to provide a custom callback for rendering their taxonomy's meta
box on the post edit screen. However, the routine used to handle the saving
of these custom taxonomy meta boxes was not customizable, but was instead
based simply on whether the taxonomy was hierarchicaly. See [13535].
The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
non-hierarchical taxonomies and the "category" routine for hierarchical ones,
thereby maintaining the current default behavior. Developers can override this
when the data passed from their `meta_box_cb` differs.
Props boonebgorges, ZaneMatthew, stephenharris.
Fixes#36514.
git-svn-id: https://develop.svn.wordpress.org/trunk@42211 602fd350-edb4-49c9-b593-d223f7449a82
When querying for 'count', ensure that 0 is returned. Otherwise,
ensure that it's an array.
Props xParham, birgire.
Fixes#42327.
git-svn-id: https://develop.svn.wordpress.org/trunk@42209 602fd350-edb4-49c9-b593-d223f7449a82
This brings the behaviour of the two functions in line with each other.
Props Drivingralle
Fixes 42108
git-svn-id: https://develop.svn.wordpress.org/trunk@42206 602fd350-edb4-49c9-b593-d223f7449a82
This allows defining the constant as `false` to prevent access (rather than requiring the constant to be removed entirely).
Props tiagohillebrandt, munklefish.
See #11717.
Fixes#42622.
git-svn-id: https://develop.svn.wordpress.org/trunk@42205 602fd350-edb4-49c9-b593-d223f7449a82
In IE11 the `input` event erroneously gets triggered initially without any user input.
Amends [41648].
See #37661.
Fixes#42556 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42187 602fd350-edb4-49c9-b593-d223f7449a82
Also prevent `[gallery]` shortcode from dumping out every attachment on the site when a containing Text widget is shown on an archive template.
Props westonruter, bobbingwide, joemcgill for testing.
See #10457.
Fixes#42548, #42547 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42185 602fd350-edb4-49c9-b593-d223f7449a82
Fixes an error since [41783] in which extra paragraphs could be added to content when switching editor tabs.
Props pento, adamsilverstein, aduth.
Fixes#42531.
git-svn-id: https://develop.svn.wordpress.org/trunk@42177 602fd350-edb4-49c9-b593-d223f7449a82
- When switching to the Text view, wait until after the Visual editor element has been hidden, before focussing the `<textarea>`.
- When switching to the Visual view, only scroll if the cursor is not visible on the current screen.
Fixes#42530.
git-svn-id: https://develop.svn.wordpress.org/trunk@42175 602fd350-edb4-49c9-b593-d223f7449a82
The `status` parameter accepts an array or string/comma-separated list.
Introduced in [30084].
Props pbiron.
Fixes#41338.
git-svn-id: https://develop.svn.wordpress.org/trunk@42165 602fd350-edb4-49c9-b593-d223f7449a82
This is a temporary solution while waiting for full I18N support in JS.
Props ocean90, dd32, westonruter, Mirucon for testing.
Amends [41376], [41721], [41389],
See #20491.
Fixes#42510 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42163 602fd350-edb4-49c9-b593-d223f7449a82
Also run CSS autoprefixer to add `-ms-` prefixes for CSS grid identifiers for IE11.
Props Presskopp.
Amends [42121].
See #42087.
Fixes#42524 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42161 602fd350-edb4-49c9-b593-d223f7449a82
Simplify regular expression for checking URL validity to just do basic checks to confirm the value looks like a URL. Leave the complete validation to the server-side logic in `WP_Customize_Nav_Menu_Item_Setting::sanitize()` to avoid having to maintain two separate codebases for validating URLs.
Props westonruter, SergeyBiryukov for testing.
Amends [41697].
See #32816.
Fixes#42506 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42153 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where a drafted/scheduled changeset could inadvertently re-use the previous autosave revision in the preview while a user expects it to have been dismissed.
See #39896, [41597].
Fixes#42502 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42144 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where user may supply an invalid URL and be unable to save the widget on the Widgets admin screen without being told why.
Amends [41252].
See #41274.
Fixes#42488.
git-svn-id: https://develop.svn.wordpress.org/trunk@42140 602fd350-edb4-49c9-b593-d223f7449a82
When just doing `wp_publish_post()` for the changeset from `customize.php`, any option-based settings will fail to get saved because `WP_Customize_Manager` would have already been loaded with `settings_previewed`, resulting in `update_option()` calls being short-circuited. So an admin-ajax request to `customize_save` is used to work around this.
Props westonruter, jeremyfelt, dlh for testing, LittleBigThing for testing.
Amends [41626].
See #28721, #39221.
Fixes#42457 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42138 602fd350-edb4-49c9-b593-d223f7449a82
The admin bar render methods use some cute tricks which don't come close to the WordPress coding standards. So that we can more easily apply automated code fixing to the codebase, these tricks need to be removed.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42128 602fd350-edb4-49c9-b593-d223f7449a82
Also fix PHP notice related to parent themes and WordPress.org theme query results.
Props dd32, obenland, celloexpressions, westonruter, atachibana for testing.
See #42406, #37661.
Fixes#42442.
git-svn-id: https://develop.svn.wordpress.org/trunk@42122 602fd350-edb4-49c9-b593-d223f7449a82
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` defaults to `AUTH_SALT`, but `hash_hmac()` will return an empty string if the key is empty.
This had the side effect of the string `{}` being incorrectly replaced with a `%` character in queries just about to be run on the database.
Props jsonfry.
Fixes#42431.
git-svn-id: https://develop.svn.wordpress.org/trunk@42120 602fd350-edb4-49c9-b593-d223f7449a82
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` falls back to `rand()` when `AUTH_SALT` is undefined. `hash_hmac()` requires the key to be a string, however, so we need to cast it as such.
Props mkomar.
Fixes#42401.
git-svn-id: https://develop.svn.wordpress.org/trunk@42119 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a bug where files couldn't be accessed in multisite installs.
Props flixos90, westonruter.
Fixes#42420.
git-svn-id: https://develop.svn.wordpress.org/trunk@42115 602fd350-edb4-49c9-b593-d223f7449a82
* Consider both `selectedChangesetStatus` and `changesetStatus` states when deciding to disable.
* Factor out common logic into `canSwitchTheme` function on `ThemesPanel`.
* Keep Live Preview and Install buttons disabled in Themes controls and detail overlays when appropriate.
Props westonruter, dlh.
Amends [41788].
See #42126, #37661, #39896.
Fixes#42406.
git-svn-id: https://develop.svn.wordpress.org/trunk@42113 602fd350-edb4-49c9-b593-d223f7449a82
Prevent edits to 2-level deep theme files from returning a `disallowed_theme_file` error when attempting to save an edit. Aligns logic for gathering `$allowed_files` in `theme-editor.php` for listing files with the validation logic in `wp_edit_theme_plugin_file()`.
Amends [41806].
See #6531.
Fixes#42425.
git-svn-id: https://develop.svn.wordpress.org/trunk@42112 602fd350-edb4-49c9-b593-d223f7449a82
Prevent user from having to re-enter the previously-supplied future date if they had switched from schedule to draft but wanted to switch back again. Improves parity with behavior of post edit screen.
Props dlh, westonruter, obenland.
See #39896, #28721.
Fixes#42413.
git-svn-id: https://develop.svn.wordpress.org/trunk@42109 602fd350-edb4-49c9-b593-d223f7449a82
* Also, updates POT files for Twenty Ten and Twenty Eleven.
Props lemacarl, maedahbatool, mrahmadawais, davidakennedy.
Fixes#42090.
git-svn-id: https://develop.svn.wordpress.org/trunk@42105 602fd350-edb4-49c9-b593-d223f7449a82
[41496] removed support for numbered placeholders in queries send through `wpdb::prepare()`, which, despite being undocumented, were quite commonly used.
This change restores support for numbered placeholders (as well as a subset of placeholder formatting), while also adding extra checks to ensure the correct number of arguments are being passed to `wpdb::prepare()`, given the number of placeholders.
See #41925.
git-svn-id: https://develop.svn.wordpress.org/trunk@42056 602fd350-edb4-49c9-b593-d223f7449a82
Prevent needlessly iterating over `controlConstructor` to find `type` when it is already supplied.
Amends [41750], [41726].
See #42083.
git-svn-id: https://develop.svn.wordpress.org/trunk@42048 602fd350-edb4-49c9-b593-d223f7449a82
Improve the logic determining which endpoints support the trash by enumerating them. Endpoints that don't support the trash require `force=true` when deleting. The previous approach relied on the `force` argument description, which is a translated string and was fragile. In the future, we can expose whether an endpoint supports the trash as part of its schema and automate this logic.
Props Soean.
Fixes#40672.
git-svn-id: https://develop.svn.wordpress.org/trunk@42047 602fd350-edb4-49c9-b593-d223f7449a82
Fixes UI bugs around theme updates in the Customizer. Theme versions now get updated and users are no longer left alone after a successful update.
Props rinkuyadav999, celloexpressions for initial patch.
Fixes#42365.
git-svn-id: https://develop.svn.wordpress.org/trunk@42046 602fd350-edb4-49c9-b593-d223f7449a82
In the original function introduced in [41380], and subsequently [41861], only the network ID was passed to the new `pre_get_main_site_id` filter. In order to make give quick access to other network properties, it was decided to pass the whole object instead. The changeset includes an additional test.
Fixes#29684.
git-svn-id: https://develop.svn.wordpress.org/trunk@42043 602fd350-edb4-49c9-b593-d223f7449a82
* Let min hour be 0 and max be 23 in 24-hour time; let min hour be 1 and max be 12 in 12-hour time.
* Show error notification when an invalid date value is provided, not just when not a future date.
* Fix translation of custom validity message.
* Start checking for validity after all inputs have been initially populated.
* Remove support for being able to enter 24:00.
* Cease forcing date input elements from being casted to integers, to allow for invalid inputs to be detected.
Props westonruter, Presskopp, peterwilsoncc, atachibana for testing.
See #39896, #28721.
Fixes#42373.
git-svn-id: https://develop.svn.wordpress.org/trunk@42042 602fd350-edb4-49c9-b593-d223f7449a82
* Passing `options.params` when constructing `Partial` is now deprecated in favor of just passing `options`.
* Improve usage of jsdoc in JS `Partial` class.
* Also add `defaults` property to `wp.customize.selectiveRefresh.Partial` class for parity with `Control`.
See #42083.
git-svn-id: https://develop.svn.wordpress.org/trunk@42037 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where JS-added Publish Settings section failed to get container element ID set properly to hide its section-meta.
Amends [42025].
See #42337, #42083.
git-svn-id: https://develop.svn.wordpress.org/trunk@42035 602fd350-edb4-49c9-b593-d223f7449a82
* Deprecate PHP classes `WP_Customize_New_Menu_Section` and `WP_Customize_New_Menu_Control`.
* Deprecate JS class `wp.customize.Menus.NewMenuControl`.
* Also introduce `wp.customize.Menus.createNavMenu()` for logic to create nav menus separately from the logic for handling UI interactions.
Amends [41768].
See #40104, #42364.
Fixes#42357.
git-svn-id: https://develop.svn.wordpress.org/trunk@42034 602fd350-edb4-49c9-b593-d223f7449a82
* Expand containing panel when expanding themes section.
* Consolidate UI changes related to a section's expanded state change.
* Prevent collapsing current section when expanding.
* Auto-expand first themes section when expanding panel if one is not expanded already.
See #37661, #42354.
Fixes#42360.
git-svn-id: https://develop.svn.wordpress.org/trunk@42033 602fd350-edb4-49c9-b593-d223f7449a82
* Eliminate Media control template from having dependency on `params.settings.default` for element ID, to fix compat with `params.settings` array or single `params.setting`. See #36167.
* Move description out of label and add `aria-describedby` to Media control's Select button. See #30738, #33085.
* Obtain notification container whenever content is (re-)rendered (such as for Media control). See #38794.
* Re-render notifications after control content is re-rendered, if control is in expanded section. See #38794.
Amends [41390].
See #36167, #38794, #33085, #30738.
git-svn-id: https://develop.svn.wordpress.org/trunk@42031 602fd350-edb4-49c9-b593-d223f7449a82
Start debouncing after initial search performed when `search` query param is present to prevent initial "flash of unsearched themes".
Props afercia, westonruter.
Amends [41797].
See #40254.
Fixes#42348.
git-svn-id: https://develop.svn.wordpress.org/trunk@42029 602fd350-edb4-49c9-b593-d223f7449a82
This removes deprecated notices in PHP 7.2 but takes a different approach to the upstream class from Horde, which appears to be buggy.
Props SergeyBiryukov
Fixes#41526
git-svn-id: https://develop.svn.wordpress.org/trunk@42028 602fd350-edb4-49c9-b593-d223f7449a82
The `publish_settings` section is a fundamental dependency for Customizer, so it must be guaranteed to be registered.
Also unconditionally register core types for panels, sections, and controls in case plugin unhooks all `customize_register` actions.
See #39896.
Fixes#42337.
git-svn-id: https://develop.svn.wordpress.org/trunk@42025 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue specifically with attempting to access an orphaned control's `elements` immediately after it has been added. Normally this would not happen because a control would not be registered without a section, and also a control should only be interacted with once its `embedded` deferred has been resolved.
Also harden logic for gathering list of deferred setting IDs.
See #37964.
Fixes#42330.
git-svn-id: https://develop.svn.wordpress.org/trunk@42024 602fd350-edb4-49c9-b593-d223f7449a82
Twenty Ten: Reduces image size and removes image borders for galleries in widget areas.
Twenty Eleven: Reduces image size and removes image borders for galleries in widget areas.
Twenty Twelve: Reduces image size for some gallery sizes in widget areas.
Twenty Thirteen: Ensure proper clearing for images, hide captions for some gallery column combos and ensure good display for galleries in widget areas.
Twenty Fourteen: Ensure proper clearing for images and hide captions for some gallery column combos for galleries in widget areas.
Twenty Seventeen: Hide captions for some gallery column combos for galleries in widget areas.
Props joyously, williampatton, davidakennedy, melchoyce, crunnells.
Fixes#41969.
git-svn-id: https://develop.svn.wordpress.org/trunk@42019 602fd350-edb4-49c9-b593-d223f7449a82
This now treats files containing `./` as valid, and also treats files containing a trailing `../` as valid due to widespread use of this pattern in theme and plugin zip files.
Adds tests.
Props Ipstenu, borgesbruno, DavidAnderson, philipjohn, birgire
Fixes#42016, #36170
git-svn-id: https://develop.svn.wordpress.org/trunk@42011 602fd350-edb4-49c9-b593-d223f7449a82
* Allow updating oEmbed cache during `parse-embed` requests for non-post editors (such as widgets).
* Update any existing `oembed_cache` post when `usecache` and TTL has passed.
* Do not overwrite a previously valid cache with `{{unknown}}`.
Props dlh.
See #34115.
Fixes#42310.
git-svn-id: https://develop.svn.wordpress.org/trunk@42009 602fd350-edb4-49c9-b593-d223f7449a82
Removes the box shadow on gallery links in footer widget areas so they're consistent with the sidebar widget area.
Props transl8or, sami.keijonen, davidakennedy.
Fixes#42302.
git-svn-id: https://develop.svn.wordpress.org/trunk@42004 602fd350-edb4-49c9-b593-d223f7449a82
Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.
Props celloexpressions.
See #37661, #42306.
git-svn-id: https://develop.svn.wordpress.org/trunk@42003 602fd350-edb4-49c9-b593-d223f7449a82
In r41727 the ability to sanitise and validate objects from JSON schema was added, with a whitelist approach. It was decided we should pass through all non-registered properties to reflect the behaviour of the root object in register_rest_route. To prevent arbitrary extra data via setting objects, we force additionalProperties to false in the settings endpoint.
See #38583.
git-svn-id: https://develop.svn.wordpress.org/trunk@42000 602fd350-edb4-49c9-b593-d223f7449a82
"Developers" excludes the various major contributors in non-developer roles, so let's update this term to be more inclusive.
See #41022.
git-svn-id: https://develop.svn.wordpress.org/trunk@41998 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a bug where menu assignements couldn't be changed when previewing a theme.
Also removes an unnecessary call to menu mapping after a theme switch from the customizer and makes sure the locations option is always written, for good measure.
Props westonruter.
See #39692.
git-svn-id: https://develop.svn.wordpress.org/trunk@41995 602fd350-edb4-49c9-b593-d223f7449a82
Explicitly define `gutters` in base `defaultSettings` to improve merges of multiple calls to `wp_enqueue_code_editor()`.
Props westonruter, georgestephanis for testing.
Amends [41974].
See #12423.
git-svn-id: https://develop.svn.wordpress.org/trunk@41992 602fd350-edb4-49c9-b593-d223f7449a82
Previously attempted in [40256], which caused the test for decoded curly quotes to fail in some environments.
`$_SERVER['REQUEST_URI']` contains the encoded URI, so this version removes the failing tests and only checks for encoded curly quotes.
Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes#20383.
git-svn-id: https://develop.svn.wordpress.org/trunk@41991 602fd350-edb4-49c9-b593-d223f7449a82
Fixes the issue with plugins not being able to use the `kses_allowed_protocols` filter if `esc_url()` was called too early.
Props turtlepod, SergeyBiryukov.
Fixes#36033.
git-svn-id: https://develop.svn.wordpress.org/trunk@41990 602fd350-edb4-49c9-b593-d223f7449a82
Adds checks throughout to allow for `wp_new_comment()` returning a `WP_Error` instance.
Updates the docs for the `pre_comment_approved` filter to include that it can be passed an error.
Props enrico.sorcinelli, ryotsun.
Fixes#39730.
git-svn-id: https://develop.svn.wordpress.org/trunk@41980 602fd350-edb4-49c9-b593-d223f7449a82
Also remove `enum` for validating allowed templates to allow plugins to dynamically supply their own templates for specific posts, even when they are not in the theme.
Props TimothyBlynJacobs, jnylen0, swissspidy.
Fixes#39996.
git-svn-id: https://develop.svn.wordpress.org/trunk@41979 602fd350-edb4-49c9-b593-d223f7449a82
Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.
Reverts [41931] [41900] [41896] [41895]
See #41316
git-svn-id: https://develop.svn.wordpress.org/trunk@41978 602fd350-edb4-49c9-b593-d223f7449a82
By moving the `wporg` conditional inside the method body, the filter drawer can be overridden without having to also override the entire section template.
Props celloexpressions.
Closes#42212.
git-svn-id: https://develop.svn.wordpress.org/trunk@41973 602fd350-edb4-49c9-b593-d223f7449a82
The customizer and the theme installer use `visibility: hidden` on the body when
they open full-overlays screens. The FTP credentials modal needs a visibility
property set back to `visible` to be visible over those overlays.
Props purnendu.
Fixes#42205.
git-svn-id: https://develop.svn.wordpress.org/trunk@41972 602fd350-edb4-49c9-b593-d223f7449a82
When media is uploaded to a post, the upload directory is set according to the date of the post, so that the media URLs in the post match when the post was published.
A page is a slightly different beast, pages often live for years, and are regularly updated to stay relevant. This change causes media uploaded to pages to use the upload date to determine the upload directory.
Fixes#10752.
git-svn-id: https://develop.svn.wordpress.org/trunk@41964 602fd350-edb4-49c9-b593-d223f7449a82
This filter allows the data being sent for core update checks to be controlled for privacy concerns.
Props toscho, MattyRob, swissspidy, pento.
Fixes#16778.
git-svn-id: https://develop.svn.wordpress.org/trunk@41962 602fd350-edb4-49c9-b593-d223f7449a82
Update the `CodeEditorControl`'s `codemirror` deferred to be set before calling the parent class's `initialize` method. Since the `ready` method may be called directly by `initialize` it may be too late to add a new `Deferred` to the control's `deferred` property after calling the base control class's `initialize`.
Amends [41958].
See #41897.
git-svn-id: https://develop.svn.wordpress.org/trunk@41960 602fd350-edb4-49c9-b593-d223f7449a82
CodeMirror gets initialized once the control's containing section is expanded. The deferred will be rejected if user preference for syntax highlighting is disabled.
Also move jsdoc from `wp.customize.Control` to intended `wp.customize.Control#initialize()`.
See #41897, #12423.
git-svn-id: https://develop.svn.wordpress.org/trunk@41958 602fd350-edb4-49c9-b593-d223f7449a82
Allow `CodeEditorControl` to be instantiated with a `editor_settings` param which is merged with `wp.codeEditor.defaultSettings`.
Also:
* Turn redundant "CSS Code" control label into screen reader text for Additional CSS.
* Remove `code-editor` as script dependency for `custom-html-widgets` since enqueueing is determined by `wp_enqueue_code_editor()`.
* Remove useless exporting of `code_type` param to JS in `WP_Customize_Code_Editor_Control`.
* Add `disabled` class to Custom HTML widget's Save button when linting errors are present.
* Remove redundant `span` inside CodeEditorControl's `label`.
See #41897, #12423, #41872.
git-svn-id: https://develop.svn.wordpress.org/trunk@41957 602fd350-edb4-49c9-b593-d223f7449a82
* Introduce a `widget_{$id_base}_instance_schema` filter for plugins to add new properties to a media widget's instance schema.
* Pass all of a gallery widget's instance props to the gallery media frame, not just the ones that core supports.
See #32417, #41914.
Fixes#42285.
git-svn-id: https://develop.svn.wordpress.org/trunk@41951 602fd350-edb4-49c9-b593-d223f7449a82
If one were to insert 1—3 dashes into a sentence - on purpose - they should use the correct da–
sh.
See #40794.
git-svn-id: https://develop.svn.wordpress.org/trunk@41946 602fd350-edb4-49c9-b593-d223f7449a82
Both functions can accept a `WP_Widget` instance object instead of a `WP_Widget` subclass name, same as `WP_Widget_Factory::register()` and `::unregister()`.
Props behzod.
Fixes#42270.
git-svn-id: https://develop.svn.wordpress.org/trunk@41942 602fd350-edb4-49c9-b593-d223f7449a82
This is a follow up on r41732, implementing the following improvements:
* Attachment parent info is now stored in attachment meta rather than a
separate post meta key.
* Attachments created from contextual crops (e.g. header, logos, etc.) are
filtered out of the media library using a new `_filterContext` method in
`wp.media.controller.Library`.
Props joemcgill, westonruter.
See #21819.
git-svn-id: https://develop.svn.wordpress.org/trunk@41937 602fd350-edb4-49c9-b593-d223f7449a82
* Only use default control content template when a more specific template doesn't exist.
* Remove extraneous whitespace from being output in `WP_Customize_Control::render()` method.
* Move Custom Header template printing to `customize_controls_print_footer_scripts` action.
See #30738.
git-svn-id: https://develop.svn.wordpress.org/trunk@41935 602fd350-edb4-49c9-b593-d223f7449a82
* Update deprecated `isHostedVideo` method to always return `true` since all oEmbeds are now supported.
* Disable `scanImage` for non-image media widgets.
* Ensure embed URL field element is matched from current media frame instance due to bug where media frames are not destroyed upon closing.
* Update error message for invalid video URLs to ask user to check the URL for validity.
Props gk.loveweb, octalmage, westonruter.
See #42039, #40935.
Fixes#41052.
git-svn-id: https://develop.svn.wordpress.org/trunk@41933 602fd350-edb4-49c9-b593-d223f7449a82
Adds more complete documentation to get_networks() and the corresponding methods in WP_Network_Query.
Fixes#42260.
git-svn-id: https://develop.svn.wordpress.org/trunk@41918 602fd350-edb4-49c9-b593-d223f7449a82
As of #34115 if there is no post context the oEmbed will be cached in an `oembed_cache` custom post type, so having a post as context is no longer a requirement for caching.
Props biskobe, westonruter.
See #34115, #40450.
Fixes#40854.
git-svn-id: https://develop.svn.wordpress.org/trunk@41913 602fd350-edb4-49c9-b593-d223f7449a82
Adds more complete documentation to `get_sites()` and the corresponding methods in `WP_Site_Query`.
Fixes#41789.
git-svn-id: https://develop.svn.wordpress.org/trunk@41912 602fd350-edb4-49c9-b593-d223f7449a82
Prevents the filter pane from blocking the view of theme search results when it's open.
Users are now able to just scroll to view results.
Props rclations.
Fixes#42212.
git-svn-id: https://develop.svn.wordpress.org/trunk@41903 602fd350-edb4-49c9-b593-d223f7449a82
Adds a link to the menu creation workflow from the locations selector in the nav menu control.
Props bpayton, westonruter, Travel_girl, melchoyce, celloexpressions.
Fixes#36279.
git-svn-id: https://develop.svn.wordpress.org/trunk@41899 602fd350-edb4-49c9-b593-d223f7449a82
To encourage more people to try Gutenberg, this new Dashboard box allows site users to easily install and try out Gutenberg.
Props pento, melchoyce, joen, karmatosed.
Fixes#41316.
git-svn-id: https://develop.svn.wordpress.org/trunk@41895 602fd350-edb4-49c9-b593-d223f7449a82
Corrects an issue where both the containing paragraph and embed had bottom margins, causing unwanted extra space.
Props westonruter.
Fixes#42118.
git-svn-id: https://develop.svn.wordpress.org/trunk@41888 602fd350-edb4-49c9-b593-d223f7449a82
* Update stubs to have draft status when changeset is saved as draft, instead of preventing auto-draft garbage collection by giving them a far-future `post_date`.
* Show notice in publish metabox when editing a customization draft indicating that it will be published automatically with its changeset; a link to Customizer is included.
* Include a new "Customization Draft" display post state in the post list table.
* Disconnect stubs from their changesets when they are updated with a status other than "Draft".
* Trash customization drafts when their related changeset is trashed or deleted.
* Add a `_customize_changeset_uuid` postmeta to stubs to link them with their associated changeset.
* Include `customize_changeset_uuid` as context when requesting to insert a new auto-draft.
Props westonruter, melchoyce.
See #39896, #39752, #34923.
Fixes#42220.
git-svn-id: https://develop.svn.wordpress.org/trunk@41887 602fd350-edb4-49c9-b593-d223f7449a82
The meta capabilities `install_languages` and `update_languages` rely on the admin function `wp_can_install_language_pack()`. That function in turn relies on `request_filesystem_credentials()`, so it needs to be ensured that this function is available as well.
Fixes#42230.
git-svn-id: https://develop.svn.wordpress.org/trunk@41885 602fd350-edb4-49c9-b593-d223f7449a82
In order for `get_site_by()` to be truly beneficial, caching in `WP_Site_Query` needs to be improved to account for common use-cases and have them be invalidated less aggressively.
See #40180, #40228, #42091.
git-svn-id: https://develop.svn.wordpress.org/trunk@41884 602fd350-edb4-49c9-b593-d223f7449a82
While `get_site_by()` makes sense as a more explicit and less complex replacement for `get_blog_details()`, it is not ready yet in terms of caching, where it currently falls short of the older function under specific circumstances.
See #40180, #40228.
git-svn-id: https://develop.svn.wordpress.org/trunk@41883 602fd350-edb4-49c9-b593-d223f7449a82
The warning displayed upon first visit on the File Editors introduced in [41774]
needs to be the only perceivable content in the page for users of assistive
technologies. It looks like a modal but it's not exactly an ARIA dialog, not an
ARIA alert either, and needs some special treatment.
- constrains tabbing within the modal
- uses `wp.a11y.speak()` to make screen readers announce the modal message
- hides all the other page content from assistive technologies using `aria-hidden="true"`
This way, even if users miss the speak message, the warning is actually the only
perceivable content in the page.
Fixes#42110.
git-svn-id: https://develop.svn.wordpress.org/trunk@41876 602fd350-edb4-49c9-b593-d223f7449a82
* Ensure that changes to captions are shown in preview when modified in media modal.
* Also keep `wp.customize.widgetsPreview.renderedWidgets` updated when widgets are added or removed.
See #41914, #37887, #40403.
Fixes#41979.
git-svn-id: https://develop.svn.wordpress.org/trunk@41872 602fd350-edb4-49c9-b593-d223f7449a82
Allows feature plugins, for example, to supply a `customize_changeset_title` param instead of having to wrap `wp.customize.previewer.query`.
Props dlh.
Fixes#42206.
git-svn-id: https://develop.svn.wordpress.org/trunk@41869 602fd350-edb4-49c9-b593-d223f7449a82
When the `WP_Network::$blog_id` property is set manually, for example in the multisite bootstrap process, `get_main_site_id()` should use that value instead of running its own logic. The main logic for the function was therefore moved into the internal `WP_Network::get_main_site_id()` method, which is now being accessed by the function through the magic property handling for `WP_Network::$blog_id` (and its equivalent `WP_Network::$site_id`).
Props spacedmonkey, jeremyfelt.
Fixes#41936.
git-svn-id: https://develop.svn.wordpress.org/trunk@41861 602fd350-edb4-49c9-b593-d223f7449a82
* Update date control padding.
* Collapse publish settings section when opening panes for available widgets or nav menus.
* Remove save and cog buttons in mobile preview only mode.
* Move definition of `wp.customize.previewedDevice` to `wp.customize.state('previewedDevice')` for centralization, maintaining old alias.
* Remove unused CSS because the section is inside form now.
Props sayedwp, westonruter.
See #39896.
Fixes#42027, #42199.
git-svn-id: https://develop.svn.wordpress.org/trunk@41860 602fd350-edb4-49c9-b593-d223f7449a82
Fix an issue where the escape key would no longer close the attachment details modal after attempting to navigate over the navigation boundaries (by clicking the left arrow key on the first media item or clicking the right arrow key on the last media item). Remove a focus blur which caused the underlying Backbone View to not receive the 'keydown' event.
Props subrataemfluence, afercia.
Fixes#42180.
git-svn-id: https://develop.svn.wordpress.org/trunk@41856 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the `get_pages()` query cache doesn't go stale when
postmeta is modified.
Props spacedmonkey.
Fixes#40669.
git-svn-id: https://develop.svn.wordpress.org/trunk@41849 602fd350-edb4-49c9-b593-d223f7449a82
Comment queries are sensitive to comment meta due to the `meta_query`
parameter, so the cache must be invalidated when comment meta is changed,
added, or deleted.
Props spacedmonkey.
See #40669.
git-svn-id: https://develop.svn.wordpress.org/trunk@41848 602fd350-edb4-49c9-b593-d223f7449a82
Previously, shortcodes were being counted when the `init` action fired, even though it's possible for shortcodes to be registered later than that.
By leaving the counting until just before the script is printed, we get a more accurate list of shortcodes.
Props ocean90.
Fixes#41917.
git-svn-id: https://develop.svn.wordpress.org/trunk@41844 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the (W) logo on the single site login screen linked to wordpress.org, with an appropriate `title` attribute, but the link text was the blog name.
To fix this discrepency, the link text is now the same as the `title` attribute.
Props pento, obrienlabs, afercia, flixos90, lukecavanagh, and the infinite stack of bikesheds that WordPress is balanced upon.
Fixes#34625.
git-svn-id: https://develop.svn.wordpress.org/trunk@41843 602fd350-edb4-49c9-b593-d223f7449a82
* Customization locking is checked when changesets are saved and when heartbeat ticks.
* Lock is lifted immediately upon a user closing the Customizer.
* Heartbeat is introduced into Customizer.
* Changes made to user after it was locked by another user are stored as an autosave revision for restoration.
* Lock notification displays link to preview the other user's changes on the frontend.
* A user loading a locked Customizer changeset will be presented with an option to take over.
* Autosave revisions attached to a published changeset are converted into auto-drafts so that they will be presented to users for restoration.
* Focus constraining is improved in overlay notifications.
* Escape key is stopped from propagating in overlay notifications, and it dismisses dismissible overlay notifications.
* Introduces `changesetLocked` state which is used to disable the Save button and suppress the AYS dialog when leaving the Customizer.
* Fixes bug where users could be presented with each other's autosave revisions.
Props sayedwp, westonruter, melchoyce.
See #31436, #31897, #39896.
Fixes#42024.
git-svn-id: https://develop.svn.wordpress.org/trunk@41839 602fd350-edb4-49c9-b593-d223f7449a82
On narrower devices, input fields are too short to fit the number of default digits they contain. This widens the fields and also breaks each height and width attribute onto a new line for better usability, using some terrible CSS trickery. My apologies.
Props: Toru, Presskopp, desrosj, xkon, ryelle, melchoyce.
Fixes#34539.
git-svn-id: https://develop.svn.wordpress.org/trunk@41836 602fd350-edb4-49c9-b593-d223f7449a82
Also fix issue with initial visibility of notice when there are no menus.
Amends [41823].
Props bpayton, melchoyce, westonruter.
See #42116.
Fixes#42113.
git-svn-id: https://develop.svn.wordpress.org/trunk@41832 602fd350-edb4-49c9-b593-d223f7449a82
Because "unlink" now appears contextually when editing a link, let's remove it from the toolbar.
Props azaozz, ahortin, swissspidy, afercia.
Fixes#36569.
git-svn-id: https://develop.svn.wordpress.org/trunk@41831 602fd350-edb4-49c9-b593-d223f7449a82
Fixes an issue where hovering over the warning icon didn't work if there were multiple warnings on the same line of code. Also updates the cursor from "pointer" to "help" when hovering over warnings and errors.
Props joyously, obenland.
Fixes#42129.
git-svn-id: https://develop.svn.wordpress.org/trunk@41830 602fd350-edb4-49c9-b593-d223f7449a82
This filter allows the Core editor to be replaced by an entirely different editor (coughcoughGUTENBERGcough).
Props azaozz, who is supposed to be on sabbatical right now.
Fixes#42119.
git-svn-id: https://develop.svn.wordpress.org/trunk@41829 602fd350-edb4-49c9-b593-d223f7449a82