Commit Graph

35952 Commits

Author SHA1 Message Date
Mike Schroder fb1b875797 Media: Fix regression with display of small images in media library.
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
2016-12-01 00:28:00 +00:00
Helen Hou-Sandi 7054419f0f Twenty Seventeen: Make sure header text color is applied when color schemes are active.
Props laurelfulford, ocean90.

Merges [39397] to the 4.7 branch.
Fixes #38980 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39398 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 00:11:26 +00:00
Weston Ruter ac62809001 Customize: Fix handling of the nav menu item labels (titles) that match defaults (original titles) and fix the display of item type labels.
* 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
2016-11-30 23:41:50 +00:00
Helen Hou-Sandi 2124943c71 Twenty Seventeen: Make fixed navigation apply at correct height on front page, without header video or image
Props laurelfulford, littlebigthing.

Merges [39392] to the 4.7 branch.
Fixes #38927 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39394 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:38:54 +00:00
Dominik Schilling (ocean90) 8a3192234d Docs: Document the usage of the global `$wpdb` in `_filter_query_attachment_filenames()`.
Merge of [39390] to the 4.7 branch.

Props mt8.biz.
See #38973.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39391 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:20:33 +00:00
Dominik Schilling (ocean90) 3f120c78cb Twenty Seventeen: Provide a background color fallback for non-webkit browsers on input styles
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
2016-11-30 23:06:27 +00:00
Dominik Schilling (ocean90) b07efe6c1f Twenty Seventeen: Allow child themes to easily extend custom color patterns
By adding a filter, child themes can add additional selectors onto the custom color scheme CSS. Like so:

{{{
// Add child theme selectors for color schemes.
function dynamic_seventeen_custom_colors_css( $css, $hue, $saturation ) {
	$css .= '
	.colors-custom .content-menu > article:not(.has-post-thumbnail),
	.colors-custom .content-menu > section:not(.has-post-thumbnail) {
		border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
	}';
	return $css;
}
add_filter( 'twentyseventeen_custom_colors_css', 'dynamic_seventeen_custom_colors_css', 10, 3 );
}}}

Merge of [39386] to the 4.7 branch.

Props celloexpressions.
See #38949.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39387 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 22:56:08 +00:00
Dominik Schilling (ocean90) b0a9a79f86 Twenty Seventeen: Make screen reader text on scroll arrow more meaningful
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
2016-11-30 22:17:41 +00:00
Dominik Schilling (ocean90) 60e9d045e7 Options: Pass the `$passed_default` parameter to the `default_option_{$option}` filter in `add_option()`.
This was missed in [38910].

Merge of [39382] to the 4.7 branch.

Props joehoyle, lucasstark.
See #38176, #38930.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39383 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 21:31:38 +00:00
Joe McGill 859f180baf Twenty Seventeen: Keep header videos from extending past footer.
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
2016-11-30 20:58:01 +00:00
Weston Ruter 932b861ef9 Customize: Fix regression in ability to hide fields for advanced menu properties in nav menu item controls.
Props westonruter, celloexpressions.
See #34391.
Fixes #38952 for 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39379 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 18:02:31 +00:00
Weston Ruter a03f3dc4ee Customize: Fix regression in ability to create submenus for nav menus via drag and drop.
See #34391.
Fixes #38948 for 4.7 branch.
Props delawski, adamsilverstein.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39377 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 17:44:08 +00:00
Helen Hou-Sandi d9cf3680f3 Twenty Seventeen: Add textdomain for starter content attachment titles.
fixes #38981 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39374 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 05:48:52 +00:00
Gary Pendergast 99e5de9431 REST API: Add tests for empty or "no-op" updates.
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
2016-11-30 03:27:22 +00:00
Dion Hulse 356b9ebdc2 WP_Hook: Re-initialize any actions added directly to `$wp_filter` by `advanced-cache.php`.
Props dd32, ocean90.
Merges [39369] to the 4.7 branch.
Fixes #38929.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39370 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-29 05:38:16 +00:00
Andrew Nacin 8955cbe08a Build: Remove fsevents from npm-shrinkwrap.json
fsevents is macOS only, and npm-shrinkwrap tries to force it onto other architectures, causing build failures. Upstream: https://github.com/npm/npm/issues/2679.

fixes #38657 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39368 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-29 04:02:23 +00:00
Weston Ruter e534c73c34 Customize: Fix logic for previewing the URL for `nav_menu_item` settings for terms and post type archives.
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
2016-11-27 03:19:32 +00:00
Dominik Schilling (ocean90) aac2bd2b9a Build/Test Tools: Add npm-shrinkwrap.json to 4.7.
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
2016-11-24 21:43:07 +00:00
Helen Hou-Sandi 0b36d29a8e Branch 4.7.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39356 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 21:31:59 +00:00
Helen Hou-Sandi 055e85698b Post-4.7 RC1 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@39355 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 04:28:58 +00:00
Helen Hou-Sandi 70ce11bbfd WordPress 4.7 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@39354 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 04:02:24 +00:00
Joe Hoyle a1c2caa4e3 REST API: Special case the “standard” post format to always be allowed.
Fixes #38916.

git-svn-id: https://develop.svn.wordpress.org/trunk@39353 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 00:07:50 +00:00
joehoyle 7dc75c29f6 REST API: Allow unsetting a post’s password.
Props danielbachhuber, iseulde.
Fixes #38919.

git-svn-id: https://develop.svn.wordpress.org/trunk@39352 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 23:12:05 +00:00
Drew Jaynes 0587033b4a Docs: Add a missing changelog entry for the point where the `$tagnames` parameter was added to `get_shortcode_regex()`.
Props keesiemeijer.
Fixes #38914.


git-svn-id: https://develop.svn.wordpress.org/trunk@39351 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 17:34:10 +00:00
Weston Ruter 8bcbe1a35c Customize: Refactor logic for updating `custom_css` posts by introducing `wp_update_custom_css_post()` function and renaming update filter.
* 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
2016-11-23 17:33:21 +00:00
Joe Hoyle 5d7118d63e REST API: Add support for comments of password-protected posts.
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
2016-11-23 16:14:08 +00:00
Rachel Baker 24abde4e54 REST API: Always fire the `rest_insert_*` actions after the related object is updated or inserted.
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
2016-11-23 15:32:25 +00:00
Pascal Birchler ab087e8593 Embeds: Correctly remove security attribute from iframes in IE 10 and IE 11.
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
2016-11-23 13:37:12 +00:00
Helen Hou-Sandi f3a59f8632 Theme starter content: Add support for featured images and page templates.
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
2016-11-23 09:52:27 +00:00
Weston Ruter 9528abe32b Customize: Clean up docs and code style for customize changes in 4.7.
* 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
2016-11-23 06:04:23 +00:00
Joe Hoyle ed13670fde REST API: Make JS Client store schema in session storage.
Props adamsilverstein.
Fixes #38895.

git-svn-id: https://develop.svn.wordpress.org/trunk@39344 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 02:54:24 +00:00
Joe Hoyle e606bc36c1 REST API: Allow unsetting of page templates in update requests.
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
2016-11-23 02:46:42 +00:00
Joe Hoyle 2341473a5f REST API: Update “resource” strings to use the appropriate nouns.
Props ramiy.
Fixes #38811.

git-svn-id: https://develop.svn.wordpress.org/trunk@39342 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 02:42:00 +00:00
David A. Kennedy d6d843dccd Twenty Seventeen: Ensure edit button label displays properly in other languages
This bug occurred in any language where text wraps character-by-character, since those languages don't delimit words with spaces. In Japanese, Chinese and Korean, etc., it was possible for the label to be displayed vertically.

Props tg29359, afercia, odysseygate.

Fixes #38876.


git-svn-id: https://develop.svn.wordpress.org/trunk@39341 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 00:43:22 +00:00
Joe McGill 59db3d7e76 Twenty Seventeen: CSS coding standards fixes.
This makes a few adjustments to CSS to bring them inline with WordPress
CSS coding standards including:

* Font weights should be defined using numeric values
* Do not pad parentheses with spaces

This also fixes a couple of typos to inline comments.

Props netweb for initial patch.
Fixes #38901.

git-svn-id: https://develop.svn.wordpress.org/trunk@39340 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 20:46:04 +00:00
Helen Hou-Sandi bf4dd6a8cb Twenty Seventeen: Ensure galleries display correctly in IE11.
It appears IE11 needs an explicit width for an `inline-block` parent element.

props derrickkoo, afercia.
fixes #38872.


git-svn-id: https://develop.svn.wordpress.org/trunk@39339 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 15:50:25 +00:00
Peter Wilson e174fdf21b Themes: Prevent unneeded database updates in `wp_get_custom_css_post()`.
When a custom header image was set but custom CSS was not, `wp_get_custom_css_post()` was generating an UPDATE query on every frontend request.

In theme options the header image meta data is stored as an object. In `update_option()` this hits an edge case as the resource IDs of the old and new values never match.

This changes the logic of `wp_get_custom_css_post()` to ensure `set_theme_mod()` is only called when the custom CSS has changed.

Props bradyvercher, helen.
Fixes #38866.


git-svn-id: https://develop.svn.wordpress.org/trunk@39338 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 11:40:22 +00:00
Rachel Baker 6028062ade REST API: Set the comment `type` to a readonly property in the schema.
Document the type property as `readonly` and remove the default value. After #38820 it is no longer possible to set the type property on a comment to anything a custom type.

Props jnylen0, rachelbaker.
Fixes #38886.

git-svn-id: https://develop.svn.wordpress.org/trunk@39337 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 22:55:33 +00:00
Helen Hou-Sandi 21175d59a7 Plugin install: De-duplicate a conditional, introduced in [38172].
props ChrisWiegman.
fixes #38190.


git-svn-id: https://develop.svn.wordpress.org/trunk@39336 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 21:32:58 +00:00
Joe Hoyle a8a015c3c0 REST API: Update description strings to match already existing ones in the admin.
Props dimadin.
Fixes #38807.

git-svn-id: https://develop.svn.wordpress.org/trunk@39335 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 20:40:10 +00:00
azaozz 48192f196f TinyMCE: avoid calling `editor.focus()` on loading the content in the editor. It may trigger scroll-into-view in the browser. Call the quirks fix in TinyMCE directly.
Props gitlost.
Fixes #38511.

git-svn-id: https://develop.svn.wordpress.org/trunk@39334 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 20:14:01 +00:00
Weston Ruter ccf9b72446 Customize: Prevent selective refresh from causing infinite fallback refreshes when nav menu contains invalid items.
Invalid nav menu items are exported as settings in the customize controls since it `is_admin()`, but any such `nav_menu_item` settings are excluded from the preview since it's the frontend. Selective refresh for nav menus needs to ignore the syncing of any such `nav_menu_item` settings that are `_invalid` since they are never rendered, and when a nav menu only contains invalid items, an infinite fallback refresh can ensue.

Fixes #38890.


git-svn-id: https://develop.svn.wordpress.org/trunk@39333 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 19:15:05 +00:00
Weston Ruter f21e17dbf0 Customize: Remove iframe-specific behaviors from customize preview when previewing on frontend and not contained inside iframe.
* Strip out `customize_messenger_channel` from preview window URL when not contained in iframe.
* Allow interacting with unpreviewable links and forms when previewing customized state on frontend.

See #30937.
Fixes #38867.


git-svn-id: https://develop.svn.wordpress.org/trunk@39332 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:55:20 +00:00
Dominik Schilling (ocean90) 257026f7a3 I18N: In `wp_dropdown_languages()` rename the new `show_site_locale_default` argument to `show_option_site_default`.
This makes it consistent with arguments of other `wp_dropdown_*()` functions.

Props SergeyBiryukov.
See #38632.
Fixes #38871.

git-svn-id: https://develop.svn.wordpress.org/trunk@39331 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:14:01 +00:00
Dominik Schilling (ocean90) e2f67203bb I18N: Add an additional caching layer for `_load_textdomain_just_in_time()`.
Previously, if no translation files exist for a text domain, `_load_textdomain_just_in_time()` went through the entire process each time it was called. This results in an increased call to `get_locale()` and its `locale` filter.
This change splits the logic into `_get_path_to_translation()` and `_get_path_to_translation_from_lang_dir()`. The former, which is used by `_load_textdomain_just_in_time()`, caches the result of the latter. It also removes some non-working code from `WP_Locale_Switcher::load_translations()`.

Props jrf, swissspidy, sharkomatic, ocean90.
Fixes #37997.

git-svn-id: https://develop.svn.wordpress.org/trunk@39330 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:06:38 +00:00
Ryan McCue 0cbea5855e REST API: Trim trailing slashes from routes.
WordPress' rewrites do this usually, but the behaviour was inconsistent when using non-pretty permalinks.

Props joehoyle.
Fixes #38873.


git-svn-id: https://develop.svn.wordpress.org/trunk@39329 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:45:31 +00:00
Ryan McCue 096f23db65 REST API: Correctly map meta keys to field names.
This accidentally assumed $name was the same as $meta_key, which ruined the whole point of $name.

Props tharsheblows, joehoyle.
Fixes #38786.


git-svn-id: https://develop.svn.wordpress.org/trunk@39328 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:40:46 +00:00
Ryan McCue 4b275bf861 REST API: Disable anonymous commenting by default.
Adding a brand new anonymous comment method is a potential conduit for spam. Since it's still useful functionality, we're now hiding it behind a filter to allow plugins and themes to turn it on if they do want it.

Props helen, rachelbaker, joehoyle.
Fixes #38855.


git-svn-id: https://develop.svn.wordpress.org/trunk@39327 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:31:07 +00:00
John Blackbourn 347040745d I18n: Introduce more translator comments for strings that contain placeholders but don't have an accompanying translator comment.
See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39326 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 02:45:53 +00:00
Sergey Biryukov 7faf699c69 I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.
Props ramiy, SergeyBiryukov.
Fixes #38880.

git-svn-id: https://develop.svn.wordpress.org/trunk@39325 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:51:39 +00:00