Commit Graph

11469 Commits

Author SHA1 Message Date
Sergey Biryukov
3c4df552ca Docs: Correct $attachment parameter type for wp_prepare_attachment_for_js filter.
Props danielbachhuber.
Fixes #42449.
Built from https://develop.svn.wordpress.org/trunk@42345


git-svn-id: http://core.svn.wordpress.org/trunk@42174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-01 03:30:47 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Gary Pendergast
62be7ad218 Tests: Fix a couple of weirdly formatted comments.
See #41057.


Built from https://develop.svn.wordpress.org/trunk@42342


git-svn-id: http://core.svn.wordpress.org/trunk@42171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 16:23:53 +00:00
John Blackbourn
67d03a98c2 Hardening: Remove the ability to upload JavaScript files for users who do not have the unfiltered_html capability.
Built from https://develop.svn.wordpress.org/trunk@42261


git-svn-id: http://core.svn.wordpress.org/trunk@42090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 16:00:48 +00:00
John Blackbourn
f1de7e42df Hardening: Ensure the attributes of enclosures are correctly escaped in RSS and Atom feeds.
Built from https://develop.svn.wordpress.org/trunk@42260


git-svn-id: http://core.svn.wordpress.org/trunk@42089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 15:56:48 +00:00
John Blackbourn
3713ac5ebc Hardening: Add escaping to the language attributes used on html elements.
Built from https://develop.svn.wordpress.org/trunk@42259


git-svn-id: http://core.svn.wordpress.org/trunk@42088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 15:55:47 +00:00
John Blackbourn
eaf1cfdc1f Hardening: Use a properly generated hash for the newbloguser key instead of a determinate substring.
Built from https://develop.svn.wordpress.org/trunk@42258


git-svn-id: http://core.svn.wordpress.org/trunk@42087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 15:52:50 +00:00
Sergey Biryukov
ca6f54cfce Users: After [42256], remove unnecessary double quotes around first_name and last_name properties.
See #42713.
Built from https://develop.svn.wordpress.org/trunk@42257


git-svn-id: http://core.svn.wordpress.org/trunk@42086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 15:28:53 +00:00
Dion Hulse
05d60f74ed Users: Display partial names in the user listing tables.
This allows showing a name when only the first or last name is provided.

Props shital-patel, antipole.
Fixes #42713.

Built from https://develop.svn.wordpress.org/trunk@42256


git-svn-id: http://core.svn.wordpress.org/trunk@42085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 03:41:46 +00:00
Drew Jaynes
b17405c3fe General: Add complete test coverage for WP_Error.
See #42742.

Built from https://develop.svn.wordpress.org/trunk@42255


git-svn-id: http://core.svn.wordpress.org/trunk@42084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 02:19:48 +00:00
John Blackbourn
d8a995fc15 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

Built from https://develop.svn.wordpress.org/trunk@42251


git-svn-id: http://core.svn.wordpress.org/trunk@42080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 14:52:51 +00:00
Ryan McCue
9b68e59534 REST API: Ensure rest_url() consistently has leading slash.
`rest_url()` inconsistent addes slashes to the passed path depending on whether the site has pretty permalinks enabled. Apart from being inconsistent, this also caused the unit tests to fail when pretty permalinks are enabled.

Props frank-klein.
Fixes #42452. See #41451.

Built from https://develop.svn.wordpress.org/trunk@42250


git-svn-id: http://core.svn.wordpress.org/trunk@42079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 07:10:46 +00:00
Gary Pendergast
882db52bdd General: Add inline PHPCS options to leave regex indentation.
We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the `Squiz.Strings.ConcatenationSpacing.PaddingFound` rule for these blocks stops the extra whitespace from being removed.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42249


git-svn-id: http://core.svn.wordpress.org/trunk@42078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 04:24:57 +00:00
Dion Hulse
58a904e893 Theme Editor: Translate the URL to the Child Themes Codex page.
Props odysseygate, johnpgreen.
Fixes #42454.

Built from https://develop.svn.wordpress.org/trunk@42247


git-svn-id: http://core.svn.wordpress.org/trunk@42076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:52:47 +00:00
Dion Hulse
271e08a26e Theme Editior: Base the nonce on a simpler combination of fields, for easier debugging & reading.
See #42609.
Fixes #42705.

Built from https://develop.svn.wordpress.org/trunk@42246


git-svn-id: http://core.svn.wordpress.org/trunk@42075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:44:47 +00:00
Dion Hulse
daacc37405 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.

Fixes #42609.

Built from https://develop.svn.wordpress.org/trunk@42244


git-svn-id: http://core.svn.wordpress.org/trunk@42073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 03:28:48 +00:00
Dion Hulse
28677d382d 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].
See #6531.
Fixes #42573.

Built from https://develop.svn.wordpress.org/trunk@42242


git-svn-id: http://core.svn.wordpress.org/trunk@42071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-27 02:59:47 +00:00
Gary Pendergast
c90cfa3b50 General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42228


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Dion Hulse
611c090b41 Docs: Update the documentation for get_post_meta() to clarify that $single has no effect when the $meta_key is not provided.
Props chetan200891, titodevera.
Fixes #42687.

Built from https://develop.svn.wordpress.org/trunk@42227


git-svn-id: http://core.svn.wordpress.org/trunk@42056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 03:17:54 +00:00
Dion Hulse
b33967cd31 WPDB: Fix the parsing of sockets which contain colons within the socket name (used on some cloud providers).
Props natacado.
Fixes #42634 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42226


git-svn-id: http://core.svn.wordpress.org/trunk@42055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-24 05:52:46 +00:00
Dion Hulse
5342b33a0b Template: Don't output an empty <ul> in the_meta() when a post only has protected metas.
Props campusboy1987, birgire.
Fixes #42629.

Built from https://develop.svn.wordpress.org/trunk@42225


git-svn-id: http://core.svn.wordpress.org/trunk@42054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-24 05:21:51 +00:00
Dion Hulse
4073743527 Filesystem: Use a more unique filename in wp_tempnam() and get_filesystem_method().
Using a filename which was generated from `time()` could cause two processes to try to use the same filename, causing unexpected behaviour.

Props jrchamp, bikecrazyy.
Fixes #42265.

Built from https://develop.svn.wordpress.org/trunk@42224


git-svn-id: http://core.svn.wordpress.org/trunk@42053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-24 03:05:50 +00:00
Weston Ruter
e0b4933fdb Themes: Prevent JS error on Themes admin screen when only one theme is installed.
Amends [42029].
Props chetan200891, afercia.
See #42348.
Fixes #42673.

Built from https://develop.svn.wordpress.org/trunk@42222


git-svn-id: http://core.svn.wordpress.org/trunk@42051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 19:29:46 +00:00
John Blackbourn
8c7bb9009c 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

Built from https://develop.svn.wordpress.org/trunk@42220


git-svn-id: http://core.svn.wordpress.org/trunk@42049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 19:04:46 +00:00
Gary Pendergast
871c6d2b45 Setup: Allow for wp-config-sample.php to be formatted according to coding standards.
When the setup process reads `wp-config-sample.php`, it assumes that there are no spaces inside the brackes of the `define()`s. Unfortunately, this doesn't match our coding standards, so will no longer work correctly once we start enforcing them.

This also improves coding standards of the generated `wp-config.php` file.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42218


git-svn-id: http://core.svn.wordpress.org/trunk@42047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 05:23:50 +00:00
Gary Pendergast
a779284c00 General: Reformat inline if () statements inside HTML tags.
This pattern occurs a handful of times across the codebase:

`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`

Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42217


git-svn-id: http://core.svn.wordpress.org/trunk@42046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 04:09:49 +00:00
John Blackbourn
850532fb01 Cron API: Improvements to docblocks for the event scheduling functions.
See #42505

Built from https://develop.svn.wordpress.org/trunk@42216


git-svn-id: http://core.svn.wordpress.org/trunk@42045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-22 15:16:47 +00:00
Dion Hulse
27116397c5 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.
Fixes #42628 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42214


git-svn-id: http://core.svn.wordpress.org/trunk@42043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 04:15:47 +00:00
Boone Gorges
2322b40358 Introduce meta_box_sanitize_cb taxonomy argument.
The `meta_box_cb` argument was introduced in [25572] to allow plugin
authors to provide a custom callback for rendering their taxonomy's meta
box on the post edit screen. However, the routine used to handle the saving
of these custom taxonomy meta boxes was not customizable, but was instead
based simply on whether the taxonomy was hierarchicaly. See [13535].

The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
non-hierarchical taxonomies and the "category" routine for hierarchical ones,
thereby maintaining the current default behavior. Developers can override this
when the data passed from their `meta_box_cb` differs.

Props boonebgorges, ZaneMatthew, stephenharris.
Fixes #36514.
Built from https://develop.svn.wordpress.org/trunk@42211


git-svn-id: http://core.svn.wordpress.org/trunk@42040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 03:15:50 +00:00
Felix Arntz
d14a2988e7 Multisite: Fix broken update blog_versions query after [41661].
Props Mista-Flo, lenasterg.
Fixes #42641.

Built from https://develop.svn.wordpress.org/trunk@42210


git-svn-id: http://core.svn.wordpress.org/trunk@42039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 23:46:48 +00:00
Boone Gorges
d86fe35b7f Improve data types returned from empty hierarchical term queries.
When querying for 'count', ensure that 0 is returned. Otherwise,
ensure that it's an array.

Props xParham, birgire.
Fixes #42327.
Built from https://develop.svn.wordpress.org/trunk@42209


git-svn-id: http://core.svn.wordpress.org/trunk@42038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 22:46:47 +00:00
John Blackbourn
aed08a0f25 HTTP API: Add a WP_Http class constant for the HTTP status code 301.
Fixes #42490

Built from https://develop.svn.wordpress.org/trunk@42208


git-svn-id: http://core.svn.wordpress.org/trunk@42037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 20:54:49 +00:00
John Blackbourn
6e39468def HTTP API: Add support for a description for HTTP status code 103.
Props Dhruvin

Fixes #42490

Built from https://develop.svn.wordpress.org/trunk@42207


git-svn-id: http://core.svn.wordpress.org/trunk@42036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 20:35:48 +00:00
John Blackbourn
bb5621a084 General: Pass on the return value from wp_redirect() for wp_safe_redirect().
This brings the behaviour of the two functions in line with each other.

Props Drivingralle

Fixes 42108

Built from https://develop.svn.wordpress.org/trunk@42206


git-svn-id: http://core.svn.wordpress.org/trunk@42035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 20:24:48 +00:00
Dion Hulse
71bdb1635b DB Repair: Only allow non-falsey values of WP_ALLOW_REPAIR to access the DB repair functionality.
This allows defining the constant as `false` to prevent access (rather than requiring the constant to be removed entirely).

Props tiagohillebrandt, munklefish.
See #11717.
Fixes #42622.

Built from https://develop.svn.wordpress.org/trunk@42205


git-svn-id: http://core.svn.wordpress.org/trunk@42034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 06:21:52 +00:00
John Blackbourn
4ef018df2b Docs: Correct the @since property for the page_attributes_misc_attributes action.
Props jeremyescott, jfarthing84

Fixes #42607

Built from https://develop.svn.wordpress.org/trunk@42203


git-svn-id: http://core.svn.wordpress.org/trunk@42033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-19 11:52:52 +00:00
Felix Arntz
d9e4fc273d Multisite: Do not show edit links in network users table for users that cannot be edited.
Props ocean90.
Fixes #42552.

Built from https://develop.svn.wordpress.org/trunk@42202


git-svn-id: http://core.svn.wordpress.org/trunk@42032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-17 21:35:51 +00:00
Dion Hulse
24b1297fab Remove the svn:keywords property from files that don't need it.
See #42594

Built from https://develop.svn.wordpress.org/trunk@42201


git-svn-id: http://core.svn.wordpress.org/trunk@42031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-17 03:01:47 +00:00
Dion Hulse
cf14a9432c Remove the svn:executable property from files that don't need it.
See #42594

Built from https://develop.svn.wordpress.org/trunk@42200


git-svn-id: http://core.svn.wordpress.org/trunk@42030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-17 02:58:45 +00:00
Sergey Biryukov
1a5adcf722 Rewrite Rules: Correct the logic in extract_from_markers() after [41928].
Props stodorovic.
Fixes #42579. See #39920.
Built from https://develop.svn.wordpress.org/trunk@42199


git-svn-id: http://core.svn.wordpress.org/trunk@42029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-16 13:25:50 +00:00
Weston Ruter
5749295a59 Editor: Re-build tinymce.min.js after [42191].
See #42553.

Built from https://develop.svn.wordpress.org/trunk@42193


git-svn-id: http://core.svn.wordpress.org/trunk@42023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 23:35:49 +00:00
Weston Ruter
5cab65edab 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42191


git-svn-id: http://core.svn.wordpress.org/trunk@42021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 18:59:47 +00:00
Weston Ruter
f4e974057e 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42189


git-svn-id: http://core.svn.wordpress.org/trunk@42019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 18:29:46 +00:00
Weston Ruter
9fabdfb212 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42187


git-svn-id: http://core.svn.wordpress.org/trunk@42017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 18:12:53 +00:00
Weston Ruter
ee126d2567 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42185


git-svn-id: http://core.svn.wordpress.org/trunk@42015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 02:27:48 +00:00
Weston Ruter
9986ebdc0b 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42183


git-svn-id: http://core.svn.wordpress.org/trunk@42013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-15 00:21:48 +00:00
Weston Ruter
6c64136035 About Page: Fix issue with overlapping images and text on IE11 and Edge 15.
Props Clorith, ryelle, afercia, la-geek, SergeyBiryukov.
See #42514.
Fixes #42545.

Built from https://develop.svn.wordpress.org/trunk@42181


git-svn-id: http://core.svn.wordpress.org/trunk@42011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 23:02:48 +00:00
Peter Wilson
fc0f64e1ef 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.


Built from https://develop.svn.wordpress.org/trunk@42177


git-svn-id: http://core.svn.wordpress.org/trunk@42007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 05:24:47 +00:00
Gary Pendergast
5dab6b6e61 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.

Fixes #42530.


Built from https://develop.svn.wordpress.org/trunk@42175


git-svn-id: http://core.svn.wordpress.org/trunk@42005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-14 05:19:49 +00:00
Weston Ruter
54a2c0dd1f About: Fix jumping behavior for titles and columns when scrolling.
Props ryelle.
See #42087.
Fixes #42514, #42526.

Built from https://develop.svn.wordpress.org/trunk@42173


git-svn-id: http://core.svn.wordpress.org/trunk@42003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:47:58 +00:00
Weston Ruter
e484b66335 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.

Built from https://develop.svn.wordpress.org/trunk@42171


git-svn-id: http://core.svn.wordpress.org/trunk@42001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:46:34 +00:00
Weston Ruter
609c0db668 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.

Built from https://develop.svn.wordpress.org/trunk@42169


git-svn-id: http://core.svn.wordpress.org/trunk@41999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 22:45:11 +00:00
Boone Gorges
2f95f44008 Correct documentation for status param of WP_Comment_Query.
The `status` parameter accepts an array or string/comma-separated list.

Introduced in [30084].

Props pbiron.
Fixes #41338.
Built from https://develop.svn.wordpress.org/trunk@42165


git-svn-id: http://core.svn.wordpress.org/trunk@41996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 16:26:47 +00:00
Weston Ruter
4e320fe008 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42163


git-svn-id: http://core.svn.wordpress.org/trunk@41994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-13 07:08:47 +00:00
Weston Ruter
6d2bf4398c 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42161


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

Built from https://develop.svn.wordpress.org/trunk@42159


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

Built from https://develop.svn.wordpress.org/trunk@42157


git-svn-id: http://core.svn.wordpress.org/trunk@41988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-12 19:59:53 +00:00
Weston Ruter
2aa2c686d4 Theme Editor: Fix styling of child theme notice.
Props westonruter, melchoyce, ndiego.
See #24048.
Fixes #42491 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42155


git-svn-id: http://core.svn.wordpress.org/trunk@41986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-11 20:43:53 +00:00
Weston Ruter
826c589f11 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42153


git-svn-id: http://core.svn.wordpress.org/trunk@41984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 23:41:53 +00:00
Weston Ruter
e86536afc9 Customize: Prevent nav menu location assignment checkbox change from increasing height by 1px.
Props obenland.
Amends [41817].
See #42157.
Fixes #42492.

Built from https://develop.svn.wordpress.org/trunk@42152


git-svn-id: http://core.svn.wordpress.org/trunk@41983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 23:01:48 +00:00
John Blackbourn
67c973f95e Docs: Correct parameter type documentation for various __call() methods.
See #42505

Built from https://develop.svn.wordpress.org/trunk@42151


git-svn-id: http://core.svn.wordpress.org/trunk@41982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:56:47 +00:00
Weston Ruter
6c6d112e74 Customize: Improve accuracy of message displayed when accessing Customizer with a changeset that is already published or trashed.
Amends [38810].
Props dlh.
Fixes #42497.

Built from https://develop.svn.wordpress.org/trunk@42150


git-svn-id: http://core.svn.wordpress.org/trunk@41981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:51:46 +00:00
Weston Ruter
016a3f9ecd 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42148


git-svn-id: http://core.svn.wordpress.org/trunk@41979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:44:52 +00:00
Weston Ruter
10ac2ccd3a 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42146


git-svn-id: http://core.svn.wordpress.org/trunk@41977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:30:56 +00:00
Weston Ruter
9db496159e 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42144


git-svn-id: http://core.svn.wordpress.org/trunk@41975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 21:44:55 +00:00
John Blackbourn
3be5d4b4f0 Docs: Improve inline docs for the wp_redirect() and wp_safe_redirect() functions.
See #42505, #42108

Built from https://develop.svn.wordpress.org/trunk@42143


git-svn-id: http://core.svn.wordpress.org/trunk@41974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 13:44:47 +00:00
Gary Pendergast
e8229a25d5 REST API: Add permalink_structure to the index endpoint.
This allows Gutenberg to implement permalink editing.

Props schlessera.
Fixes #42465.


Built from https://develop.svn.wordpress.org/trunk@42142


git-svn-id: http://core.svn.wordpress.org/trunk@41973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 06:11:51 +00:00
Weston Ruter
4bf8081e64 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.

Built from https://develop.svn.wordpress.org/trunk@42140


git-svn-id: http://core.svn.wordpress.org/trunk@41971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 01:28:49 +00:00
Weston Ruter
1ee26acf95 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 trunk.

Built from https://develop.svn.wordpress.org/trunk@42138


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

Built from https://develop.svn.wordpress.org/trunk@42136


git-svn-id: http://core.svn.wordpress.org/trunk@41967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 04:15:49 +00:00
Weston Ruter
6c00350575 Settings: Fix date/time format previewing.
Props afercia.
Amends [41857].
Fixes #41603.

Built from https://develop.svn.wordpress.org/trunk@42134


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

Built from https://develop.svn.wordpress.org/trunk@42132


git-svn-id: http://core.svn.wordpress.org/trunk@41963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-09 01:02:47 +00:00
Gary Pendergast
39a3fe9180 Admin Bar: Fix another HTML error introduced in [42128].
Props Otto42.
See #41057.


Built from https://develop.svn.wordpress.org/trunk@42131


git-svn-id: http://core.svn.wordpress.org/trunk@41962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-08 23:13:46 +00:00
Dion Hulse
0a81bcf4ff External Libraries: Update Random_Compat from 1.2.1 to 2.0.11.
Notably this fixes PHP7 parse errors of the files and removes the OpenSSL functionality.
Full Changes: https://github.com/paragonie/random_compat/compare/v1.2.1...v2.0.11

Props jrdelarosa.
See #42439.

Built from https://develop.svn.wordpress.org/trunk@42130


git-svn-id: http://core.svn.wordpress.org/trunk@41961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-08 11:48:49 +00:00
Gary Pendergast
e822e4578a Admin Bar: Fix a HTML error introduced in [42128].
Props swissspidy.
See #41057.


Built from https://develop.svn.wordpress.org/trunk@42129


git-svn-id: http://core.svn.wordpress.org/trunk@41960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-08 08:52:48 +00:00
Gary Pendergast
bde3b95936 Admin Bar: Reformat the render methods.
The admin bar render methods use some cute tricks which don't come close to the WordPress coding standards. So that we can more easily apply automated code fixing to the codebase, these tricks need to be removed.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42128


git-svn-id: http://core.svn.wordpress.org/trunk@41959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-08 08:35:51 +00:00
Weston Ruter
d7b49bbc3e Trunk is now 5.0-alpha
Built from https://develop.svn.wordpress.org/trunk@42127


git-svn-id: http://core.svn.wordpress.org/trunk@41958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 05:47:51 +00:00
Weston Ruter
59fdb7a220 Post WordPress 4.9 RC2 bump.
Built from https://develop.svn.wordpress.org/trunk@42125


git-svn-id: http://core.svn.wordpress.org/trunk@41956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 05:26:47 +00:00
Weston Ruter
f76b491135 WordPress 4.9 RC2.
Built from https://develop.svn.wordpress.org/trunk@42124


git-svn-id: http://core.svn.wordpress.org/trunk@41955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 04:54:47 +00:00
Konstantin Obenland
4eda9c7388 About: Hardcoded image sources.
We're committed to these images now.

See #42087.

Built from https://develop.svn.wordpress.org/trunk@42123


git-svn-id: http://core.svn.wordpress.org/trunk@41954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 04:26:48 +00:00
Weston Ruter
e4fe01e2b4 Customize: Fix logic inversion in [42113] which prevented themes from being installed in Customizer.
Also fix PHP notice related to parent themes and WordPress.org theme query results.

Props dd32, obenland, celloexpressions, westonruter, atachibana for testing.
See #42406, #37661.
Fixes #42442.

Built from https://develop.svn.wordpress.org/trunk@42122


git-svn-id: http://core.svn.wordpress.org/trunk@41953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 04:17:47 +00:00
Mel Choyce
2382232692 About Page: Implement design.
Props ryelle, karmatosed, transl8or, obenland, melchoyce.
See #42087.

Built from https://develop.svn.wordpress.org/trunk@42121


git-svn-id: http://core.svn.wordpress.org/trunk@41952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 04:11:47 +00:00
Gary Pendergast
8255d04abb WPDB: Check that AUTH_SALT is not empty.
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` defaults to `AUTH_SALT`, but `hash_hmac()` will return an empty string if the key is empty.

This had the side effect of the string `{}` being incorrectly replaced with a `%` character in queries just about to be run on the database.

Props jsonfry.
Fixes #42431.


Built from https://develop.svn.wordpress.org/trunk@42120


git-svn-id: http://core.svn.wordpress.org/trunk@41949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 01:09:47 +00:00
Gary Pendergast
002d65112f WPDB: Fix a PHP notice when AUTH_SALT is undefined.
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` falls back to `rand()` when `AUTH_SALT` is undefined. `hash_hmac()` requires the key to be a string, however, so we need to cast it as such.

Props mkomar.
Fixes #42401.


Built from https://develop.svn.wordpress.org/trunk@42119


git-svn-id: http://core.svn.wordpress.org/trunk@41948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-07 00:30:46 +00:00
Weston Ruter
a74afff787 Customize: Prevent customize_autosaved=on from getting added to frontend preview URLs.
Amends [41969].
See #39896, #42450.
Fixes #42433.

Built from https://develop.svn.wordpress.org/trunk@42118


git-svn-id: http://core.svn.wordpress.org/trunk@41947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-06 23:11:53 +00:00
Weston Ruter
c15b2a0908 Customize: Fall back to ISO date format for date/time control inputs if year, month, or day are missing from the date_format option.
Amends [42111].
Props dlh, westonruter.
Fixes #42394.

Built from https://develop.svn.wordpress.org/trunk@42117


git-svn-id: http://core.svn.wordpress.org/trunk@41946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-06 20:28:48 +00:00
John Blackbourn
b8de3548d3 Administration: Ensure the new Privacy Policy screen appears when within the Network Admin and User Admin.
Props hnle, dd32
Fixes #42443

Built from https://develop.svn.wordpress.org/trunk@42116


git-svn-id: http://core.svn.wordpress.org/trunk@41945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-06 18:17:54 +00:00
Konstantin Obenland
65c1468ff5 File Editors: Account for network admin use
Fixes a bug where files couldn't be accessed in multisite installs.

Props flixos90, westonruter.
Fixes #42420.


Built from https://develop.svn.wordpress.org/trunk@42115


git-svn-id: http://core.svn.wordpress.org/trunk@41944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-03 18:51:49 +00:00
Weston Ruter
76e01c3562 Customize: Ensure changeset_uuid param for autosave auto-draft gets stripped from location after previewing theme switch when not in branching mode.
Amends [41597].
See #39896.
Fixes #42415.

Built from https://develop.svn.wordpress.org/trunk@42114


git-svn-id: http://core.svn.wordpress.org/trunk@41943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-03 17:37:52 +00:00
Weston Ruter
d0608c5585 Customize: Make sure theme switch blocking in the Customizer is consistently applied when changeset is drafted/scheduled.
* Consider both `selectedChangesetStatus` and `changesetStatus` states when deciding to disable.
* Factor out common logic into `canSwitchTheme` function on `ThemesPanel`.
* Keep Live Preview and Install buttons disabled in Themes controls and detail overlays when appropriate.

Props westonruter, dlh.
Amends [41788].
See #42126, #37661, #39896.
Fixes #42406.

Built from https://develop.svn.wordpress.org/trunk@42113


git-svn-id: http://core.svn.wordpress.org/trunk@41942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-03 00:59:47 +00:00
Weston Ruter
83c29a4d08 Theme Editor: Ensure files listed recursively can be both viewed and edited.
Prevent edits to 2-level deep theme files from returning a `disallowed_theme_file` error when attempting to save an edit. Aligns logic for gathering `$allowed_files` in `theme-editor.php` for listing files with the validation logic in `wp_edit_theme_plugin_file()`.

Amends [41806].
See #6531.
Fixes #42425.

Built from https://develop.svn.wordpress.org/trunk@42112


git-svn-id: http://core.svn.wordpress.org/trunk@41941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 23:05:48 +00:00
Weston Ruter
ef272167c4 Customize: Present the date/time control input fields in the same format (and order) as date_format.
Props westonruter, obenland, atachibana for testing, Mirucon for testing.
See #42373, #28721.
Fixes #42394.

Built from https://develop.svn.wordpress.org/trunk@42111


git-svn-id: http://core.svn.wordpress.org/trunk@41940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 23:00:49 +00:00
Konstantin Obenland
99c19a5a82 Codemirror: Unify line endings in csslint.js
This is likely a problem caused upstream and will probably be a non-issue once #41870 is merged in a future release.

Fixes #42424.


Built from https://develop.svn.wordpress.org/trunk@42110


git-svn-id: http://core.svn.wordpress.org/trunk@41939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 22:31:47 +00:00
Weston Ruter
8902ddba18 Customize: Always use underlying changeset post date as initial date in scheduled date fields if date is future.
Prevent user from having to re-enter the previously-supplied future date if they had switched from schedule to draft but wanted to switch back again. Improves parity with behavior of post edit screen.

Props dlh, westonruter, obenland.
See #39896, #28721.
Fixes #42413.

Built from https://develop.svn.wordpress.org/trunk@42109


git-svn-id: http://core.svn.wordpress.org/trunk@41938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 20:00:48 +00:00
Weston Ruter
fbee634ac7 Customize: Prevent history.replaceState() and history.pushState() calls from causing error in customize preview before DOM ready.
Amends [41597].
See #39896.
Fixes #42414.

Built from https://develop.svn.wordpress.org/trunk@42108


git-svn-id: http://core.svn.wordpress.org/trunk@41937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 19:27:47 +00:00
Weston Ruter
5f16c57782 Customize: Prevent re-importing starter content when changeset is saved as draft or scheduled.
Themes cannot currently be switched in Customizer after changeset is saved anyway.

Props dlh, westonruter.
See #40146, #42411, #42126.
Fixes #42395.

Built from https://develop.svn.wordpress.org/trunk@42107


git-svn-id: http://core.svn.wordpress.org/trunk@41936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 19:00:54 +00:00
Weston Ruter
7deb33b386 Bundled Themes: Fix fragile update-theme phpunit test which broke after version updates in [42105].
See #42090.

Built from https://develop.svn.wordpress.org/trunk@42106


git-svn-id: http://core.svn.wordpress.org/trunk@41935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 01:26:48 +00:00
David A. Kennedy
7b74056cf5 Bundled Themes: Bump version numbers and update changelogs for 4.9 release
* Also, updates POT files for Twenty Ten and Twenty Eleven.

Props lemacarl, maedahbatool, mrahmadawais, davidakennedy.

Fixes #42090.

Built from https://develop.svn.wordpress.org/trunk@42105


git-svn-id: http://core.svn.wordpress.org/trunk@41934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-01 22:43:47 +00:00
Weston Ruter
926f2114f0 Customize: Strip zero padding when setting month to prevent de-selection; add zero-padding for number input fields when blurring.
Amends [42042].
See #42373.
Fixes #42392.

Built from https://develop.svn.wordpress.org/trunk@42104


git-svn-id: http://core.svn.wordpress.org/trunk@41933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-01 21:04:53 +00:00
Gary Pendergast
a2693fd860 Database: Restore numbered placeholders in wpdb::prepare().
[41496] removed support for numbered placeholders in queries send through `wpdb::prepare()`, which, despite being undocumented, were quite commonly used.

This change restores support for numbered placeholders (as well as a subset of placeholder formatting), while also adding extra checks to ensure the correct number of arguments are being passed to `wpdb::prepare()`, given the number of placeholders.

See #41925.


Built from https://develop.svn.wordpress.org/trunk@42056


git-svn-id: http://core.svn.wordpress.org/trunk@41885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 12:00:49 +00:00