Commit Graph

37851 Commits

Author SHA1 Message Date
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 ab58308a41 REST API: Adjust unit testes to expect a 401 status code in error responses from permission callbacks when user is not authenticated.
Missed in [42421].

Fixes #42828.

git-svn-id: https://develop.svn.wordpress.org/trunk@42423 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-01 02:30:39 +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
John Blackbourn bad15e4289 Build/Test Tools: Instruct Git and Subversion to ignore Composer's `vendor` directory.
Props netweb 
Fixes #42909


git-svn-id: https://develop.svn.wordpress.org/trunk@42405 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-16 13:37:15 +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
Boone Gorges 617372e21e Improve performance of `wp_list_pages()` tests.
The changeset also removes the use of hardcoded post/author IDs.

Props frank-klein.
Fixes #42903.

git-svn-id: https://develop.svn.wordpress.org/trunk@42402 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 11:15:00 +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 a7488c9441 Build/Test tools: Switch to PHPUnit's `expectOutputString()` method instead of manually using output buffers for output assertions.
Props birgire
Fixes #42098


git-svn-id: https://develop.svn.wordpress.org/trunk@42382 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-10 00:30:32 +00:00
John Blackbourn 07be59d34b Build/Test tools: Remove unnecessary PHP functionality tests from the test suite.
Props Frank Klein
Fixes #42277


git-svn-id: https://develop.svn.wordpress.org/trunk@42381 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-09 23:08:24 +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
John Blackbourn 3a7ff0e2e6 Build/Test tools: Add inline documentation to undocumented methods in the `WP_UnitTestCase` class.
Props Frank Klein

Fixes #42731


git-svn-id: https://develop.svn.wordpress.org/trunk@42379 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-08 21:00:08 +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