Commit Graph

13750 Commits

Author SHA1 Message Date
SergeyBiryukov 10ad912128 Taxonomy: Don't display an empty edit link in taxonomy list table if the user doesn't have permissions to edit the term.
Props grapplerulrich.
Fixes #43146.

git-svn-id: https://develop.svn.wordpress.org/trunk@42565 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-23 11:33:26 +00:00
Dion Hulse 5110f349a9 WPDB: Use a PCRE syntax which supports PCRE compiled between 2003 and 2006.
This fixes a PHP Warning in `wpdb::parse_db_host()` when WordPress is used with (sometimes a modern) PHP that's compiled against an ancient PCRE version.

Fixes #43109 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42549 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-23 03:38:42 +00:00
Aaron Jorbin 5bb7fc10c5 Remove JSHint due to license compatibility
JSHint inherits a license from JSLint that includes the clause  "The Software shall be used for Good, not Evil." WordPress's license specifically allows grants the freedom to run the program, for any purpose. Please note, this is not an encouragement of evil. Rather than doing something evil, how about learning to love those around you. Instead of tweeting lies and saying people are "Not Good!", help your neighbor. In the words of Lin Manual Miranda, "Love is love is love is love is love is love is love is love, cannot be killed or swept aside." 

This replaces JSHint with esprima, a part of the larger jQuery project, and a custom wrapper for some basic error checking within codemirror.

The existing JSHint configuration is kept in place in case someone wants to use that, but they can only do so for Good.

Fixes #42850
Props netweb for a spelling fix on a comment.



git-svn-id: https://develop.svn.wordpress.org/trunk@42547 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-23 01:28:26 +00:00
Weston Ruter 4fb6c02b99 Widgets: Ensure media is explicitly enqueued from Text widget in case Media widgets are unregistered.
Amends [41344].
See #40854.
Fixes #43125.


git-svn-id: https://develop.svn.wordpress.org/trunk@42545 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 19:24:02 +00:00
Weston Ruter e2b25e6159 Customize: Let default status for Customizer be `draft` if user does not have capability to `publish`.
Amends [41626].
Props sayedwp, westonruter.
See #30937.
Fixes #42686.


git-svn-id: https://develop.svn.wordpress.org/trunk@42543 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 19:09:16 +00:00
Weston Ruter 026cd70e25 Customize: Prevent frontend previewing from causing a customization lock on the changeset.
Props dlh.
Amends [41839].
See #42024.
Fixes #42975.


git-svn-id: https://develop.svn.wordpress.org/trunk@42541 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 06:48:51 +00:00
Weston Ruter b5b05c51c6 Customize: Use changeset-specific "locked" messages when branching is enabled.
Props dlh.
See #39896.
Fixes #42655.


git-svn-id: https://develop.svn.wordpress.org/trunk@42538 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 06:27:41 +00:00
Weston Ruter f65c46cc50 Customize: Prevent showing SFTP theme installation notification in multisite when user cannot install themes.
Props flixos90.
See #37661, #42184.
Fixes #42674.


git-svn-id: https://develop.svn.wordpress.org/trunk@42536 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 06:14:10 +00:00
Weston Ruter 8ae0bc51be Widgets: Allow relative/partial URLs in Image Widget's link field.
Props audrasjb.
Amends [41252].
See #41274.
Fixes #42740.


git-svn-id: https://develop.svn.wordpress.org/trunk@42533 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-22 04:51:16 +00:00
Weston Ruter 10b459f8e8 Code Editor: Disable `attr-value-double-quotes` HTMLHint rule since too strict for user input.
Using single-quoted attribute values is not in any way invalid HTML.

Amends [41376].
Props sasiddiqui.
See #12423.
Fixes #42802.


git-svn-id: https://develop.svn.wordpress.org/trunk@42531 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-21 08:00:42 +00:00
Pascal Birchler 4fdd686e7b Formatting: Fix typo in inline documentation of `_deep_replace()`.
Props ixkaito.
Fixes #43134.


git-svn-id: https://develop.svn.wordpress.org/trunk@42530 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-20 13:31:46 +00:00
Andrew Ozz 29bc3920be Editor: change the test in `user_can_richedit()` to also detect when IE11 is in compatibility mode.
Props ndavison, azaozz.
Fixes #42503 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@42529 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-18 14:42:34 +00:00
Anton Timmermans 33cd11ecb6 Docs: Improve JSDoc for `password-strength-meter.js`.
Props herregroen, carolinegeven, ireneyoast, jjcomack.
Fixes #43066.


git-svn-id: https://develop.svn.wordpress.org/trunk@42528 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-18 13:38:26 +00:00
Dion Hulse 2cb36cab72 General: Allow `wp_list_pluck()` to operate on arrays of references without overwriting the referenced items.
Fixes #16895.


git-svn-id: https://develop.svn.wordpress.org/trunk@42527 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-18 05:17:23 +00:00
Sergey Biryukov 0baa8ae85c Media: In `_wp_handle_upload()`, check if the file was properly uploaded before checking its size.
Props achbed, dglingren.
Fixes #39522.

git-svn-id: https://develop.svn.wordpress.org/trunk@42525 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-17 07:15:57 +00:00
Sergey Biryukov 6c081d396a Editor: Use explicit context instead of a trailing space for `Edit` string in TinyMCE plugins.
Props scottlee, ayubadiputra, NathanAtmoz.
Fixes #42543.

git-svn-id: https://develop.svn.wordpress.org/trunk@42523 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-17 06:27:21 +00:00
Weston Ruter 505a939720 Widgets: Prevent `checkValidity` from running on a form when widget is first adding to sidebar.
Amends [41352].
See #23120.
Fixes #43003 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42521 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-17 01:23:39 +00:00
Andrea Fercia 9dd8b5a210 Plugins: Fix the plugin details modal "Close" button after [42443].
Props rinkuyadav999.
Fixes #43082.


git-svn-id: https://develop.svn.wordpress.org/trunk@42491 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 17:15:00 +00:00
Dion Hulse 4dbc0b3987 External Libraries: Remove unnecessary / obsoleted MediaElement.js files.
Props joemcgill.
Fixes #42720 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42462 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 06:27:48 +00:00
Sergey Biryukov 842b3a2378 Plugins: Update review filter links in Details modal.
Props darko-a7, afercia.
Fixes #43016. See #meta3379.

git-svn-id: https://develop.svn.wordpress.org/trunk@42459 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 00:14:48 +00:00
Sergey Biryukov 31ce230c58 Widgets: When checking for errors in Custom HTML widget, pass correct value to `toggleClass()` for Save button.
`toggleClass()` expects a boolean as a second argument, not an integer.

Props iCaleb.
Fixes #42867.

git-svn-id: https://develop.svn.wordpress.org/trunk@42457 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 23:46:02 +00:00
Sergey Biryukov 02ccaeed2c Media: Add `flac` to the list of allowed file types.
Props blobfolio.
Fixes #42225.

git-svn-id: https://develop.svn.wordpress.org/trunk@42451 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 22:16:33 +00:00
Sergey Biryukov fb5b617056 Media: Bring consistency to `getimagesize()` error suppression.
Props chasewg, joemcgill, jeremyfelt.
Fixes #42480.

git-svn-id: https://develop.svn.wordpress.org/trunk@42449 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 19:43:30 +00:00
Sergey Biryukov 0fdbb50a0e Themes: Improve line wrapping in feature filter on Theme Install screen and in the Customizer.
Props chetan200891 for initial patch.
Fixes #42871.

git-svn-id: https://develop.svn.wordpress.org/trunk@42447 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 19:26:47 +00:00
Andrew Ozz 40e6a33f2a TinyMCE: on the toolbar drop-downs apply overflow style on the actual element with text.
Props abdullahramzan, azaozz.
Fixes #43090 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@42446 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 09:50:15 +00:00
Andrea Fercia ae0995660c Accessibility: Media: Improve the usage of a few label elements in the media templates.
Label elements should only be used for labelable elements.
- `Uploaded By` and `Uploaded To` aren't form controls and shouldn't be associated with labels
- changes the labels for media source, alternate sources, poster image, and tracks to solve a layout issue and explicitly associate the labels to their form fields (previously, the labels were wrapping also the Remove buttons)

Props Presskopp, afercia.
Fixes #38759, #40468.


git-svn-id: https://develop.svn.wordpress.org/trunk@42444 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-14 16:38:47 +00:00
Andrea Fercia 9fb5b3bf10 Plugins: Fix the plugin details modal in the install plugin search tab after [41356].
Fixes #43082


git-svn-id: https://develop.svn.wordpress.org/trunk@42443 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-13 18:52:42 +00:00
Peter Wilson 2b56623d89 Formatting: Do not run formatting and texturization on author bios.
Removes the formatting and texturization added to author bios in #40040 due to back-compatibility concerns.

Reverts [41172], [41173].

Props 0x6f0, rabmalin for review.
Fixes #42578.



git-svn-id: https://develop.svn.wordpress.org/trunk@42441 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-13 01:10:56 +00:00
Andrea Fercia 1258d1d9d2 Accessibility: use `aria-current` for the paginated post links output by `wp_link_pages()`.
Continues the introduction in core of the aria-current attribute after [41683], [41359], and [41371].

- changes the `wp_link_pages()` (see the `nextpage` quicktag) output to use an `aria-current` attribute on the current item
- adds `post-nav-links` and `post-page-numbers` CSS classes to help themes style these links
- updates the related tests

Props antonioeatgoat, alexstine.
Fixes #41859.


git-svn-id: https://develop.svn.wordpress.org/trunk@42440 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-12 20:16:56 +00:00
Sergey Biryukov a8d74c4f4e Twenty Seventeen: Remove unnecessary comment in `front-page.php`.
Props hardik-amipara, poena.
Fixes #42820.

git-svn-id: https://develop.svn.wordpress.org/trunk@42437 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-12 20:00:14 +00:00
Anton Timmermans b9b2f2a79d Docs: Improve JS Docs for `controllers/customize-image-cropper.js`.
Props manuelaugustin, bramheijmink, andizer, ireneyoast.
Fixes #43020.


git-svn-id: https://develop.svn.wordpress.org/trunk@42435 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-11 14:31:14 +00:00
Dion Hulse 91b3164ee5 Upgrade: When deleting old files, if deletion fails attempt to empty the file instead.
Props joemcgill, dd32.
Fixes #42963 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42433 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-10 06:09:51 +00:00
Dion Hulse 70a92ca96e Streams: When checking in `wp_is_stream()` escape the stream wrapper names for PCRE to avoid PHP warnings when invalid stream wrappers are registered.
Fixes #43054.


git-svn-id: https://develop.svn.wordpress.org/trunk@42432 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-10 02:49:49 +00:00
Andrew Ozz 5e524200b4 Editor: ensure there is a selection before getting the caret position. Fixes a bug in Firefox when there is no selection for a hidden element.
Props johnschulz, azaozz.

Fixes #43012 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@42430 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-08 20:20:00 +00:00
Gary Pendergast 9cf7385eb3 Formatting: Fix capital_P_dangit() not capital P-ing, dangit.
Unfortunately, in my overzealous desire to fix all the un-capitalised Ps, [42343] capitalled some Ps that intentionally should not be capitals.

This commit fixes the incorrectly capitalling of Ps, as well as including unit tests and PHPCS instructions to ensure we never capitulate to capitalisationing them again.

Props superdav42.
Fixes #43040.
Fixes #43041.



git-svn-id: https://develop.svn.wordpress.org/trunk@42429 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-08 10:35:13 +00:00
Anton Timmermans 7f94931449 Docs: Improve JSDoc for `js/media-upload.js`.
Props terwdan, diedeexterkate, andizer, ireneyoast.
Fixes #42956.


git-svn-id: https://develop.svn.wordpress.org/trunk@42426 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-04 14:36:13 +00:00
Andrea Fercia f3d3254517 Editor: Link suggestions: add fallback title for posts with no title.
Fixes #42664.


git-svn-id: https://develop.svn.wordpress.org/trunk@42425 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-02 18:10:26 +00:00
Rachel Baker d91095f34a General: Update copyright year to 2018 in license.txt.
Fixes #43007.

git-svn-id: https://develop.svn.wordpress.org/trunk@42424 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-01 03:16:34 +00:00
Rachel Baker 24b3f5e77c REST API: Return the proper status code for failed permission callbacks in `WP_REST_Server->dispatch()`.
Use the `rest_authorization_required_code()` function to return a 401 status code when a permission callback fails due to a user not being logged in.

Props jaswrks.
Fixes #42828.

git-svn-id: https://develop.svn.wordpress.org/trunk@42421 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-30 20:36:25 +00:00
Rachel Baker 7567f588b3 Comments: Introduce filter for the arguments for the comment query in the comments list table.
Add `comments_list_table_query_args` filter to the Comments List Table.

Props soulseekah, birgire.
Fixes #42997.

git-svn-id: https://develop.svn.wordpress.org/trunk@42420 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-29 18:20:13 +00:00
Dion Hulse 581b74cbed WP: Don't attempt to convert multiple-nested arrays to a string in WP->parse_request().
See #14330.
Fixes #42752.


git-svn-id: https://develop.svn.wordpress.org/trunk@42419 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-22 03:17:14 +00:00
Boone Gorges 75f4438fe5 Taxonomy: Restore deprecated argument to `term_description()` signature.
This ensures that the parameter can't be reused for something else
in the future.

Props jorbin.
Fixes #42605.

git-svn-id: https://develop.svn.wordpress.org/trunk@42417 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-22 02:47:49 +00:00
Anton Timmermans 9c8d49456e Docs: Improve JSDoc for `customize-preview-widgets.js`.
Props ireneyoast, andizer, robinvandervliet, boblinthorst.
Fixes #42954.


git-svn-id: https://develop.svn.wordpress.org/trunk@42416 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-21 15:11:25 +00:00
Anton Timmermans 2c66a7db75 Docs: Improve JSDoc for `media/views/attachments.js`.
Props maartenleenders, herregroen, jipmoors, ireneyoast.
Fixes #42832.


git-svn-id: https://develop.svn.wordpress.org/trunk@42415 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-21 14:26:17 +00:00
Sergey Biryukov e553acf201 Docs: Remove erroneous zero-width space before URL in `fetch_feed()` DocBlock.
Props coffee2code.
Fixes #42951. See #meta3212.

git-svn-id: https://develop.svn.wordpress.org/trunk@42414 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-21 02:39:21 +00:00
Dion Hulse 64e3dc5bc8 i18n: Don't use `esc_attr_e()` on a variable.
Props yoavf.
Fuxes #42935.


git-svn-id: https://develop.svn.wordpress.org/trunk@42413 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-20 05:34:05 +00:00
John Blackbourn 2a9f696710 Docs: Improve the function and parameter descriptions for `do_meta_boxes()`.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42412 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-19 15:02:36 +00:00
Anton Timmermans bc35d72a63 Docs: Remove `@summary` tags from JSDoc.
As decided in the JavaScript core chat. With a few reasons:

* It is visually cleaner when reading the source.
* This bring the JavaScript documentation closer to the PHP documentation.

The only disadvantage is that the JSDoc parser doesn't split out the summary and the description in the new format. We've decided to solve this when building the JavaScript documentation parser.

Props herregroen.
Fixes #42901.


git-svn-id: https://develop.svn.wordpress.org/trunk@42411 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-18 14:13:58 +00:00
Anton Timmermans 05d60c580e Docs: Improve JSDoc for `js/media/controllers/edit-image.js`.
Amends r42392  - includes the built media files.


git-svn-id: https://develop.svn.wordpress.org/trunk@42410 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-18 11:19:02 +00:00
Sergey Biryukov fa5e8c13e7 Canonical: After [42408], remove `sprintf()` call for consistency with `Location` header.
See #42313.

git-svn-id: https://develop.svn.wordpress.org/trunk@42409 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-18 01:10:36 +00:00
Sergey Biryukov ab5222786a Canonical: Introduce `x_redirect_by` filter that allows applications to identify themselves via `X-Redirect-By` header when they're doing a redirect.
Props joostdevalk.
Fixes #42313.

git-svn-id: https://develop.svn.wordpress.org/trunk@42408 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-18 01:03:06 +00:00
John Blackbourn 186f963c34 Media: Pass the attachment ID to the `intermediate_image_sizes_advanced` filter.
Props drywallbmb, robbie505
Fixes 42745


git-svn-id: https://develop.svn.wordpress.org/trunk@42407 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-16 13:46:28 +00:00
John Blackbourn 8f92dcf4a4 Login and Registration: Instruct the browser to disable autocapitalisation for the user login field on the login screen.
Props drywallbmb
Fixes #42886


git-svn-id: https://develop.svn.wordpress.org/trunk@42406 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-16 13:40:31 +00:00
Adam Silverstein 33514867dd Media: improve flows for cropping on attachment details screen.
On the "Attachment Details" screen:
* The crop button is always 'enabled'.
* Clicking the crop button with no selection selects the entire image.
* Clicking the crop button with the entire image selected doesn't do anything.
* Clicking the crop button with a selection crops as expected.

Props sonjanyc, afercia, mikeschroder.
Fixes #30155.


git-svn-id: https://develop.svn.wordpress.org/trunk@42404 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 22:02:02 +00:00
Anton Timmermans 53f1c74e1c Docs: Improve wp-admin JSDoc structural data globally.
JSDoc takes it structural data from `@namespace`, `@lends` and `@memberOf`. This change fixes these tags for all JavaScript files in the wp-admin folder.

* Add jsdoc configuration to parse wp-admin/js files. Use `jsdoc -c jsdoc.conf.json` to generate JSDoc.
* Define all used namespaces using `@namespace`.
* Define each usage of the extend function as a prototype assignment using `@lends`.
* Add `@alias` if JSDoc cannot detect the correct name automatically.

This has previously been corrected for all `wp-includes` JavaScript files: [41351].

Props herregroen.
Fixes #42485.


git-svn-id: https://develop.svn.wordpress.org/trunk@42403 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 13:41:56 +00:00
Gary Pendergast c07972d774 Canonical URLs: Redirect to the correct URL when the post date changes.
When a post slug is changed, we store a copy of the old slug, so that we can redirect visitors visiting the old URL to the new URL.

In the same way, this stores a copy of the old date, when the post date changes, so we can redirect visitors to the new URL.

Props nickmomrik.
Fixes #15397 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@42401 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 08:30:50 +00:00
Sergey Biryukov 95ccede93d Docs: Remove extra dot from some `@since` tags.
Props hardik-amipara.
Fixes #42899.

git-svn-id: https://develop.svn.wordpress.org/trunk@42400 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 05:15:33 +00:00
Sergey Biryukov 773dea5c08 Docs: Add missing `@staticvar` entries in `wp-includes/l10n.php`.
Props birgire.
Fixes #42800.

git-svn-id: https://develop.svn.wordpress.org/trunk@42399 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 05:07:13 +00:00
Sergey Biryukov b20f6ea038 Posts: Rename `$ID` to `$post` in `get_post_mime_type()` and `get_post_status()` for consistency with other functions.
See #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42398 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 01:02:24 +00:00
Sergey Biryukov 4fbe6e0801 Docs: Add missing parameter description in `wp_get_post_parent_id()` function DocBlock.
Rename `$post_ID` to `$post` for consistency with other functions.

Add unit tests for `wp_get_post_parent_id()`.

Props keesiemeijer.
Fixes #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42397 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 01:01:01 +00:00
Sergey Biryukov 14fafe960b Docs: Add `@since` version for `WP_Customize_Widgets::filter_dynamic_sidebar_params()`.
Props keesiemeijer.
Fixes #42894.

git-svn-id: https://develop.svn.wordpress.org/trunk@42396 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 00:34:56 +00:00
Sergey Biryukov f2b1df2c08 Docs: Add `@since` version for `WP_Locale_Switcher::init()`.
Props keesiemeijer.
Fixes #42798.

git-svn-id: https://develop.svn.wordpress.org/trunk@42395 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 00:31:55 +00:00
Sergey Biryukov e47feac514 Docs: Add missing `@since` tags for add menu page functions.
Props keesiemeijer.
Fixes #42882.

git-svn-id: https://develop.svn.wordpress.org/trunk@42394 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 00:14:09 +00:00
Anton Timmermans a35b7f31be Docs: Improve JS Docs for `wp-admin/js/dashboard.js`.
Props jipmoors, andizer, ireneyoast, boblinthorst.
Fixes #42831.


git-svn-id: https://develop.svn.wordpress.org/trunk@42393 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-14 14:10:11 +00:00
Anton Timmermans c632669438 Docs: Improve JS Docs for `js/media/controllers/edit-image.js`.
Props jjcomack, nicollle, andizer.
Fixes #42680.


git-svn-id: https://develop.svn.wordpress.org/trunk@42392 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-13 14:09:45 +00:00
Weston Ruter 726f5f7b2d Editor: Fix determining TinyMCE editor width when in inline mode instead of iframe mode.
See #40854.
Amends [41985].
Props aduth.
Fixes #42416 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42390 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-13 05:16:30 +00:00
Anton Timmermans a5ff0c67c9 Docs: Improve JS Docs for `wp-includes/js/heartbeat.js`.
Most of the documentation was already present. This change achieves the following:

* Fixes the formatting for most doc blocks.
* Adds `@since` tags to all functions.
* Makes sure the heartbeat public methods are correctly added to the `wp.heartbeat` namespace.

Props andizer, jjcomack, carolinegeven.
Fixes #42675.


git-svn-id: https://develop.svn.wordpress.org/trunk@42389 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-12 14:32:33 +00:00
Dion Hulse f216215864 WPDB: Always use `mysqli` when available.
This change makes WordPress use `mysqli` on PHP <5.5 when available, instead of only in PHP 5.5+ and development installs.

WPDB includes a fallback to `mysql` in the event that the database connection fails with `mysqli` so incompatibilities should be few and far between.

Fixes #42812 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42388 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-12 05:42:12 +00:00
Dion Hulse da689558a5 Filesystem: Allow `wp_normalise_path()` to handle PHP stream wrappers such as `php://` correctly.
Props calin, dd32.
Fixes #42837.


git-svn-id: https://develop.svn.wordpress.org/trunk@42387 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-12 04:15:54 +00:00
Konstantin Obenland f8dbb79a13 Twenty Ten: Use global img contraint for captions
Fixes an incompatibility with the way caption width is set since 4.9, where the caption element would cover the whole content width.

Props slilley, Clorith, hardeepasrani.
Fixes #42604.


git-svn-id: https://develop.svn.wordpress.org/trunk@42386 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 23:32:01 +00:00
Anton Timmermans 1b5554e818 Docs: Improve JS Docs for `custom-header.js`.
The `custom-header.js` file is only used on the `wp-admin/themes.php?page=custom-header` page. As that page is no longer linked from the UI the functions in the file are marked deprecated.

Props nicollle, jipmoors, diedeexterkate.
Fixes #42678.


git-svn-id: https://develop.svn.wordpress.org/trunk@42385 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 16:26:59 +00:00
Dion Hulse 35c13730dd Docs: Correct some typos in the docs for `wp_ajax_get_community_events()`.
Props Presskopp.
Fixes #42861.


git-svn-id: https://develop.svn.wordpress.org/trunk@42384 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 08:48:07 +00:00
Dion Hulse 9fed02f896 Posts: When using `wp_update_post()` on a `attachment` post_type item, pass the `$wp_error` parameter through to `wp_insert_attachment()`.
Props MyThemeShop.
Fixes #41513.


git-svn-id: https://develop.svn.wordpress.org/trunk@42383 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 06:36:13 +00:00
John Blackbourn 61350144fb Role/Capability: When checking capabilities before setting a post slug, ensure the correct post type capabilities are used.
Previously, only the `publish_posts` capability was checked. Now, the correct meta or primitive capability for the post type is used where appropriate.

Props peterwilsoncc

Fixes #42464


git-svn-id: https://develop.svn.wordpress.org/trunk@42380 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-09 22:50:13 +00:00
Sergey Biryukov 72b74509f3 Permalinks: Remove unnecesary temporary variable in `get_permalink()`.
Props JPry, danimalbrown.
Fixes #41981.

git-svn-id: https://develop.svn.wordpress.org/trunk@42378 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-07 14:49:10 +00:00
Sergey Biryukov acb4856b65 Docs: Correct `@staticvar` entry for `wp_rand()`.
Props chetan200891, birgire.
Fixes #42796.

git-svn-id: https://develop.svn.wordpress.org/trunk@42377 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-07 13:52:39 +00:00
Sergey Biryukov 84c5953cab Docs: Add missing `@return` entry for `WP_Comment_Query::get_comment_ids()`.
Props chetan200891, birgire.
Fixes #42795.

git-svn-id: https://develop.svn.wordpress.org/trunk@42376 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-07 13:46:13 +00:00
Konstantin Obenland 43d9a479cf Widgets: Always try restoring widget assignments
For code-historic reasons, restoring widget assignments would not be attempted if there were no sidebars to map.
Restoring previous assignments is something unrelated to sidebar mappings however, so now it will be attempted on every theme switch.

See #42719.


git-svn-id: https://develop.svn.wordpress.org/trunk@42374 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-07 02:19:11 +00:00
Drew Jaynes 1c2b0762c7 Docs: Improve the usefulness of docs for `wp_generate_password()` by noting the use of wp_rand() vs `rand()` or `mt_rand()`.
Props webdevmattcrom.
Fixes #42782.


git-svn-id: https://develop.svn.wordpress.org/trunk@42373 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 22:39:29 +00:00
Boone Gorges 2e5bbe0667 `category_description()` should be taxonomy-agnostic.
This change reinstates the previous de facto behavior of `category_description()`.
See [40979], [42364]. Because `term_description()` no longer passes `$taxonomy` to
`get_term_field()`, the parameter is no longer needed and has been deprecated.

Fixes #42605. See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42368 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 21:48:24 +00:00
Boone Gorges ffb86c0552 `get_the_category_by_ID()` should be taxonomy-agnostic.
Prior to 4.9, this function was accidentally taxonomy-agnostic in most cases.
The fix in [40979] caused a regression in this function. For backward
compatibility, we make it explicit that the query is by ID only.

See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42367 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 21:02:10 +00:00
Boone Gorges 8951af66d4 Fix regression in `get_tag_link()` since 4.9.
See [42364] for description of the problem.

Because `get_category_link()` is now totally taxonomy-agnostic, `get_tag_link()`
can become a simple wrapper.

Props juiiee8487, markjaquith.
See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42366 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 20:51:27 +00:00
Boone Gorges e9d828ce41 Don't do a strict taxonomy check in `get_category_link()`.
Prior to version 4.9, a quirk in the implementation of `get_term()` caused
`get_category_link( 123 )` to fetch the taxonomy archive link for term 123
even if 123 is not in the 'category' taxonomy. The quirk was fixed in [40979];
see #40671. This bugfix introduced a regression for theme authors who were
expecting the old behavior.

By lifting the 'category' restriction, we allow the template function to work
in the old way.

Fixes #42717. See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42364 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 20:38:57 +00:00
Konstantin Obenland 6cb2a02695 Widgets: Don't try mapping empty sidebars.
Fixes a bug where the mapping logic would try mapping empty sidebars, resulting in PHP warnings.

Props ionvv, chetan200891 for initial patch.
Fixes #42603.



git-svn-id: https://develop.svn.wordpress.org/trunk@42362 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 20:11:11 +00:00
Sergey Biryukov 59612bff8b Docs: Add missing description for `$weekday_name` parameter and `@return` entry in `WP_Locale::get_weekday_initial()`.
Props keesiemeijer, 1naveengiri.
Fixes #42793.

git-svn-id: https://develop.svn.wordpress.org/trunk@42361 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 15:58:03 +00:00
Peter Wilson 14dd35e62e Comments: Modernise JavaScript for comment reply links.
Update the comment reply JavaScript to be unobtrusive and use events rather than inline `onclick` attributes. 

Along with bringing the code into the 2010s this prevents an edge-case in which `addComment.moveForm()` could be called before the JavaScript has loaded.

Props peterwilsoncc, bradparbs.
Fixes #31590.


git-svn-id: https://develop.svn.wordpress.org/trunk@42360 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 22:36:15 +00:00
Joe Hoyle d989b8e402 REST API: Include permalink_structure in the settings route.
There are situations where the REST API client wants to be able to read and set the permalink_structure option. Though this doesn’t fix the use case of front-end rendered unauthenticated websites, it still has utility as a setting in it’s own right.

Props aduth.
See #41014.


git-svn-id: https://develop.svn.wordpress.org/trunk@42359 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 22:28:33 +00:00
Aaron Jorbin 8842eba972 GENERAL: Update recommended PHP version to 7.2.
Props otto42, johnbillion, rachelbaker, jorbin.
Fixes 42789.


git-svn-id: https://develop.svn.wordpress.org/trunk@42358 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 21:57:13 +00:00
Aaron Jorbin 6f4f8b7928 CODING STANDARDS: Fix single/double quotation mark
Broken in [42351].
Unprops adamsilverstein.
Fixes 42679.


git-svn-id: https://develop.svn.wordpress.org/trunk@42357 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 21:18:01 +00:00
Joe Hoyle 63dc77a7fc REST API: Fix permissions error message in post statuses controller.
The permissions error message when a request tries to fetch post statuses unauthenticated is incorrect. It was a copy/paste from elsewhere, as indicated by the use of "in this post type" where this is no post type referenced.

Props schlessera.
Fixes #42303.

git-svn-id: https://develop.svn.wordpress.org/trunk@42356 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 20:48:35 +00:00
Aaron Jorbin 2a51e10611 Docs: Add description for is_day().
Props webdevmattcrom.
Fixes #42784.


git-svn-id: https://develop.svn.wordpress.org/trunk@42355 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 20:41:30 +00:00
Rachel Baker 59c31d2d74 REST API: Correct HTTP status code in error for requests to create a duplicate term.
The 409 error code is intended for situations where it is expected that the user will resolve the conflict and resubmit the same request. We use 400 error codes for other routes when a duplicate request is made. The 400 status code tells the user they need to modify their request for it to be successful.

Props shooper.
Fixes #42781. See #41370.

git-svn-id: https://develop.svn.wordpress.org/trunk@42354 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 19:08:23 +00:00
Adam Silverstein 0f0db92b0d Docs: Improve JSDocs for cropper.js.
Ammends r42352 - include the built media files.


git-svn-id: https://develop.svn.wordpress.org/trunk@42353 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 18:55:31 +00:00
Adam Silverstein 5fbba272df Docs: Improve JSDocs for cropper.js.
Props manuelaugustin, bramheijmink.
Fixes #42677.



git-svn-id: https://develop.svn.wordpress.org/trunk@42352 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 18:46:29 +00:00
Adam Silverstein 4619b059b1 Docs: Improve JSDocs for common.js.
Props andizer, rensw90, benvaassen, jipmoors, ireneyoast and nicollle.
Fixes 42679.



git-svn-id: https://develop.svn.wordpress.org/trunk@42351 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 18:10:21 +00:00
Rachel Baker 2b079e098a REST API: Add existing term_id to the error data object when attempting to create a duplicate term.
Props shooper, coleh.
Fixes #42597. See #41370.

git-svn-id: https://develop.svn.wordpress.org/trunk@42350 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 18:10:05 +00:00
Drew Jaynes 6b325e9916 Hooks: Standardize naming of dynamic hooks using values derived from superglobals to use interpolation vs concatenation.
This is a continuation of the work that happened in [38307] for #37748.

Props ramiy.
Fixes #42698.


git-svn-id: https://develop.svn.wordpress.org/trunk@42349 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 11:35:31 +00:00
Sergey Biryukov 5d45b61e6b Twenty Seventeen: Correct the number of recent posts in a comment in `template-parts/page/content-front-page-panels.php`.
Props skostadinov, marcelo2605.
Fixes #42621.

git-svn-id: https://develop.svn.wordpress.org/trunk@42348 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 03:46:43 +00:00
Sergey Biryukov 712739ee4f Twenty Seventeen: Use consistent wording when referring to the front page in inline docs.
Props chetan200891.
Fixes #42666.

git-svn-id: https://develop.svn.wordpress.org/trunk@42347 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 03:43:03 +00:00
Sergey Biryukov 2c325f64f4 Docs: Correct `$attachment` parameter type for `wp_prepare_attachment_for_js` filter.
Props danielbachhuber.
Fixes #42449.

git-svn-id: https://develop.svn.wordpress.org/trunk@42345 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 03:29:08 +00:00
Gary Pendergast 8f95800d52 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn e2fdcb93f1 Hardening: Remove the ability to upload JavaScript files for users who do not have the `unfiltered_html` capability.
git-svn-id: https://develop.svn.wordpress.org/trunk@42261 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:59:41 +00:00
John Blackbourn 0b11b6ea36 Hardening: Ensure the attributes of enclosures are correctly escaped in RSS and Atom feeds.
git-svn-id: https://develop.svn.wordpress.org/trunk@42260 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:55:03 +00:00
John Blackbourn 3a4bf61804 Hardening: Add escaping to the language attributes used on `html` elements.
git-svn-id: https://develop.svn.wordpress.org/trunk@42259 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:54:05 +00:00
John Blackbourn e2291664f1 Hardening: Use a properly generated hash for the `newbloguser` key instead of a determinate substring.
git-svn-id: https://develop.svn.wordpress.org/trunk@42258 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:51:19 +00:00
Sergey Biryukov 63f8e4d122 Users: After [42256], remove unnecessary double quotes around `first_name` and `last_name` properties.
See #42713.

git-svn-id: https://develop.svn.wordpress.org/trunk@42257 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:27:55 +00:00
Dion Hulse c52f6ba995 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42256 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 03:40:31 +00:00
John Blackbourn af52df0aa1 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


git-svn-id: https://develop.svn.wordpress.org/trunk@42251 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-28 14:51:33 +00:00
Ryan McCue 49852ed54f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42250 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-28 07:09:43 +00:00
Gary Pendergast 209ede72de 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42249 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-28 04:23:11 +00:00
Dion Hulse a825a181e1 Theme Editor: Translate the URL to the Child Themes Codex page.
Props odysseygate, johnpgreen.
Fixes #42454.


git-svn-id: https://develop.svn.wordpress.org/trunk@42247 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:51:25 +00:00
Dion Hulse 44c75415b3 Theme Editior: Base the nonce on a simpler combination of fields, for easier debugging & reading.
See #42609.
Fixes #42705.


git-svn-id: https://develop.svn.wordpress.org/trunk@42246 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:43:11 +00:00
Dion Hulse 6e0ba7864f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42244 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:27:19 +00:00
dd32 76f77416d6 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42242 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 02:58:02 +00:00
Gary Pendergast 574821573a 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 23:56:25 +00:00
Dion Hulse d00e74042b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42227 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 03:16:55 +00:00
Dion Hulse b8c4faff72 WPDB: Fix the parsing of sockets which contain colons within the socket name (used on some cloud providers).
Props natacado.
Fixes #42634 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42226 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-24 05:51:31 +00:00
Dion Hulse 555eab6391 Template: Don't output an empty `<ul>` in `the_meta()` when a post only has protected metas.
Props campusboy1987, birgire.
Fixes #42629.


git-svn-id: https://develop.svn.wordpress.org/trunk@42225 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-24 05:20:39 +00:00
Dion Hulse 26fb077862 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42224 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-24 03:04:35 +00:00
Weston Ruter 53eaf9f078 Themes: Prevent JS error on Themes admin screen when only one theme is installed.
Amends [42029].
Props chetan200891, afercia.
See #42348.
Fixes #42673.


git-svn-id: https://develop.svn.wordpress.org/trunk@42222 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 19:28:33 +00:00
John Blackbourn a687253cce 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


git-svn-id: https://develop.svn.wordpress.org/trunk@42220 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 19:03:44 +00:00
Gary Pendergast da9953aa47 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42218 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 05:23:01 +00:00
Gary Pendergast f797c252d9 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42217 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 04:08:42 +00:00
John Blackbourn d88bb052f0 Cron API: Improvements to docblocks for the event scheduling functions.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42216 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-22 15:15:35 +00:00
Dion Hulse 2c1858a8c3 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42214 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 04:14:33 +00:00
Boone Gorges 4ec5d65dcc 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@42211 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 03:14:52 +00:00
Felix Arntz 887214f7ce Multisite: Fix broken update `blog_versions` query after [41661].
Props Mista-Flo, lenasterg.
Fixes #42641.


git-svn-id: https://develop.svn.wordpress.org/trunk@42210 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 23:45:09 +00:00
Boone Gorges 576f78ac49 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@42209 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 22:45:29 +00:00
John Blackbourn ff1d2b5ccb HTTP API: Add a `WP_Http` class constant for the HTTP status code `301`.
Fixes #42490


git-svn-id: https://develop.svn.wordpress.org/trunk@42208 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 20:53:20 +00:00
John Blackbourn d821f8b28d HTTP API: Add support for a description for HTTP status code `103`.
Props Dhruvin

Fixes #42490


git-svn-id: https://develop.svn.wordpress.org/trunk@42207 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 20:34:52 +00:00
John Blackbourn ab714bd549 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


git-svn-id: https://develop.svn.wordpress.org/trunk@42206 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 20:23:50 +00:00
Dion Hulse 61904426e2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42205 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 06:20:23 +00:00
johnbillion 4af1237176 Docs: Correct the `@since` property for the `page_attributes_misc_attributes` action.
Props jeremyescott, jfarthing84

Fixes #42607


git-svn-id: https://develop.svn.wordpress.org/trunk@42203 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-19 11:51:01 +00:00
Felix Arntz b424eecd0b Multisite: Do not show edit links in network users table for users that cannot be edited.
Props ocean90.
Fixes #42552.


git-svn-id: https://develop.svn.wordpress.org/trunk@42202 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-17 21:34:01 +00:00
Dion Hulse 21ad5a9e40 Remove the `svn:executable` property from files that don't need it.
See #42594


git-svn-id: https://develop.svn.wordpress.org/trunk@42200 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-17 02:57:27 +00:00
Sergey Biryukov 603e195f10 Rewrite Rules: Correct the logic in `extract_from_markers()` after [41928].
Props stodorovic.
Fixes #42579. See #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@42199 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-16 13:24:57 +00:00
Weston Ruter aec1fb9aa0 Editor: Re-build `tinymce.min.js` after [42191].
See #42553.


git-svn-id: https://develop.svn.wordpress.org/trunk@42193 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 23:34:57 +00:00
Weston Ruter 7371834069 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42191 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:58:26 +00:00
Weston Ruter 551163278b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42189 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:28:33 +00:00
Weston Ruter 323a8c95f0 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42187 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:11:17 +00:00
Weston Ruter 672eb9206b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42185 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 02:26:56 +00:00
Weston Ruter c9b825d5f5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42183 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 00:20:21 +00:00
Weston Ruter 4126cbbd9c 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42181 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 23:01:55 +00:00
Peter Wilson ca40a244d7 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42177 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 05:23:55 +00:00
Gary Pendergast 7dfdbf2754 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42175 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 05:18:10 +00:00
Weston Ruter cc68415a23 About: Fix jumping behavior for titles and columns when scrolling.
Props ryelle.
See #42087.
Fixes #42514, #42526.


git-svn-id: https://develop.svn.wordpress.org/trunk@42173 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 22:28:20 +00:00
Weston Ruter e260210294 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42171 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 21:18:49 +00:00
Weston Ruter 33f7cfd2b9 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42169 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 19:24:49 +00:00
Boone Gorges f7dabb40c1 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@42165 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 16:25:18 +00:00
Weston Ruter e26f3b5baf 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42163 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 07:07:55 +00:00
Weston Ruter 2f297cfeff 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42161 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 05:47:05 +00:00
Weston Ruter e6e518cbe5 About: Fix grammar typo with pluralization.
Props metodiew, westonruter.
Amends [42121].
See #42087.
Fixes #42476 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42159 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 05:18:10 +00:00
Weston Ruter 48980cd541 About: Synchronize 4.9 tagline across about pages for credits, freedoms, and privacy.
Props dave.pullig.
Amends [41943].
See #42087.
Fixes #42518 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42157 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-12 19:58:13 +00:00
Weston Ruter 64a9b85f77 Theme Editor: Fix styling of child theme notice.
Props westonruter, melchoyce, ndiego.
See #24048.
Fixes #42491 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42155 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-11 20:42:04 +00:00
Weston Ruter 138ffd49a9 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42153 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 23:40:41 +00:00
Weston Ruter b4c66ad91b Customize: Prevent nav menu location assignment checkbox change from increasing height by 1px.
Props obenland.
Amends [41817].
See #42157.
Fixes #42492.


git-svn-id: https://develop.svn.wordpress.org/trunk@42152 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 23:00:21 +00:00
John Blackbourn fc40dea2fd Docs: Correct parameter type documentation for various `__call()` methods.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42151 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:56:01 +00:00
Weston Ruter f42f19e1c5 Customize: Improve accuracy of message displayed when accessing Customizer with a changeset that is already published or trashed.
Amends [38810].
Props dlh.
Fixes #42497.


git-svn-id: https://develop.svn.wordpress.org/trunk@42150 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:50:49 +00:00
Weston Ruter d0fefcde8b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42148 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:43:30 +00:00
Weston Ruter 08a3691775 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42146 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:29:45 +00:00
Weston Ruter 89bea84d6e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42144 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 21:43:32 +00:00
John Blackbourn 605505e9f7 Docs: Improve inline docs for the `wp_redirect()` and `wp_safe_redirect()` functions.
See #42505, #42108


git-svn-id: https://develop.svn.wordpress.org/trunk@42143 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 13:43:07 +00:00
Gary Pendergast 58fad5bf57 REST API: Add `permalink_structure` to the index endpoint.
This allows Gutenberg to implement permalink editing.

Props schlessera.
Fixes #42465.



git-svn-id: https://develop.svn.wordpress.org/trunk@42142 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 06:10:23 +00:00
Weston Ruter d7af48d421 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42140 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 01:27:30 +00:00
Weston Ruter c994a2e9bb 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42138 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 04:43:09 +00:00
Weston Ruter d671098003 Customize: Ensure `autosaving` message gets sent to preview after initial change when `saved` state is first dirty.
Amends [41667].
Fixes #42475 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42136 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 04:14:46 +00:00
Weston Ruter ac5a3fc7a8 Settings: Fix date/time format previewing.
Props afercia.
Amends [41857].
Fixes #41603.


git-svn-id: https://develop.svn.wordpress.org/trunk@42134 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 03:54:13 +00:00
Weston Ruter 7a6ed11319 Customize: Restore search icon to available widgets pane incorrectly removed in [41893].
See #42215.
Fixes #42472 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42132 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 01:01:53 +00:00
Gary Pendergast 1c64182c6b Admin Bar: Fix another HTML error introduced in [42128].
Props Otto42.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42131 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 23:12:37 +00:00
Dion Hulse 56659638dc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42130 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 11:47:04 +00:00
Gary Pendergast e7d649e621 Admin Bar: Fix a HTML error introduced in [42128].
Props swissspidy.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42129 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 08:51:03 +00:00
Gary Pendergast e9282049e8 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42128 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 08:34:41 +00:00
Weston Ruter 9f77ec13ff Trunk is now 5.0-alpha
git-svn-id: https://develop.svn.wordpress.org/trunk@42127 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 05:46:41 +00:00
Weston Ruter ff6114f853 Post WordPress 4.9 RC2 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@42125 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 05:25:47 +00:00
Weston Ruter 6668ba7995 WordPress 4.9 RC2.
git-svn-id: https://develop.svn.wordpress.org/trunk@42124 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:53:36 +00:00
Konstantin Obenland 03136e1b23 About: Hardcoded image sources.
We're committed to these images now.

See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@42123 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:25:26 +00:00
Weston Ruter a397b8f6bb 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42122 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:16:11 +00:00
Mel Choyce 6f8428e8b5 About Page: Implement design.
Props ryelle, karmatosed, transl8or, obenland, melchoyce.
See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@42121 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:10:41 +00:00
Gary Pendergast 000809964a 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42120 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 01:08:11 +00:00
Gary Pendergast f7fbbcba0d 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42119 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 00:29:26 +00:00
Weston Ruter b23d590bf2 Customize: Prevent `customize_autosaved=on` from getting added to frontend preview URLs.
Amends [41969].
See #39896, #42450.
Fixes #42433.


git-svn-id: https://develop.svn.wordpress.org/trunk@42118 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 23:10:05 +00:00
Weston Ruter 2ae0f807ce 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42117 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 20:27:37 +00:00
John Blackbourn 7cc10e6ccb Administration: Ensure the new Privacy Policy screen appears when within the Network Admin and User Admin.
Props hnle, dd32
Fixes #42443


git-svn-id: https://develop.svn.wordpress.org/trunk@42116 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 18:16:25 +00:00
Konstantin Obenland a4f27c25bc File Editors: Account for network admin use
Fixes a bug where files couldn't be accessed in multisite installs.

Props flixos90, westonruter.
Fixes #42420.



git-svn-id: https://develop.svn.wordpress.org/trunk@42115 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-03 18:50:43 +00:00
Weston Ruter 9976cd2b66 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42114 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-03 17:36:27 +00:00
Weston Ruter c7cb694732 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42113 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-03 00:58:25 +00:00
Weston Ruter 3fab757196 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42112 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 23:04:54 +00:00
Weston Ruter 4f0527afdc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42111 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 22:59:04 +00:00
Konstantin Obenland f0cb7b5696 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42110 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 22:30:16 +00:00
Weston Ruter bdee44c461 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42109 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 19:59:55 +00:00
Weston Ruter 884fa6476e Customize: Prevent `history.replaceState()` and `history.pushState()` calls from causing error in customize preview before DOM ready.
Amends [41597].
See #39896.
Fixes #42414.


git-svn-id: https://develop.svn.wordpress.org/trunk@42108 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 19:26:23 +00:00
Weston Ruter dc3c350eab 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42107 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 18:59:40 +00:00
David A. Kennedy ec2b0be9a6 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42105 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-01 22:42:50 +00:00
Weston Ruter 7b33220fa3 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42104 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-01 21:03:36 +00:00
Gary Pendergast a39d599adf 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42056 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 11:59:43 +00:00
westonruter 15f74e83fa Post WordPress 4.9 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@42050 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 04:31:03 +00:00
Weston Ruter 53af23a241 WordPress 4.9 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@42049 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 03:41:16 +00:00
Weston Ruter 00eb9473b2 Customize: Consolidate sourcing of control `params`.
Prevent needlessly iterating over `controlConstructor` to find `type` when it is already supplied.

Amends [41750], [41726].
See #42083.


git-svn-id: https://develop.svn.wordpress.org/trunk@42048 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 02:58:42 +00:00
Adam Silverstein 0a964a48f8 REST API: JS client - Enumerate endpoints supporting trash.
Improve the logic determining which endpoints support the trash by enumerating them. Endpoints that don't support the trash require `force=true` when deleting. The previous approach relied on the `force` argument description, which is a translated string and was fragile. In the future, we can expose whether an endpoint supports the trash as part of its schema and automate this logic.

Props Soean.
Fixes #40672.



git-svn-id: https://develop.svn.wordpress.org/trunk@42047 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 02:53:44 +00:00
Konstantin Obenland f19d308ece Customize: Spiff up theme updates
Fixes UI bugs around theme updates in the Customizer. Theme versions now get updated and users are no longer left alone after a successful update.

Props rinkuyadav999, celloexpressions for initial patch.
Fixes #42365.


git-svn-id: https://develop.svn.wordpress.org/trunk@42046 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 01:32:15 +00:00