Commit Graph

37855 Commits

Author SHA1 Message Date
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
829d8bb179 Fix incorrect test names from [42364].
See #42771.

git-svn-id: https://develop.svn.wordpress.org/trunk@42365 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-04 20:46:56 +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
Gary Pendergast
81a48c2924 Coding Standards: Add the phpcs.xml.dist file.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42346 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 03:40:04 +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
Gary Pendergast
ec6a089f98 Tests: Fix a couple of weirdly formatted comments.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42342 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 16:22:15 +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
Drew Jaynes
81b4e9a3a4 General: Add complete test coverage for WP_Error.
See #42742.


git-svn-id: https://develop.svn.wordpress.org/trunk@42255 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 02:18:25 +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