Compare commits

...

53 Commits
5.3 ... 4.9.1

Author SHA1 Message Date
Dominik Schilling
fe24185f48 Tag 4.9.1
Built from https://develop.svn.wordpress.org/tags/4.9.1@42329


git-svn-id: http://core.svn.wordpress.org/tags/4.9.1@42158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 21:47:12 +00:00
John Blackbourn
c4a15959f5 Bump 4.9 branch to version 4.9.1.
Built from https://develop.svn.wordpress.org/branches/4.9@42316


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 18:55:42 +00:00
John Blackbourn
b4a3edc859 Hardening: Remove the ability to upload JavaScript files for users who do not have the unfiltered_html capability.
Merges [42261] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42267


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 16:12:18 +00:00
John Blackbourn
e75247a179 Hardening: Ensure the attributes of enclosures are correctly escaped in RSS and Atom feeds.
Merges [42260] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42266


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 16:11:38 +00:00
John Blackbourn
45874b5050 Hardening: Add escaping to the language attributes used on html elements.
Merges [42259] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42265


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 16:10:41 +00:00
John Blackbourn
ecd15e008a Hardening: Use a properly generated hash for the newbloguser key instead of a determinate substring.
Merges [42258] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42264


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 16:08:41 +00:00
John Blackbourn
594456341d Post WordPress 4.9.1 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@42254


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 18:12:38 +00:00
John Blackbourn
ec63674dfc WordPress 4.9.1 Beta 1.
Built from https://develop.svn.wordpress.org/branches/4.9@42253


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 18:01:39 +00:00
John Blackbourn
4ae2ee9869 Media: Further improvements to the handling of language codes that get passed to MediaElement.
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

Merges [42251] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42252


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 14:54:42 +00:00
Dion Hulse
0236fd226e Theme Editor: Translate the URL to the Child Themes Codex page.
Props odysseygate, johnpgreen.
Merges [42247] to the 4.9 branch.
Fixes #42454.

Built from https://develop.svn.wordpress.org/branches/4.9@42248


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:53:40 +00:00
Dion Hulse
9fe3e9edf0 Theme Editor: Validate files are editable based on their relative filenames, rather than full file path.
This fixes theme editing on Windows platforms where `validate_file()` will return `2` on a full file path.

Merges [42244] to the 4.9 branch.
Fixes #42609.

Built from https://develop.svn.wordpress.org/branches/4.9@42245


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:29:25 +00:00
Dion Hulse
e1095eeb9f Theme/Plugin Editor: Remove the caching added in [41806] as it causes more problems than it fixes.
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].
Merges [42242] to the 4.9 branch.
See #6531.
Fixes #42573 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42243


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:00:38 +00:00
Dion Hulse
68cb5b6f05 WPDB: Fix the parsing of sockets which contain colons within the socket name (used on some cloud providers).
Props natacado.
Merges [42226] to the 4.9 branch.
Fixes #42634 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42229


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 00:56:41 +00:00
Dion Hulse
6dc1dd28f5 Themes: Prevent JS error on Themes admin screen when only one theme is installed.
Amends [42029].
Props chetan200891, afercia.
See #42348, westonruter.
Merges [42222] to the 4.9 branch.
Fixes #42673.

Built from https://develop.svn.wordpress.org/branches/4.9@42223


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-24 02:56:42 +00:00
John Blackbourn
4cb8d10856 Users: Correct the value of the lang attribute in the admin area.
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

Merges [42220] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42221


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 19:06:42 +00:00
John Blackbourn
97ba6be232 Docs: Correct the @since property for the page_attributes_misc_attributes action.
Props jeremyescott, jfarthing84

Fixes #42607

Merges [42203] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42219


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 18:03:43 +00:00
Dion Hulse
cee7720939 Upgrade: Fix updating plugins which include a numeric file/folder names.
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.
Merges [42214] to the 4.9 branch.
Fixes #42628 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42215


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 04:16:41 +00:00
Dion Hulse
b09cebf575 Rewrite Rules: Correct the logic in extract_from_markers() after [41928].
Props stodorovic, SergeyBiryukov.
Merges [42199] to the 4.9 branch.
Fixes #42579. See #39920.

Built from https://develop.svn.wordpress.org/branches/4.9@42213


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 03:47:38 +00:00
Dion Hulse
66a3d52431 Multisite: Fix broken update blog_versions query after [41661].
Props Mista-Flo, lenasterg, flixos90.
Merges [42210] to the 4.9 branch.
Fixes #42641.

Built from https://develop.svn.wordpress.org/branches/4.9@42212


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 03:43:40 +00:00
Weston Ruter
85d9b63062 Bump package.json version to 4.9.1
Built from https://develop.svn.wordpress.org/branches/4.9@42197


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-16 01:16:37 +00:00
Weston Ruter
75ab7d2124 Bump version WordPress 4.9.1 alpha
Built from https://develop.svn.wordpress.org/branches/4.9@42196


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-16 01:02:39 +00:00
Weston Ruter
553d6fdbe0 Bump version for WordPress 4.9
Built from https://develop.svn.wordpress.org/branches/4.9@42195


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-16 00:12:39 +00:00
Weston Ruter
35b40d1001 Editor: Re-build tinymce.min.js after [42191].
See #42553.

Built from https://develop.svn.wordpress.org/branches/4.9@42194


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 23:36:39 +00:00
Weston Ruter
a5f8e0917f Editor: Disable wp_keep_scroll_position in IE11 since buggy; fix matches polyfill conflict with ME.js by doing runtime feature detection in context window.
Props westonruter, SergeyBiryukov, Clorith for testing.
See #41962, #42029.
Fixes #42553 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42192


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 19:00:38 +00:00
Weston Ruter
73615e0bc4 File Editor: Eliminate gap inserted between code editor and heading in IE11 when CodeMirror initializes.
Props afercia, melchoyce, Clorith for testing, SergeyBiryukov for testing.
See #12423.
Fixes #42554 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42190


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 18:31:37 +00:00
Weston Ruter
567de560e9 Customize: Prevent themes panel from auto-expanding in IE11.
In IE11 the `input` event erroneously gets triggered initially without any user input.

Amends [41648].
See #37661.
Fixes #42556 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42188


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 18:13:40 +00:00
Weston Ruter
ff85340727 Widgets: Set global $post to current queried object instead of nullifying when is_singular() while applying filters (and shortcodes) in Text widget and (via plugin) Custom HTML widget.
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 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42186


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 02:33:44 +00:00
Weston Ruter
ecf8680978 Editor: Improve scrolling behavior and prevent autosave logic from causing dirty state when just switching between Visual and Text tabs.
Props pento.
See #41962, #42029.
Fixes #42530 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42184


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 00:22:42 +00:00
Weston Ruter
36282a2a9c About Page: Fix issue with overlapping images and text on IE11 and Edge 15.
Props Clorith, ryelle, afercia, la-geek, SergeyBiryukov.
See #42087.
Fixes #42545 for 4.9

Built from https://develop.svn.wordpress.org/branches/4.9@42182


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 23:04:40 +00:00
Weston Ruter
44eb69904d Post WordPress 4.9 RC3 bump.
Built from https://develop.svn.wordpress.org/branches/4.9@42180


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 06:51:41 +00:00
Weston Ruter
ce6b628972 WordPress 4.9 RC3.
Built from https://develop.svn.wordpress.org/branches/4.9@42179


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 06:08:40 +00:00
Weston Ruter
0110751ddc Editor: Cease adding paragraphs when switching editor tabs.
Fixes an error since [41783] in which extra paragraphs could be added to content when switching editor tabs.

Props pento, adamsilverstein, aduth.
Fixes #42531 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42178


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 05:28:41 +00:00
Gary Pendergast
5e736b62e0 Editor: When switching Editor tabs, don't scroll unnecessarily.
- 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.

Merge of 52175 to the 4.9 branch.

Fixes #42530.


Built from https://develop.svn.wordpress.org/branches/4.9@42176


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 05:21:39 +00:00
Weston Ruter
eb18399c10 About: Fix jumping behavior for titles and columns when scrolling.
Props ryelle.
See #42087.
Fixes #42514, #42526 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42174


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:48:36 +00:00
Weston Ruter
c268b2f28c Customize: Allow notifications for linting errors in code editor control (for Additional CSS) to be overridden to allow saving.
Implements the same override that was implemented in [41721] for the theme/plugin editors.

See #41897, #41887.
Fixes #42528 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42172


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:47:12 +00:00
Weston Ruter
15b14c30c1 Customize: Prevent PHP notice on theme-switch dashboard welcome link (and link to themes admin screen) when user cannot customize.
Props skostadinov, ocean90.
Amends [41699].
See #42050.
Fixes #42525 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42170


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:45:47 +00:00
Dominik Schilling
0d7f326477 Build: Add npm-shrinkwrap.json.
For compatibility with the build server `fsevent` has been manually removed.

Props netweb.
See #42483.
Built from https://develop.svn.wordpress.org/branches/4.9@42168


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:44:24 +00:00
Dominik Schilling
062ab0b0c8 Revert [42166].
Due to running `npm install` an updated `npm-shrinkwrap.json` file was committed.

See #42483.
Built from https://develop.svn.wordpress.org/branches/4.9@42167


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:43:42 +00:00
Weston Ruter
46c75fbaf7 I18N: Fix passing singular/plural strings to JS.
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 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42164


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 07:09:35 +00:00
Weston Ruter
11e007c502 About: Add vertical alignment for developer happiness sections.
Also run CSS autoprefixer to add `-ms-` prefixes for CSS grid identifiers for IE11.

Props Presskopp.
Amends [42121].
See #42087.
Fixes #42524 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42162


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 05:49:36 +00:00
Weston Ruter
b0c557fbb2 About: Fix grammar typo with pluralization.
Props metodiew, westonruter.
Amends [42121].
See #42087.
Fixes #42476 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42160


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 05:20:36 +00:00
Weston Ruter
277261edeb About: Synchronize 4.9 tagline across about pages for credits, freedoms, and privacy.
Props dave.pullig.
Amends [41943].
See #42087.
Fixes #42518 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42158


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-12 20:00:37 +00:00
Weston Ruter
1b39843b11 Theme Editor: Fix styling of child theme notice.
Props westonruter, melchoyce, ndiego.
See #24048.
Fixes #42491 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42156


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-11 20:44:38 +00:00
Weston Ruter
6cc5d01d17 Customize: Restore ability to add Custom Link nav menu items for jump links and other URLs that were previously allowed.
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 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42154


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 23:43:39 +00:00
Weston Ruter
523fcaca2e Customize: Ensure customization drafts are published instead of trashed when scheduled changeset goes live while non-admin user is authenticated (such as during WP Cron).
Props designsimply for testing, dlh for testing, melchoyce for testing.
See #28721, #34923, #42220.
Fixes #42489 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42149


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:45:38 +00:00
Weston Ruter
a647fbead2 Settings: Replace count() call with empty() in get_settings_errors() to prevent PHP 7.2 warnings when $wp_settings_errors is null.
Props pross, dd32, westonruter.
See #40109.
Fixes #42498 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42147


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:32:47 +00:00
Weston Ruter
389166f9aa Customize: Ensure autosave revision is dismissed immediately after implicit restoration notice dismissal as done with explicit notice dismissal.
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 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42145


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 21:45:38 +00:00
Weston Ruter
af74789be0 Widgets: Style the Image Widget's link field as invalid when a bad URL is supplied.
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 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42141


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 01:29:40 +00:00
Weston Ruter
ca12fb6710 Customize: Fix reliability of just-in-time publishing for changesets that miss their schedule when visiting customize.php.
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 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42139


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 04:45:38 +00:00
Weston Ruter
707a3196f7 Customize: Ensure autosaving message gets sent to preview after initial change when saved state is first dirty.
Amends [41667].
Fixes #42475 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42137


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 04:21:40 +00:00
Weston Ruter
e6a91f7ccf Settings: Fix date/time format previewing.
Props afercia.
Amends [41857].
Fixes #41603 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42135


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 03:57:36 +00:00
Weston Ruter
bbef4fd178 Customize: Restore search icon to available widgets pane incorrectly removed in [41893].
See #42215.
Fixes #42472 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42133


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 01:06:34 +00:00
Weston Ruter
fcb3e4d712 Branch 4.9
Built from https://develop.svn.wordpress.org/branches/4.9@42126


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 05:41:11 +00:00
64 changed files with 694 additions and 298 deletions

View File

@@ -30,6 +30,28 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
</h2>
<div class="changelog point-releases">
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
11
),
'4.9.1',
number_format_i18n( 11 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.9.1' );
?>
</p>
</div>
<div class="feature-section one-col">
<div class="col">
<h2>
@@ -53,7 +75,9 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</div>
<div class="floating-header-section">
<h2><?php _e( 'Customizer Workflow Improved' ); ?></h2>
<div class="section-header">
<h2><?php _e( 'Customizer Workflow Improved' ); ?></h2>
</div>
<div class="section-content">
<div class="section-item">
@@ -88,7 +112,9 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</div>
<div class="floating-header-section">
<h2><?php _e( 'Coding Enhancements' ); ?></h2>
<div class="section-header">
<h2><?php _e( 'Coding Enhancements' ); ?></h2>
</div>
<div class="section-content">
<div class="section-item">
@@ -116,7 +142,9 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</div>
<div class="floating-header-section">
<h2><?php _e( 'Even More Widget Updates' ); ?></h2>
<div class="section-header">
<h2><?php _e( 'Even More Widget Updates' ); ?></h2>
</div>
<div class="section-content">
<div class="section-item">
@@ -137,7 +165,9 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</div>
<div class="floating-header-section">
<h2><?php _e( 'Site Building Improvements' ); ?></h2>
<div class="section-header">
<h2><?php _e( 'Site Building Improvements' ); ?></h2>
</div>
<div class="section-content">
<div class="section-item">
@@ -211,7 +241,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<p><?php _e( 'WordPress 4.9 includes an upgraded version of MediaElement.js, which removes dependencies on jQuery, improves accessibility, modernizes the UI, and fixes many bugs.' ); ?></p>
</div>
<div class="col">
<h3><a href="https://make.wordpress.org/core/2017/10/15/improvements-for-roles-and-capabilities-in-4-9/"><?php _e( 'Roles and Capability Improvements' ); ?></a></h3>
<h3><a href="https://make.wordpress.org/core/2017/10/15/improvements-for-roles-and-capabilities-in-4-9/"><?php _e( 'Improvements to Roles and Capabilities' ); ?></a></h3>
<p><?php _e( 'New capabilities have been introduced that allow granular management of plugins and translation files. In addition, the site switching process in multisite has been fine-tuned to update the available roles and capabilities in a more reliable and coherent way.' ); ?></p>
</div>
</div>
@@ -242,34 +272,78 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
offset += $adminbar.height();
}
var adjustScrollClass = _.throttle( function adjustScrollClass() {
function setup() {
$sections.each( function( i, section ) {
var $section = $( section );
// If the title is long, switch the layout
var $title = $section.find( 'h2' );
if ( $title.innerWidth() > 300 ) {
$section.addClass( 'has-long-title' );
}
} );
}
var adjustScrollPosition = _.throttle( function adjustScrollPosition() {
$sections.each( function( i, section ) {
var $section = $( section );
var $header = $section.find( 'h2' );
var width = $header.innerWidth();
var height = $header.innerHeight();
if ( $section.hasClass( 'has-long-title' ) ) {
return;
}
var sectionStart = $section.offset().top - offset;
var sectionEnd = sectionStart + $section.innerHeight() - 60;
var sectionEnd = sectionStart + $section.innerHeight();
var scrollPos = $window.scrollTop();
// If we're scrolled into a section, stick the header
if ( $window.scrollTop() >= sectionStart && $window.scrollTop() < sectionEnd ) {
$header.addClass( 'header-fixed' );
$header.css( { top: offset + 'px', width: width + 'px' } );
if ( scrollPos >= sectionStart && scrollPos < sectionEnd - height ) {
$header.css( {
position: 'fixed',
top: offset + 'px',
bottom: 'auto',
width: width + 'px'
} );
// If we're at the end of the section, stick the header to the bottom
} else if ( scrollPos >= sectionEnd - height && scrollPos < sectionEnd ) {
$header.css( {
position: 'absolute',
top: 'auto',
bottom: 0,
width: width + 'px'
} );
// Unstick the header
} else {
$header.removeClass( 'header-fixed' );
$header.css( { top: 0, width: 'auto' } );
$header.css( {
position: 'static',
top: 'auto',
bottom: 'auto',
width: 'auto'
} );
}
} );
}, 100 );
function enableFixedHeaders() {
if ( $window.width() > 782 ) {
adjustScrollClass();
$window.on( 'scroll', adjustScrollClass );
setup();
adjustScrollPosition();
$window.on( 'scroll', adjustScrollPosition );
} else {
$window.off( 'scroll', adjustScrollClass );
$window.off( 'scroll', adjustScrollPosition );
$sections.find( '.section-header' )
.css( {
width: 'auto'
} );
$sections.find( 'h2' )
.removeClass( 'header-fixed' )
.css( { top: 0, width: 'auto' } );
.css( {
position: 'static',
top: 'auto',
bottom: 'auto',
width: 'auto'
} );
}
}
$( window ).resize( enableFixedHeaders );

View File

@@ -20,7 +20,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s adds more ways for you to express yourself and represent your brand.' ), $display_version ); ?></p>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s will smooth your design workflow and keep you safe from coding errors.' ), $display_version ); ?></p>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>

View File

@@ -172,8 +172,6 @@
display: flex;
-webkit-box-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
align-items: center;
flex-wrap: wrap;
}
@@ -262,8 +260,10 @@
.about-wrap .two-col-text {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
-webkit-column-gap: 40px;
-moz-column-gap: 40px;
column-gap: 40px;
}
@@ -357,37 +357,87 @@
/* 2.3 Floating Header Layout */
.about-wrap .floating-header-section {
display: -ms-grid;
display: grid;
grid-gap: 0 60px;
-ms-grid-columns: 5fr 11fr;
grid-template-columns: 5fr 11fr;
max-width: 1020px;
margin: 0 auto 120px;
}
.about-wrap .floating-header-section h2 {
.about-wrap .floating-header-section .section-header {
-ms-grid-column: 1;
grid-column: 1;
text-align: right;
margin: 0;
position: relative;
min-width: 230px;
max-width: 300px;
}
.about-wrap .floating-header-section .header-fixed {
position: fixed;
width: 300px;
.about-wrap .floating-header-section h2 {
margin: 0;
text-align: right;
position: absolute;
}
.about-wrap .floating-header-section .section-content {
display: grid;
grid-gap: 60px;
grid-template-columns: 5fr 5fr;
-ms-grid-column: 2;
grid-column: 2;
display: -webkit-box;
display: flex;
-webkit-box-pack: justify;
justify-content: space-between;
-webkit-box-align: start;
align-items: flex-start;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
flex-flow: row wrap;
-webkit-box-flex: 2;
flex-grow: 2;
flex-shrink: 0;
}
.about-wrap .floating-header-section .section-item:nth-of-type(odd) {
grid-column: 1;
.about-wrap .floating-header-section .section-item {
-webkit-box-flex: 1;
flex-grow: 1;
max-width: calc(50% - 30px);
}
.about-wrap .floating-header-section .section-item:nth-of-type(even) {
grid-column: 2;
.about-wrap .floating-header-section .section-item:nth-child(1),
.about-wrap .floating-header-section .section-item:nth-child(2) {
margin-bottom: 60px;
}
.about-wrap .floating-header-section .section-item:nth-child(1):nth-last-child(2),
.about-wrap .floating-header-section .section-item:nth-child(2):nth-last-child(1) {
margin-bottom: 0;
}
.about-wrap .floating-header-section.has-long-title {
display: block;
}
.about-wrap .floating-header-section.has-long-title .section-header {
max-width: 100%;
}
.about-wrap .floating-header-section.has-long-title h2 {
position: static;
margin-bottom: 60px;
}
.about-wrap .floating-header-section.has-long-title .section-content {
-webkit-box-pack: start;
justify-content: flex-start;
}
.about-wrap .floating-header-section.has-long-title .section-item {
max-width: 300px;
margin-bottom: 0;
}
.about-wrap .floating-header-section.has-long-title .section-item + .section-item {
margin-right: 60px;
}
/*------------------------------------------------------------------------------
@@ -409,7 +459,7 @@
}
.about-wrap .compact {
margin-bottom: 0
margin-bottom: 0;
}
.about-wrap .wp-person {
@@ -481,9 +531,27 @@
4.0 - Media Queries
------------------------------------------------------------------------------*/
@media screen and ( max-width: 782px ) {
@media screen and (max-width: 1250px) {
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(1),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(2) {
margin: 0 0 60px;
}
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(3),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(4) {
margin: 0;
}
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(2),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(4) {
margin-right: 60px;
}
}
@media screen and (max-width: 782px) {
.about-wrap .two-col-text {
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
}
@@ -498,13 +566,17 @@
}
.about-wrap .floating-header-section {
grid-template-columns: 1fr;
grid-gap: 60px 0;
display: block;
}
.about-wrap .floating-header-section h2,
.about-wrap .floating-header-section .section-header,
.about-wrap .floating-header-section .section-content {
grid-column: 1;
max-width: 100%;
}
.about-wrap .floating-header-section h2 {
position: static;
margin-bottom: 60px;
}
}
@@ -560,12 +632,15 @@
margin-bottom: 60px;
}
.about-wrap .floating-header-section .section-content {
grid-template-columns: 1fr;
grid-gap: 60px 0;
.about-wrap .floating-header-section h2 {
word-break: break-all;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
.about-wrap .floating-header-section .section-content .section-item {
grid-column: 1;
max-width: 100%;
margin: 0 0 60px;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -172,8 +172,6 @@
display: flex;
-webkit-box-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
align-items: center;
flex-wrap: wrap;
}
@@ -262,8 +260,10 @@
.about-wrap .two-col-text {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
-webkit-column-gap: 40px;
-moz-column-gap: 40px;
column-gap: 40px;
}
@@ -357,37 +357,87 @@
/* 2.3 Floating Header Layout */
.about-wrap .floating-header-section {
display: -ms-grid;
display: grid;
grid-gap: 0 60px;
-ms-grid-columns: 5fr 11fr;
grid-template-columns: 5fr 11fr;
max-width: 1020px;
margin: 0 auto 120px;
}
.about-wrap .floating-header-section h2 {
.about-wrap .floating-header-section .section-header {
-ms-grid-column: 1;
grid-column: 1;
text-align: left;
margin: 0;
position: relative;
min-width: 230px;
max-width: 300px;
}
.about-wrap .floating-header-section .header-fixed {
position: fixed;
width: 300px;
.about-wrap .floating-header-section h2 {
margin: 0;
text-align: left;
position: absolute;
}
.about-wrap .floating-header-section .section-content {
display: grid;
grid-gap: 60px;
grid-template-columns: 5fr 5fr;
-ms-grid-column: 2;
grid-column: 2;
display: -webkit-box;
display: flex;
-webkit-box-pack: justify;
justify-content: space-between;
-webkit-box-align: start;
align-items: flex-start;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
flex-flow: row wrap;
-webkit-box-flex: 2;
flex-grow: 2;
flex-shrink: 0;
}
.about-wrap .floating-header-section .section-item:nth-of-type(odd) {
grid-column: 1;
.about-wrap .floating-header-section .section-item {
-webkit-box-flex: 1;
flex-grow: 1;
max-width: calc(50% - 30px);
}
.about-wrap .floating-header-section .section-item:nth-of-type(even) {
grid-column: 2;
.about-wrap .floating-header-section .section-item:nth-child(1),
.about-wrap .floating-header-section .section-item:nth-child(2) {
margin-bottom: 60px;
}
.about-wrap .floating-header-section .section-item:nth-child(1):nth-last-child(2),
.about-wrap .floating-header-section .section-item:nth-child(2):nth-last-child(1) {
margin-bottom: 0;
}
.about-wrap .floating-header-section.has-long-title {
display: block;
}
.about-wrap .floating-header-section.has-long-title .section-header {
max-width: 100%;
}
.about-wrap .floating-header-section.has-long-title h2 {
position: static;
margin-bottom: 60px;
}
.about-wrap .floating-header-section.has-long-title .section-content {
-webkit-box-pack: start;
justify-content: flex-start;
}
.about-wrap .floating-header-section.has-long-title .section-item {
max-width: 300px;
margin-bottom: 0;
}
.about-wrap .floating-header-section.has-long-title .section-item + .section-item {
margin-left: 60px;
}
/*------------------------------------------------------------------------------
@@ -409,7 +459,7 @@
}
.about-wrap .compact {
margin-bottom: 0
margin-bottom: 0;
}
.about-wrap .wp-person {
@@ -481,9 +531,27 @@
4.0 - Media Queries
------------------------------------------------------------------------------*/
@media screen and ( max-width: 782px ) {
@media screen and (max-width: 1250px) {
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(1),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(2) {
margin: 0 0 60px;
}
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(3),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(4) {
margin: 0;
}
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(2),
.about-wrap .floating-header-section.has-long-title .section-item:nth-child(4) {
margin-left: 60px;
}
}
@media screen and (max-width: 782px) {
.about-wrap .two-col-text {
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
}
@@ -498,13 +566,17 @@
}
.about-wrap .floating-header-section {
grid-template-columns: 1fr;
grid-gap: 60px 0;
display: block;
}
.about-wrap .floating-header-section h2,
.about-wrap .floating-header-section .section-header,
.about-wrap .floating-header-section .section-content {
grid-column: 1;
max-width: 100%;
}
.about-wrap .floating-header-section h2 {
position: static;
margin-bottom: 60px;
}
}
@@ -560,12 +632,15 @@
margin-bottom: 60px;
}
.about-wrap .floating-header-section .section-content {
grid-template-columns: 1fr;
grid-gap: 60px 0;
.about-wrap .floating-header-section h2 {
word-break: break-all;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
.about-wrap .floating-header-section .section-content .section-item {
grid-column: 1;
max-width: 100%;
margin: 0 0 60px;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -860,7 +860,7 @@ hr {
#media-items a.delete,
#media-items a.delete-permanently,
#nav-menu-footer .menu-delete,
#delete-link a.delete {
#delete-link a.delete {
color: #a00;
}
@@ -1700,7 +1700,7 @@ form.upgrade .hint {
.toggle-arrow {
background-repeat: no-repeat;
background-position: top left;
background-position: top right;
background-color: transparent;
height: 22px;
line-height: 22px;
@@ -1708,7 +1708,7 @@ form.upgrade .hint {
}
.toggle-arrow-active {
background-position: bottom left;
background-position: bottom right;
}
#screen-options-wrap h5, /* Back-compat for old plugins */
@@ -3042,6 +3042,7 @@ img {
min-height: 60vh;
height: calc( 100vh - 295px );
border: 1px solid #ddd;
box-sizing: border-box;
}
#templateside > h2 {
@@ -3060,8 +3061,8 @@ img {
margin-top: 0;
overflow: auto;
padding: 0;
min-height: calc(60vh + 2px);
height: calc(100vh - 293px);
min-height: 60vh;
height: calc(100vh - 295px);
background-color: #f7f7f7;
border: 1px solid #ddd;
border-right: none;
@@ -3240,17 +3241,21 @@ img {
margin: 4px 0;
}
#templateside li a,
#templateside li:not(.howto) a,
.theme-editor-php .highlight {
display: block;
padding: 3px 12px 3px 0;
text-decoration: none;
}
#templateside li > a:first-of-type {
#templateside li:not(.howto) > a:first-of-type {
padding-top: 0;
}
#templateside li.howto {
padding: 6px 12px 12px 12px;
}
.theme-editor-php .highlight {
margin: -3px -12px -3px 3px;
}
@@ -3756,17 +3761,17 @@ img {
}
/* Theme/Plugin File Editor */
#template textarea,
#template textarea,
#template .CodeMirror {
box-sizing: border-box;
}
#templateside {
float: none;
width: auto;
}
#templateside > ul {
border-right: 1px solid #ddd;
}
@@ -3775,10 +3780,13 @@ img {
margin: 0;
}
#templateside li a {
#templateside li:not(.howto) a {
display: block;
padding: 5px;
}
#templateside li.howto {
padding: 12px;
}
#templateside .highlight {
padding: 5px;
@@ -3834,31 +3842,31 @@ img {
width: 100%;
text-align: right;
}
.fileedit-sub .alignright label {
display: block;
}
.fileedit-sub #theme,
.fileedit-sub #theme,
.fileedit-sub #plugin {
margin-right: 0;
max-width: 70%;
max-width: 70%;
}
.fileedit-sub input[type="submit"] {
margin-bottom: 0px;
padding: 8px 18px;
}
#documentation label[for="docs-list"] {
display: block;
}
#documentation select[name="docs-list"] {
margin-right: 0;
max-width: 60%;
}
#documentation input[type="button"] {
margin-bottom: 0;
padding: 8px 18px;

File diff suppressed because one or more lines are too long

View File

@@ -860,7 +860,7 @@ hr {
#media-items a.delete,
#media-items a.delete-permanently,
#nav-menu-footer .menu-delete,
#delete-link a.delete {
#delete-link a.delete {
color: #a00;
}
@@ -3042,6 +3042,7 @@ img {
min-height: 60vh;
height: calc( 100vh - 295px );
border: 1px solid #ddd;
box-sizing: border-box;
}
#templateside > h2 {
@@ -3060,8 +3061,8 @@ img {
margin-top: 0;
overflow: auto;
padding: 0;
min-height: calc(60vh + 2px);
height: calc(100vh - 293px);
min-height: 60vh;
height: calc(100vh - 295px);
background-color: #f7f7f7;
border: 1px solid #ddd;
border-left: none;
@@ -3240,17 +3241,21 @@ img {
margin: 4px 0;
}
#templateside li a,
#templateside li:not(.howto) a,
.theme-editor-php .highlight {
display: block;
padding: 3px 0 3px 12px;
text-decoration: none;
}
#templateside li > a:first-of-type {
#templateside li:not(.howto) > a:first-of-type {
padding-top: 0;
}
#templateside li.howto {
padding: 6px 12px 12px 12px;
}
.theme-editor-php .highlight {
margin: -3px 3px -3px -12px;
}
@@ -3756,17 +3761,17 @@ img {
}
/* Theme/Plugin File Editor */
#template textarea,
#template textarea,
#template .CodeMirror {
box-sizing: border-box;
}
#templateside {
float: none;
width: auto;
}
#templateside > ul {
border-left: 1px solid #ddd;
}
@@ -3775,10 +3780,13 @@ img {
margin: 0;
}
#templateside li a {
#templateside li:not(.howto) a {
display: block;
padding: 5px;
}
#templateside li.howto {
padding: 12px;
}
#templateside .highlight {
padding: 5px;
@@ -3834,31 +3842,31 @@ img {
width: 100%;
text-align: left;
}
.fileedit-sub .alignright label {
display: block;
}
.fileedit-sub #theme,
.fileedit-sub #theme,
.fileedit-sub #plugin {
margin-left: 0;
max-width: 70%;
max-width: 70%;
}
.fileedit-sub input[type="submit"] {
margin-bottom: 0px;
padding: 8px 18px;
}
#documentation label[for="docs-list"] {
display: block;
}
#documentation select[name="docs-list"] {
margin-left: 0;
max-width: 60%;
}
#documentation input[type="button"] {
margin-bottom: 0;
padding: 8px 18px;

File diff suppressed because one or more lines are too long

View File

@@ -2706,6 +2706,7 @@ body.adding-widget .add-new-widget:before,
}
#available-menu-items-search .search-icon:after,
#available-widgets-filter .search-icon:after,
.themes-filter-bar .search-icon:after {
content: "\f179";
font: normal 20px/1 dashicons;

File diff suppressed because one or more lines are too long

View File

@@ -2706,6 +2706,7 @@ body.adding-widget .add-new-widget:before,
}
#available-menu-items-search .search-icon:after,
#available-widgets-filter .search-icon:after,
.themes-filter-bar .search-icon:after {
content: "\f179";
font: normal 20px/1 dashicons;

File diff suppressed because one or more lines are too long

View File

@@ -330,7 +330,7 @@ form#tags-filter {
}
#content-resize-handle {
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
width: 12px;
cursor: row-resize;
}
@@ -1299,7 +1299,7 @@ table.links-table {
(min-resolution: 120dpi) {
#content-resize-handle,
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
background: transparent url(../images/resize-2x.gif) no-repeat scroll left bottom;
background-size: 11px 11px;
}

File diff suppressed because one or more lines are too long

View File

@@ -897,7 +897,7 @@ table.form-table td .updated p {
.options-general-php .spinner {
float: none;
margin: 0 3px;
margin: -3px 3px 0;
}
.settings-php .language-install-spinner,

File diff suppressed because one or more lines are too long

View File

@@ -897,7 +897,7 @@ table.form-table td .updated p {
.options-general-php .spinner {
float: none;
margin: 0 3px;
margin: -3px 3px 0;
}
.settings-php .language-install-spinner,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -154,7 +154,8 @@
top: 30px;
}
.media-frame #embed-url-field.invalid {
.media-frame #embed-url-field.invalid,
.media-widget-image-link > .link:invalid {
border: 1px solid #dc3232;
}

File diff suppressed because one or more lines are too long

View File

@@ -154,7 +154,8 @@
top: 30px;
}
.media-frame #embed-url-field.invalid {
.media-frame #embed-url-field.invalid,
.media-widget-image-link > .link:invalid {
border: 1px solid #dc3232;
}

File diff suppressed because one or more lines are too long

View File

@@ -42,10 +42,34 @@ if ( $wp_customize->changeset_post_id() ) {
get_post_time( 'G', true, $changeset_post ) < time()
);
if ( $missed_schedule ) {
wp_publish_post( $changeset_post->ID );
/*
* Note that an Ajax request spawns here instead of just calling `wp_publish_post( $changeset_post->ID )`.
*
* Because WP_Customize_Manager is not instantiated for customize.php with the `settings_previewed=false`
* argument, settings cannot be reliably saved. Some logic short-circuits if the current value is the
* same as the value being saved. This is particularly true for options via `update_option()`.
*
* By opening an Ajax request, this is avoided and the changeset is published. See #39221.
*/
$nonces = $wp_customize->get_nonces();
$request_args = array(
'nonce' => $nonces['save'],
'customize_changeset_uuid' => $wp_customize->changeset_uuid(),
'wp_customize' => 'on',
'customize_changeset_status' => 'publish',
);
ob_start();
?>
<?php wp_print_scripts( array( 'wp-util' ) ); ?>
<script>
wp.ajax.post( 'customize_save', <?php echo wp_json_encode( $request_args ); ?> );
</script>
<?php
$script = ob_get_clean();
wp_die(
'<h1>' . __( 'Your scheduled changes just published' ) . '</h1>' .
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>' . $script,
200
);
}

View File

@@ -639,7 +639,7 @@ if ( post_type_supports($post_type, 'editor') ) {
'resize' => false,
'wp_autoresize_on' => $_wp_editor_expand,
'add_unload_trigger' => false,
'wp_keep_scroll_position' => true,
'wp_keep_scroll_position' => ! $is_IE,
),
) ); ?>
<table id="post-status-info"><tbody><tr>

View File

@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s adds more ways for you to express yourself and represent your brand.' ), $display_version ); ?></p>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s will smooth your design workflow and keep you safe from coding errors.' ), $display_version ); ?></p>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>

View File

@@ -342,7 +342,8 @@ class WP_Upgrader {
if ( ! empty( $details['files'] ) ) {
$children = $this->flatten_dirlist( $details['files'], $path . $name . '/' );
$files = array_merge( $files, $children );
// Merge keeping possible numeric keys, which array_merge() will reindex from 0..n
$files = $files + $children;
}
}

View File

@@ -1567,14 +1567,14 @@ function wp_welcome_panel() {
<p class="about-description"><?php _e( 'We&#8217;ve assembled some links to get you started:' ); ?></p>
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<?php if ( current_user_can( 'customize' ) ):
$customize_themes_link = add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ); ?>
<?php if ( current_user_can( 'customize' ) ) : ?>
<h3><?php _e( 'Get Started' ); ?></h3>
<a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Customize Your Site' ); ?></a>
<?php endif; ?>
<a class="button button-primary button-hero hide-if-customize" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
<p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $customize_themes_link ); ?></p>
<?php $themes_link = current_user_can( 'customize' ) ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
<p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link ); ?></p>
<?php endif; ?>
</div>
<div class="welcome-panel-column">

View File

@@ -445,7 +445,8 @@ function wp_edit_theme_plugin_file( $args ) {
}
}
if ( 0 !== validate_file( $real_file, $allowed_files ) ) {
// Compare based on relative paths
if ( 0 !== validate_file( $file, array_keys( $allowed_files ) ) ) {
return new WP_Error( 'disallowed_theme_file', __( 'Sorry, that file cannot be edited.' ) );
}

View File

@@ -903,7 +903,7 @@ $default_title = apply_filters( 'default_page_template_title', __( 'Default Tem
/**
* Fires before the help hint text in the 'Page Attributes' meta box.
*
* @since 4.8.0
* @since 4.9.0
*
* @param WP_Post $post The current post.
*/

View File

@@ -77,12 +77,12 @@ function extract_from_markers( $filename, $marker ) {
foreach ( $markerdata as $markerline ) {
if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
$state = false;
if ( $state ) {
$result[] = $markerline;
}
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
$state = true;
}
}
if ( $state ) {
$result[] = $markerline;
}
if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
$state = true;
}
}

View File

@@ -51,7 +51,7 @@ function options_general_add_js() {
$("input[name='date_format']").click(function(){
if ( "date_format_custom_radio" != $(this).attr("id") )
$( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
});
$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
$( '#date_format_custom_radio' ).prop( 'checked', true );
@@ -59,18 +59,23 @@ function options_general_add_js() {
$("input[name='time_format']").click(function(){
if ( "time_format_custom_radio" != $(this).attr("id") )
$( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
});
$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
$( '#time_format_custom_radio' ).prop( 'checked', true );
});
$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
var format = $(this);
format.siblings( '.spinner' ).addClass( 'is-active' );
$.post(ajaxurl, {
action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
var format = $( this ),
fieldset = format.closest( 'fieldset' ),
example = fieldset.find( '.example' ),
spinner = fieldset.find( '.spinner' );
spinner.addClass( 'is-active' );
$.post( ajaxurl, {
action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format',
date : format.val()
}, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
}, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
});
var languageSelect = $( '#WPLANG' );

View File

@@ -194,17 +194,6 @@ function get_plugin_files( $plugin ) {
$plugin_file = WP_PLUGIN_DIR . '/' . $plugin;
$dir = dirname( $plugin_file );
$data = get_plugin_data( $plugin_file );
$label = isset( $data['Version'] )
? sanitize_key( 'files_' . $plugin . '-' . $data['Version'] )
: sanitize_key( 'files_' . $plugin );
$transient_key = substr( $label, 0, 29 ) . md5( $label );
$plugin_files = get_transient( $transient_key );
if ( false !== $plugin_files ) {
return $plugin_files;
}
$plugin_files = array( plugin_basename( $plugin_file ) );
if ( is_dir( $dir ) && WP_PLUGIN_DIR !== $dir ) {
@@ -225,8 +214,6 @@ function get_plugin_files( $plugin ) {
$plugin_files = array_values( array_unique( $plugin_files ) );
}
set_transient( $transient_key, $plugin_files, HOUR_IN_SECONDS );
return $plugin_files;
}

View File

@@ -1457,8 +1457,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
}
// Check global in case errors have been added on this pageload.
if ( ! count( $wp_settings_errors ) )
if ( empty( $wp_settings_errors ) ) {
return array();
}
// Filter the results to those of a specific setting if one was set.
if ( $setting ) {

View File

@@ -435,11 +435,11 @@ function wp_upgrade() {
if ( is_multisite() ) {
$site_id = get_current_blog_id();
if ( $wpdb->get_row( $wpdb->prepare( 'SELECT blog_id FROM %s WHERE blog_id = %d', $wpdb->blog_versions, $site_id ) ) ) {
$wpdb->query( $wpdb->prepare( 'UPDATE %s SET db_version = %d WHERE blog_id = %d', $wpdb->blog_versions, $wp_db_version, $site_id ) );
} else {
$wpdb->query( $wpdb->prepare( 'INSERT INTO %s ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, %s);', $wpdb->blog_versions, $site_id, $wp_db_version, NOW() ) );
}
if ( $wpdb->get_row( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = %d", $site_id ) ) ) {
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->blog_versions} SET db_version = %d WHERE blog_id = %d", $wp_db_version, $site_id ) );
} else {
$wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
}
}
/**

View File

@@ -1867,6 +1867,9 @@
// Search terms.
debounced = _.debounce( section.checkTerm, 500 ); // Wait until there is no input for 500 milliseconds to initiate a search.
section.contentContainer.on( 'input', '.wp-filter-search', function() {
if ( ! api.panel( 'themes' ).expanded() ) {
return;
}
debounced( section );
if ( ! section.expanded() ) {
section.expand();
@@ -5280,6 +5283,27 @@
codemirror: $.Deferred()
} );
api.Control.prototype.initialize.call( control, id, options );
// Note that rendering is debounced so the props will be used when rendering happens after add event.
control.notifications.bind( 'add', function( notification ) {
// Skip if control notification is not from setting csslint_error notification.
if ( notification.code !== control.setting.id + ':csslint_error' ) {
return;
}
// Customize the template and behavior of csslint_error notifications.
notification.templateId = 'customize-code-editor-lint-error-notification';
notification.render = (function( render ) {
return function() {
var li = render.call( this );
li.find( 'input[type=checkbox]' ).on( 'click', function() {
control.setting.notifications.remove( 'csslint_error' );
} );
return li;
};
})( notification.render );
} );
},
/**
@@ -8248,7 +8272,7 @@
// Set up initial notifications.
(function() {
var removedQueryParams = [];
var removedQueryParams = [], autosaveDismissed = false;
/**
* Obtain the URL to restore the autosave.
@@ -8294,6 +8318,25 @@
history.replaceState( {}, document.title, urlParser.href );
}
/**
* Dismiss autosave.
*
* @returns {void}
*/
function dismissAutosave() {
if ( autosaveDismissed ) {
return;
}
wp.ajax.post( 'customize_dismiss_autosave_or_lock', {
wp_customize: 'on',
customize_theme: api.settings.theme.stylesheet,
customize_changeset_uuid: api.settings.changeset.uuid,
nonce: api.settings.nonce.dismiss_autosave_or_lock,
dismiss_autosave: true
} );
autosaveDismissed = true;
}
/**
* Add notification regarding the availability of an autosave to restore.
*
@@ -8319,15 +8362,7 @@
} );
// Handle dismissal of notice.
li.find( '.notice-dismiss' ).on( 'click', function() {
wp.ajax.post( 'customize_dismiss_autosave_or_lock', {
wp_customize: 'on',
customize_theme: api.settings.theme.stylesheet,
customize_changeset_uuid: api.settings.changeset.uuid,
nonce: api.settings.nonce.dismiss_autosave_or_lock,
dismiss_autosave: true
} );
} );
li.find( '.notice-dismiss' ).on( 'click', dismissAutosave );
return li;
}
@@ -8335,6 +8370,7 @@
// Remove the notification once the user starts making changes.
onStateChange = function() {
dismissAutosave();
api.notifications.remove( code );
api.unbind( 'change', onStateChange );
api.state( 'changesetStatus' ).unbind( onStateChange );
@@ -9191,12 +9227,14 @@
api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once.
api.state( 'saved' ).bind( function( isSaved ) {
function onChangeSaved( isSaved ) {
if ( ! isSaved && ! api.settings.changeset.autosaved ) {
api.settings.changeset.autosaved = true; // Once a change is made then autosaving kicks in.
api.previewer.send( 'autosaving' );
}
} );
}
api.state( 'saved' ).bind( onChangeSaved );
onChangeSaved( api.state( 'saved' ).get() );
/**
* Request changeset update and then re-schedule the next changeset update time.

File diff suppressed because one or more lines are too long

View File

@@ -537,33 +537,37 @@
var menuItem,
itemName = $( '#custom-menu-item-name' ),
itemUrl = $( '#custom-menu-item-url' ),
urlRegex,
urlValue;
urlRegex;
if ( ! this.currentMenuControl ) {
return;
}
/*
* Copyright (c) 2010-2013 Diego Perini, MIT licensed
* https://gist.github.com/dperini/729294
* see also https://mathiasbynens.be/demo/url-regex
* modified to allow protocol-relative URLs
* Allow URLs including:
* - http://example.com/
* - //example.com
* - /directory/
* - ?query-param
* - #target
* - mailto:foo@example.com
*
* Any further validation will be handled on the server when the setting is attempted to be saved,
* so this pattern does not need to be complete.
*/
urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i;
urlRegex = /^((\w+:)?\/\/\w.*|\w+:(?!\/\/$)|\/|\?|#)/;
urlValue = itemUrl.val();
if ( '' === itemName.val() ) {
itemName.addClass( 'invalid' );
return;
} else if ( '' === urlValue || 'http://' === urlValue || ! ( '/' === urlValue[0] || urlRegex.test( urlValue ) ) ) {
} else if ( ! urlRegex.test( itemUrl.val() ) ) {
itemUrl.addClass( 'invalid' );
return;
}
menuItem = {
'title': itemName.val(),
'url': urlValue,
'url': itemUrl.val(),
'type': 'custom',
'type_label': api.Menus.data.l10n.custom_label,
'object': 'custom'

File diff suppressed because one or more lines are too long

View File

@@ -270,7 +270,7 @@ window.wp = window.wp || {};
if ( shortcodes ) {
for ( var i = 0; i < shortcodes.length; i++ ) {
var shortcode = shortcodes[ i ].replace( /^\[+/g, '' );
if ( result.indexOf( shortcode ) === -1 ) {
result.push( shortcode );
}
@@ -581,6 +581,8 @@ window.wp = window.wp || {};
removeSelectionMarker( startNode );
removeSelectionMarker( endNode );
editor.save();
}
/**
@@ -623,7 +625,9 @@ window.wp = window.wp || {};
edTools = $( '#wp-content-editor-tools' ),
edToolsHeight = 0,
edToolsOffsetTop = 0;
edToolsOffsetTop = 0,
$scrollArea;
if ( edTools.length ) {
edToolsHeight = edTools.height();
@@ -635,6 +639,11 @@ window.wp = window.wp || {};
selectionPosition = TinyMCEContentAreaTop + elementTop,
visibleAreaHeight = windowHeight - ( edToolsHeight + toolbarHeight );
// There's no need to scroll if the selection is inside the visible area.
if ( selectionPosition < visibleAreaHeight ) {
return;
}
/**
* The minimum scroll height should be to the top of the editor, to offer a consistent
* experience.
@@ -643,9 +652,16 @@ window.wp = window.wp || {};
* subtracting the height. This gives the scroll position where the top of the editor tools aligns with
* the top of the viewport (under the Master Bar)
*/
var adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight );
var adjustedScroll;
if ( editor.settings.wp_autoresize_on ) {
$scrollArea = $( 'html,body' );
adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight );
} else {
$scrollArea = $( editor.contentDocument ).find( 'html,body' );
adjustedScroll = elementTop;
}
$( 'html,body' ).animate( {
$scrollArea.animate( {
scrollTop: parseInt( adjustedScroll, 10 )
}, 100 );
}
@@ -852,19 +868,16 @@ window.wp = window.wp || {};
end = selection.end || selection.start;
if ( textArea.focus ) {
// focus and scroll to the position
// Wait for the Visual editor to be hidden, then focus and scroll to the position
setTimeout( function() {
textArea.setSelectionRange( start, end );
if ( textArea.blur ) {
// defocus before focusing
textArea.blur();
}
textArea.focus();
}, 100 );
textArea.focus();
}
textArea.setSelectionRange( start, end );
}
// Restore the selection when the editor is initialized. Needed when the Text editor is the default.
@@ -1035,10 +1048,6 @@ window.wp = window.wp || {};
// Normalize line breaks.
text = text.replace( /\r\n|\r/g, '\n' );
if ( text.indexOf( '\n' ) === -1 ) {
return text;
}
// Remove line breaks from <object>.
if ( text.indexOf( '<object' ) !== -1 ) {
text = text.replace( /<object[\s\S]+?<\/object>/g, function( a ) {

File diff suppressed because one or more lines are too long

View File

@@ -102,7 +102,7 @@ themes.view.Appearance = wp.Backbone.View.extend({
collection: self.collection,
parent: this
});
self.searchView = view;
self.SearchView = view;
// Render and append after screen title
view.render();
@@ -1448,7 +1448,7 @@ themes.Run = {
this.render();
// Start debouncing user searches after Backbone.history.start().
this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 );
this.view.SearchView.doSearch = _.debounce( this.view.SearchView.doSearch, 500 );
},
render: function() {
@@ -1924,7 +1924,7 @@ themes.RunInstaller = {
this.render();
// Start debouncing user searches after Backbone.history.start().
this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 );
this.view.SearchView.doSearch = _.debounce( this.view.SearchView.doSearch, 500 );
},
render: function() {

File diff suppressed because one or more lines are too long

View File

@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s helps you get your site set up the way you want it.' ), $display_version ); ?></p>
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s will smooth your design workflow and keep you safe from coding errors.' ), $display_version ); ?></p>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>

View File

@@ -229,20 +229,20 @@ if ( $theme->errors() )
?>
<div id="templateside">
<h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
<?php
if ( $has_templates || $theme->parent() ) :
if ( $theme->parent() ) {
/* translators: %s: link to edit parent theme */
echo '<p class="howto">' . sprintf( __( 'This child theme inherits templates from a parent theme, %s.' ),
sprintf( '<a href="%s">%s</a>',
self_admin_url( 'theme-editor.php?theme=' . urlencode( $theme->get_template() ) ),
$theme->parent()->display( 'Name' )
)
) . "</p>\n";
}
endif;
?>
<ul role="tree" aria-labelledby="theme-files-label">
<?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
<li class="howto">
<?php
/* translators: %s: link to edit parent theme */
echo sprintf( __( 'This child theme inherits templates from a parent theme, %s.' ),
sprintf( '<a href="%s">%s</a>',
self_admin_url( 'theme-editor.php?theme=' . urlencode( $theme->get_template() ) ),
$theme->parent()->display( 'Name' )
)
);
?>
</li>
<?php endif; ?>
<li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1">
<ul role="group">
<?php wp_print_theme_file_tree( wp_make_theme_file_tree( $allowed_files ) ); ?>
@@ -322,7 +322,7 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
echo sprintf(
/* translators: %s: Codex URL */
__( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don&#8217;t! Editing your theme directly could break your site and your changes may be lost in future updates. If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href="%s">making a child theme</a>.' ),
esc_url( 'https://codex.wordpress.org/Child_Themes' )
esc_url( __( 'https://codex.wordpress.org/Child_Themes' ) )
);
?>
</p>

View File

@@ -75,7 +75,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
$redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' );
}
} else {
$newuser_key = substr( md5( $user_id ), 0, 5 );
$newuser_key = wp_generate_password( 20, false );
add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) );
$roles = get_editable_roles();

View File

@@ -4125,6 +4125,18 @@ final class WP_Customize_Manager {
</li>
</script>
<script type="text/html" id="tmpl-customize-code-editor-lint-error-notification">
<li class="notice notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.containerClasses || '' }}" data-code="{{ data.code }}" data-type="{{ data.type }}">
<div class="notification-message">{{{ data.message || data.code }}}</div>
<p>
<# var elementId = 'el-' + String( Math.random() ); #>
<input id="{{ elementId }}" type="checkbox">
<label for="{{ elementId }}"><?php _e( 'Update anyway, even though it might break your site?' ); ?></label>
</p>
</li>
</script>
<?php
/* The following template is obsolete in core but retained for plugins. */
?>

View File

@@ -49,6 +49,7 @@ final class WP_Customize_Nav_Menus {
add_action( 'customize_register', array( $this, 'customize_register' ), 11 );
add_filter( 'customize_dynamic_setting_args', array( $this, 'filter_dynamic_setting_args' ), 10, 2 );
add_filter( 'customize_dynamic_setting_class', array( $this, 'filter_dynamic_setting_class' ), 10, 3 );
add_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) );
// Skip remaining hooks when the user can't manage nav menus anyway.
if ( ! current_user_can( 'edit_theme_options' ) ) {
@@ -64,7 +65,6 @@ final class WP_Customize_Nav_Menus {
add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );
add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) );
add_action( 'customize_preview_init', array( $this, 'make_auto_draft_status_previewable' ) );
add_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) );
// Selective Refresh partials.
add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );

View File

@@ -984,34 +984,10 @@ final class WP_Theme implements ArrayAccess {
* being absolute paths.
*/
public function get_files( $type = null, $depth = 0, $search_parent = false ) {
// get and cache all theme files to start with.
$label = sanitize_key( 'files_' . $this->cache_hash . '-' . $this->get( 'Version' ) );
$transient_key = substr( $label, 0, 29 ) . md5( $label );
$files = (array) self::scandir( $this->get_stylesheet_directory(), $type, $depth );
$all_files = get_transient( $transient_key );
if ( false === $all_files ) {
$all_files = (array) self::scandir( $this->get_stylesheet_directory(), null, -1 );
if ( $search_parent && $this->parent() ) {
$all_files += (array) self::scandir( $this->get_template_directory(), null, -1 );
}
set_transient( $transient_key, $all_files, HOUR_IN_SECONDS );
}
// Filter $all_files by $type & $depth.
$files = array();
if ( $type ) {
$type = (array) $type;
$_extensions = implode( '|', $type );
}
foreach ( $all_files as $key => $file ) {
if ( $depth >= 0 && substr_count( $key, '/' ) > $depth ) {
continue; // Filter by depth.
}
if ( ! $type || preg_match( '~\.(' . $_extensions . ')$~', $file ) ) { // Filter by type.
$files[ $key ] = $file;
}
if ( $search_parent && $this->parent() ) {
$files += (array) self::scandir( $this->get_template_directory(), $type, $depth );
}
return $files;

View File

@@ -476,7 +476,7 @@ function rss_enclosure() {
*
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
*/
echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" );
echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
}
}
}
@@ -510,7 +510,7 @@ function atom_enclosure() {
*
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
*/
echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" );
echo apply_filters( 'atom_enclosure', '<link href="' . esc_url( trim( $enclosure[0] ) ) . '" rel="enclosure" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( trim( $enclosure[2] ) ) . '" />' . "\n" );
}
}
}

View File

@@ -2561,8 +2561,9 @@ function get_allowed_mime_types( $user = null ) {
if ( function_exists( 'current_user_can' ) )
$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
if ( empty( $unfiltered ) )
unset( $t['htm|html'] );
if ( empty( $unfiltered ) ) {
unset( $t['htm|html'], $t['js'] );
}
/**
* Filters list of allowed mime types and file extensions.

View File

@@ -703,7 +703,7 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
*/
$output = __( 'html_lang_attribute' );
if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {
$output = get_locale();
$output = is_admin() ? get_user_locale() : get_locale();
$output = str_replace( '_', '-', $output );
}
break;
@@ -3568,12 +3568,14 @@ function get_language_attributes( $doctype = 'html' ) {
if ( function_exists( 'is_rtl' ) && is_rtl() )
$attributes[] = 'dir="rtl"';
if ( $lang = get_bloginfo('language') ) {
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
$attributes[] = "lang=\"$lang\"";
if ( $lang = get_bloginfo( 'language' ) ) {
if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
}
if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
$attributes[] = "xml:lang=\"$lang\"";
if ( get_option( 'html_type' ) != 'text/html' || $doctype == 'xhtml' ) {
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
}
}
$output = implode(' ', $attributes);

File diff suppressed because one or more lines are too long

View File

@@ -357,7 +357,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1);
did_action( 'init' ) && $scripts->add_inline_script( 'mediaelement-core', sprintf( 'var mejsL10n = %s;', wp_json_encode( array(
'language' => strtolower( str_replace( '_', '-', is_admin() ? get_user_locale() : get_locale() ) ),
'language' => strtolower( strtok( is_admin() ? get_user_locale() : get_locale(), '_-' ) ),
'strings' => array(
'mejs.install-flash' => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ),
'mejs.fullscreen-off' => __( 'Turn off Fullscreen' ),
@@ -476,10 +476,11 @@ function wp_default_scripts( &$scripts ) {
did_action( 'init' ) && $scripts->add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.l10n = %s;', wp_json_encode( array(
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
'saveError' => __( 'Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.' ),
'lintError' => wp_array_slice_assoc(
'lintError' => array(
/* translators: %d: error count */
_n_noop( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.' ),
array( 'singular', 'plural' )
'singular' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 1 ),
/* translators: %d: error count */
'plural' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
),
) ) ) );
@@ -580,16 +581,18 @@ function wp_default_scripts( &$scripts ) {
'videoHeaderNotice' => __( 'This theme doesn&#8217;t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
// Used for overriding the file types allowed in plupload.
'allowedFiles' => __( 'Allowed Files' ),
'customCssError' => wp_array_slice_assoc(
'customCssError' => array(
/* translators: %d: error count */
_n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
array( 'singular', 'plural' )
'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),
/* translators: %d: error count */
'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
),
'pageOnFrontError' => __( 'Homepage and posts page must be different.' ),
'saveBlockedError' => wp_array_slice_assoc(
'saveBlockedError' => array(
/* translators: %s: number of invalid settings */
_n_noop( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.' ),
array( 'singular', 'plural' )
'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),
/* translators: %s: number of invalid settings */
'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
),
'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),

View File

@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-RC2-42125';
$wp_version = '4.9.1';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
@@ -18,7 +18,7 @@ $wp_db_version = 38590;
*
* @global string $tinymce_version
*/
$tinymce_version = '4607-20170918';
$tinymce_version = '4607-20171116';
/**
* Holds the required PHP version

View File

@@ -80,16 +80,49 @@ class WP_Widget_Custom_HTML extends WP_Widget {
add_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) );
}
/**
* Filter gallery shortcode attributes.
*
* Prevents all of a site's attachments from being shown in a gallery displayed on a
* non-singular template where a $post context is not available.
*
* @since 4.9.0
*
* @param array $attrs Attributes.
* @return array Attributes.
*/
public function _filter_gallery_shortcode_attrs( $attrs ) {
if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
$attrs['id'] = -1;
}
return $attrs;
}
/**
* Outputs the content for the current Custom HTML widget instance.
*
* @since 4.8.1
*
* @global WP_Post $post
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current Custom HTML widget instance.
*/
public function widget( $args, $instance ) {
global $post;
// Override global $post so filters (and shortcodes) apply in a consistent context.
$original_post = $post;
if ( is_singular() ) {
// Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).
$post = get_queried_object();
} else {
// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.
$post = null;
}
// Prevent dumping out all attachments from the media library.
add_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
$instance = array_merge( $this->default_instance, $instance );
@@ -118,6 +151,10 @@ class WP_Widget_Custom_HTML extends WP_Widget {
*/
$content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
// Restore post global.
$post = $original_post;
remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
// Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.
$args['before_widget'] = preg_replace( '/(?<=\sclass=["\'])/', 'widget_text ', $args['before_widget'] );
@@ -175,10 +212,11 @@ class WP_Widget_Custom_HTML extends WP_Widget {
wp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.init( %s );', wp_json_encode( $settings ) ), 'after' );
$l10n = array(
'errorNotice' => wp_array_slice_assoc(
'errorNotice' => array(
/* translators: %d: error count */
_n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
array( 'singular', 'plural' )
'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),
/* translators: %d: error count */
'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
),
);
wp_add_inline_script( 'custom-html-widgets', sprintf( 'jQuery.extend( wp.customHtmlWidgets.l10n, %s );', wp_json_encode( $l10n ) ), 'after' );

View File

@@ -178,6 +178,24 @@ class WP_Widget_Text extends WP_Widget {
return false;
}
/**
* Filter gallery shortcode attributes.
*
* Prevents all of a site's attachments from being shown in a gallery displayed on a
* non-singular template where a $post context is not available.
*
* @since 4.9.0
*
* @param array $attrs Attributes.
* @return array Attributes.
*/
public function _filter_gallery_shortcode_attrs( $attrs ) {
if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
$attrs['id'] = -1;
}
return $attrs;
}
/**
* Outputs the content for the current Text widget instance.
*
@@ -221,13 +239,19 @@ class WP_Widget_Text extends WP_Widget {
remove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
}
// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context.
$suspended_post = null;
if ( isset( $post ) ) {
$suspended_post = $post;
// Override global $post so filters (and shortcodes) apply in a consistent context.
$original_post = $post;
if ( is_singular() ) {
// Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).
$post = get_queried_object();
} else {
// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.
$post = null;
}
// Prevent dumping out all attachments from the media library.
add_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
/**
* Filters the content of the Text widget.
*
@@ -278,9 +302,8 @@ class WP_Widget_Text extends WP_Widget {
}
// Restore post global.
if ( isset( $suspended_post ) ) {
$post = $suspended_post;
}
$post = $original_post;
remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
// Undo suspension of legacy plugin-supplied shortcode handling.
if ( $should_suspend_legacy_shortcode_support ) {

View File

@@ -1643,14 +1643,21 @@ class wpdb {
$socket = null;
$is_ipv6 = false;
// First peel off the socket parameter from the right, if it exists.
$socket_pos = strpos( $host, ':/' );
if ( $socket_pos !== false ) {
$socket = substr( $host, $socket_pos + 1 );
$host = substr( $host, 0, $socket_pos );
}
// We need to check for an IPv6 address first.
// An IPv6 address will always contain at least two colons.
if ( substr_count( $host, ':' ) > 1 ) {
$pattern = '#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port>[\d]+))?(?:/(?<socket>.+))?#';
$pattern = '#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port>[\d]+))?#';
$is_ipv6 = true;
} else {
// We seem to be dealing with an IPv4 address.
$pattern = '#^(?<host>[^:/]*)(?::(?<port>[\d]+))?(?::(?<socket>.+))?#';
$pattern = '#^(?<host>[^:/]*)(?::(?<port>[\d]+))?#';
}
$matches = array();
@@ -1662,7 +1669,7 @@ class wpdb {
}
$host = '';
foreach ( array( 'host', 'port', 'socket' ) as $component ) {
foreach ( array( 'host', 'port' ) as $component ) {
if ( ! empty( $matches[ $component ] ) ) {
$$component = $matches[ $component ];
}