Fixes bug where a PHP Warning is currently thrown if a client sends a request where `meta` is not an array value.
Merges [39436] onto 4.7 branch.
Props timmydcrawford, jnylen0, rachelbaker, pento.
Fixes#38989 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39437 602fd350-edb4-49c9-b593-d223f7449a82
When deleting a user through the WordPress admin, a specific decision is presented - whether to assign all of the user's posts to another user, or to delete all of the posts.
This change requires `reassign` as a parameter in the corresponding REST API endpoint, so that content isn't accidentally lost.
Merges [39426] to the 4.7 branch.
Props jeremyfelt.
Fixes#39000.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39427 602fd350-edb4-49c9-b593-d223f7449a82
This simplifies the line `$( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' );` to `$( siteNavContain ).toggleClass( 'toggled-on' );`, since `this` is the clicked button, so the extra context isn't needed.
Props afercia, laurelfulford.
Fixes#38992 for the 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39423 602fd350-edb4-49c9-b593-d223f7449a82
* Ensures dark color scheme has proper box shadow and hover/focus styles.
* Make sure links are correct width.
Props afercia, laurelfulford.
Fixes#38969 for the 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39422 602fd350-edb4-49c9-b593-d223f7449a82
Following [39413], this adds `.has-header-video` style definitions in
`/inc/custom-header.php` to support custom color schemes.
Props laurelfulford.
Fixes#38995 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39416 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that a standard header is shown on the front page whenever
a header video is set without a header image if the video doesn't load,
e.g., on mobile sizes or if the JS doesn't fire.
This adds a new class, `.has-header-video` that is added whenever the
`wp-custom-header-video-loaded` event is fired, which is then used to style
the custom headers along with `.has-header-image` whenever a header image
is available. This also changes the class name on the custom header media
wrapping `div` from `.custom-header-image` to `.custom-header-media`.
Props laurelfulford, joemcgill.
Fixes#38995 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39414 602fd350-edb4-49c9-b593-d223f7449a82
* Updates `wp_unique_post_slug()` to ignore `auto-draft` posts. Prevents publishing multiple posts that have the same slugs from starter content.
* Fixes fatal error when attempting to save an header_image setting from a non-admin context.
* Fixes substituting attachment symbols in options and theme mods.
* Fixes applying starter content for header images and background images.
Merges [39411] to 4.7 branch.
See #38114.
Fixes#38928 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39412 602fd350-edb4-49c9-b593-d223f7449a82
* Also moves checks from `customize_save` Ajax handler to the underlying `WP_Customize_Manager::save_changeset_post()` call which plugins may invoke directly.
* Ensures that `customize_save_response` filter is always passed an array, with error code available as `code`.
Props utkarshpatel, westonruter, sayedwp.
Merges [39409] into 4.7 branch.
See #30937.
Fixes#38943 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39410 602fd350-edb4-49c9-b593-d223f7449a82
Display different descriptions for multisite or single site installations.
Props johnbillion, ocean90.
Merges [39406] to the 4.7 branch.
Fixes#38990 for 4.7
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39407 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the top of the page had more space than the bottom, not matching the original design.
Props laurelfulford, melchoyce.
Merges [39404] onto the 4.7 branch.
Fixes#38972 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39405 602fd350-edb4-49c9-b593-d223f7449a82
Change the capability check used in `WP_REST_Terms_Controller` when creating a new term is attempted, from `manage_terms` to `edit_terms`. This matches the behavior within the WordPress admin. See #35614.
Props johnbillion, rmccue, rachelbaker, helen, jorbin, SergeyBiryukov.
Merges [39402] to the 4.7 branch.
Fixes#38958 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39403 602fd350-edb4-49c9-b593-d223f7449a82
In the `check_username()` and `check_password()` callbacks in the Users controller cast the provided request value to a string. The `rest_sanitize_value_from_schema()` function was being used incorrectly which was causing unintended request parsing.
In `rest_sanitize_request_arg()` do not pass nonexistent third parameter for the `rest_sanitize_value_from_schema()` function.
Props jnylen0, joehoyle, rachelbaker, ocean90.
Merges [39400] to the 4.7 branch.
Fixes#38984 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39401 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a regression in the media library after [38949], which caused
small images (< thumbnail size) to not display within the media library.
Accounts for images that have no intermediate sizes
in `wp_prepare_attachment_for_js()`.
Adds test.
Merges [39396] to the 4.7 branch.
Fixes#38965 for 4.7.
Props joemcgill, clorith, mikeschroder.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39399 602fd350-edb4-49c9-b593-d223f7449a82
* Show default labels for nav menu item as placeholders in a control's label field instead of showing blank.
* Store empty string as label instead of copying default labels.
* Prevent labels for post type archive items from being dropped in preview.
* Also ensure that the item type label is displayed on nav menu item controls for settings that are loaded from an existing changeset.
Amends [38618].
See #38015.
Fixes#38955 for 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39395 602fd350-edb4-49c9-b593-d223f7449a82
This allows the styles to work correctly when modified by high contrast computer setups.
Merge of [39388] to the 4.7 branch.
Props presskopp.
See #38939.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39389 602fd350-edb4-49c9-b593-d223f7449a82
This way screen reader users will know what to expect when they use this link.
Merge of [39384] to the 4.7 branch.
Props rianrietveld.
See #38970.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39385 602fd350-edb4-49c9-b593-d223f7449a82
This adds 1px of bottom padding to header videos to keep them from
extending past the footer at the bottom of the page.
Fixes#38950 for 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39381 602fd350-edb4-49c9-b593-d223f7449a82
The API should allow updates that don't actually change anything. This allows clients to, for example, accidentally send the same request twice without encountering unexpected errors. This currently works for posts, terms, and users, so this commit adds test cases accordingly.
See #38700 for issues preventing this from working for comments.
Merge of [39371] to the 4.7 branch.
Props jnylen0.
See #38975.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39372 602fd350-edb4-49c9-b593-d223f7449a82
Fixes typo in args passed to `get_term_link()` which caused a fatal error due to this call returning a `WP_Error` which was set to `url`. Also fixes never-satisfiable condition for obtaining post type archive URL. Also ensures that `WP_Error` never leaks through as `url` by setting it to an empty string. Adds missing unit tests.
Amends [38991].
See #38114.
Fixes#38945 for 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39366 602fd350-edb4-49c9-b593-d223f7449a82
By shrinkwraping our dependencies, the same versions of everything will be installed no matter what rules the dependency package.json has specified.
Fixes#38657.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39358 602fd350-edb4-49c9-b593-d223f7449a82
* Moves logic from `WP_Customize_Custom_CSS_Setting::update()` into a re-usable `wp_update_custom_css_post()` function, useful for future REST API endpoint, WP-CLI command, or plugin migrations.
* Renames `customize_update_custom_css_post_content_args` filter to `update_custom_css_data` and improves the naming of the parameters. Instead of passing `post_content` and `post_content_filtered` the filtered array now contains `css` and `preprocessed` respectively.
* The second context param for the `update_custom_css_data` filter is now an array of the original args passed to `wp_update_custom_css_post()` and there is now no more `$setting` arg since it isn't necessarily being called in the customizer context.
Props westonruter, georgestephanis.
See #35395.
Fixes#38672.
git-svn-id: https://develop.svn.wordpress.org/trunk@39350 602fd350-edb4-49c9-b593-d223f7449a82
Core requires the post password to view and create comments on password protected posts, so we must support a “password” param on the comments endpoint when fetch comments for a specific post and creating a comment on a password protected post.
Props flixos90, jnylen0.
Fixes#38692.
git-svn-id: https://develop.svn.wordpress.org/trunk@39349 602fd350-edb4-49c9-b593-d223f7449a82
Brings consistency to the `rest_insert_*` actions. Also includes some shuffling and clean-up as well including:
- Ensure we are passing the most current `$post` and `$user` objects to the `update_additional_fields_for_object()` callbacks.
- Changes the function signature of `handle_status_param()` in the Comments controller to accept just the comment_id as the 2nd parameter, instead of a full WP_Comment object. Only the comment_id is needed in the method, this avoids having to include another `get_comment()` call.
- Renames a variable in the `create_item()` method of the Posts controller from `$post` -> `$prepared_post` to be more explicit.
- Minor fixes/clarifications to the rest_insert_* hook docs
Props rachelbaker, joehoyle
Fixes#38905.
git-svn-id: https://develop.svn.wordpress.org/trunk@39348 602fd350-edb4-49c9-b593-d223f7449a82
This was originally added in 4.4, but presumably broke with [35708], which prevented these browsers from actually reaching the relevant code section.
Let's make embeds work again in IE 10 and IE 11.
Fixes#38694.
git-svn-id: https://develop.svn.wordpress.org/trunk@39347 602fd350-edb4-49c9-b593-d223f7449a82
Featured image support means that attachments can now be imported. Media can be sideloaded from within theme or plugin directories. Like other posts, attachments are auto-drafts until customizer changes are published, and are not duplicated when they already exist in the customized state. Attachment IDs can be used for any number of purposes, much like post IDs. Twenty Seventeen now includes 3 images used as featured images to best showcase the multi-section homepage setup.
As featured image IDs are stored in post meta, it also made sense to add support for page templates. Twenty Seventeen does not include any such templates, but the functionality can be quite important for displaying themes to their best effect.
props westonruter, helen, flixos90.
fixes#38615.
git-svn-id: https://develop.svn.wordpress.org/trunk@39346 602fd350-edb4-49c9-b593-d223f7449a82
* Adds missing `resolve`/`fail` for promise returned by `loadThemePreview`.
* Adds missing jsdoc blocks and tags.
* Adds missing phpdoc and makes corrections.
See #37770.
Fixes#38908.
git-svn-id: https://develop.svn.wordpress.org/trunk@39345 602fd350-edb4-49c9-b593-d223f7449a82
Sending a request to update a page with the template property set to an empty string resulted in an error because “” was not a valid value in the enum.
Props lucasstark, swissspidy.
Fixes#38877.
git-svn-id: https://develop.svn.wordpress.org/trunk@39343 602fd350-edb4-49c9-b593-d223f7449a82