Commit Graph

36222 Commits

Author SHA1 Message Date
SergeyBiryukov
53e6e1f5d3 I18N: Add post type context to "Featured Image" post labels.
Fixes #39458.

git-svn-id: https://develop.svn.wordpress.org/trunk@39667 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 08:39:29 +00:00
SergeyBiryukov
0f6f7f207d Posts, Post Types: Add a @since entry for archives post type label introduced in [35382].
See #16075.

git-svn-id: https://develop.svn.wordpress.org/trunk@39666 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 08:20:14 +00:00
dd32
298b0d0676 Shortcodes: Clarify the docs for pre_do_shortcode_tag and do_shortcode_tag.
Props dhanendran.
Fixes #39294.


git-svn-id: https://develop.svn.wordpress.org/trunk@39665 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-03 03:57:03 +00:00
boonebgorges
80905ab4b1 Ignore the 'comment_order' setting when determining comment pagination.
[38740] incorrectly introduced logic that changed a comment's page when
'comment_order' was set to 'desc'. This is in violation of the design
of the comment pagination system: a comment's page is designed not to
change when 'comment_order' or 'default_comment_page' are changed.
See #31101.

Props rachelbaker.
Fixes #39280.

git-svn-id: https://develop.svn.wordpress.org/trunk@39663 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 19:58:09 +00:00
boonebgorges
3418d831a5 Don't double-escape terms payload in WP_Tax_Query::transform_query().
`terms` values are passed through `sanitize_term_field()` with the 'db'
flag, which add slashes. Because `terms` are subsequently run through
`esc_sql()`, these slashes must be removed. See [36348], which added
a similar step to sanitization in `get_terms()`.

Props bcworkz.
Fixes #39315.

git-svn-id: https://develop.svn.wordpress.org/trunk@39662 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 19:38:07 +00:00
Rachel Baker
511e4c67dd REST API: Add missing assertions to the view and embed context response data for the Users Controller.
Adds tests for responses where `context != 'edit'` the following properties are not included in the response data:
- `email`
- `locale`
- `registered_date`

Props thepelkus, jnylen0.
Fixes #39399.


git-svn-id: https://develop.svn.wordpress.org/trunk@39660 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 18:42:22 +00:00
Rachel Baker
1aec30fba8 General: Update copyright year to 2017 in license.txt.
Props Nikschavan.
Fixes #39433.


git-svn-id: https://develop.svn.wordpress.org/trunk@39659 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 17:57:42 +00:00
Dion Hulse
16e8d82c89 Updates: Show the Authentication key settings after selecting the SSH transport in both the modal, and also on the plugin/theme updates screen.
Props afercia.
Fixes #39057 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@39657 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 07:43:41 +00:00
Dion Hulse
85ad040c97 Updates: Remove a stray " from a tag.
Props afercia.
See #39057.


git-svn-id: https://develop.svn.wordpress.org/trunk@39656 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 07:41:45 +00:00
Dion Hulse
247e08e84a Mail: Ensure that any phpmailerException exceptions generated by setFrom() are caught to avoid PHP Fatal errors.
This change avoids a PHP fatal error that can be encountered when the specified (or generated) source email is an invalid address, such as `wordpress@_`, it makes no effort to set a valid source, only avoid the fatal error.

See #25239 for correcting the email address.
Fixes #39360.


git-svn-id: https://develop.svn.wordpress.org/trunk@39655 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 06:43:07 +00:00
Peter Wilson
f6fa5ddda7 Taxonomy: Redirect to current taxonomy when adding a term without AJAX.
Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21.
Fixes #39328 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@39649 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 03:10:34 +00:00
Rachel Baker
70085bd944 REST API: Merge similiar error message strings in the Terms Controller.
Replaces the "doesn't" contraction with "does not" to be consistent with similar strings in `WP_Error` messages when a specified term or parent term is missing in `WP_REST_Terms_Controller`.

Props ramiy, ocean90.
Fixes #39176.


git-svn-id: https://develop.svn.wordpress.org/trunk@39648 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 18:44:59 +00:00
Rachel Baker
fa3f97449e REST API: Add the supports property to the Post Type response object.
Includes a new `supports` property in the response object and schema for the `/types` endpoints for users with the `edit_posts` capability for the given post type. The `supports` property returns an object of the features the given post type *supports*.

Props timmydcrawford, tyxla.
Fixes #39033.


git-svn-id: https://develop.svn.wordpress.org/trunk@39647 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 17:27:37 +00:00
Dion Hulse
e0531dcaa3 Upgrade PHPMailer from 5.2.14 to 5.2.21.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.14...v5.2.21

Props sebastian.pisula, MattyRob, sfpt, dd32.
Fixes #37210 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@39645 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 02:52:08 +00:00
Dion Hulse
3a4aae8c20 Filesystem: Add return statement to WP_Filesystem_ftpsockets->rmdir
Props tymvie.
Fixes #39405.


git-svn-id: https://develop.svn.wordpress.org/trunk@39644 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-28 03:51:29 +00:00
Rachel Baker
8eda7a0510 REST API: Remove errant annotation from test_get_items_pagination_headers() method.
Removes the debugging group notation left in the `WP_Test_REST_Users_Controller` and `WP_Test_REST_Posts_Controller` classes pagination headers method. Introduced in [38832].

Props sanket.parmar.
Fixes #39398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39643 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 18:03:52 +00:00
Rachel Baker
7018deaf87 Comments: Fix placement of the wp_update_comment_data filter to safeguard filtered data from triggering a database error.
Introduced in [38674], the `wp_update_comment_data` filter took place after the `$data` was sliced and prepared for the database update statement. The location of the filter assumed the result of anyone applying it would not change the data type or make structural modifications or additions to the $data array. 😅

This moves the `wp_update_comment_data` filter to take place before the `$data` is sliced and prepared for the database update statement.

Props dshanske for initial patch.

Fixes #39380.


git-svn-id: https://develop.svn.wordpress.org/trunk@39640 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 17:21:04 +00:00
John Blackbourn
8512036e4e Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer


git-svn-id: https://develop.svn.wordpress.org/trunk@39639 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 09:27:38 +00:00
John Blackbourn
5f645d2f34 Docs: Add and correct @since docs for a variety of functions and methods.
Props keesiemeijer, chris_dev
Fixes #39343, #39357, #39344
See #39130


git-svn-id: https://develop.svn.wordpress.org/trunk@39638 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 09:20:11 +00:00
Boone Gorges
35ccbc8368 Taxonomy: Eliminate redundant and inaccurate dupe check when creating categories from post.php.
The `term_exists()` check is not needed because of existing dupe
checks in `wp_insert_term()`. Furthermore, `term_exists()` conflates
term names and sanitized slugs, so incorrectly marks terms like
'C' and 'C+' as duplicates of one another.

Props garyc40, SergeyBiryukov, kovshenin, MikeHansenMe.
Fixes #16567.

git-svn-id: https://develop.svn.wordpress.org/trunk@39637 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-23 03:10:36 +00:00
Boone Gorges
ef91d166d5 Query: Improve documentation for orderby=relevance in WP_Query.
Props dots.
Fixes #39336.

git-svn-id: https://develop.svn.wordpress.org/trunk@39636 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-23 02:30:54 +00:00
David A. Kennedy
213d196d66 Twenty Seventeen: Fix incorrect $content_width value in theme
This addresses a major bug. Incorrectly setting the `$content_width` causes media embeds to end up with the wrong aspect ratio, among other issues. This fix uses `template_redirect`,  to ensure conditional theme tags can be used. It also defines a default value at `after_theme_setup` so that plugins have something to work with at `init`.

Props sstoqnov, laurelfulford, obenland.

Fixes #39272.


git-svn-id: https://develop.svn.wordpress.org/trunk@39635 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-22 23:23:23 +00:00
Gary Pendergast
f593d8532a Tests: Restore the database connection earlier when switching test groups.
When plugins don't disable the `backupGlobals` PHPUnit option in their own tests, `$wpdb` is backed up and restored between classes of tests. The serialisation process used for this broke the database connection. This previously wasn't a problem, as it was reconnecting before each test.

[38398] introduced some changes that required the connection to be available in `setUpBeforeClass()`, earlier than in was previously reconnecting. This didn't cause warnings in Core, but it did cause warnings for plugins that don't disable the `backupGlobals` option.

The database connection now reconnects in `setUpBeforeClass()`. This change also fixes a few Core tests that weren't calling `parent::setUpBeforeClass()` or `parent::tearDown()` correctly.

Fixes #39327.



git-svn-id: https://develop.svn.wordpress.org/trunk@39626 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 04:58:47 +00:00
Boone Gorges
4b984b763d Taxonomy: Ensure that mods to query vars in pre_term_query callbacks have an effect.
Previously, it was possible to modify the `query_vars` array, but
the changes would be ignored after `pre_term_query` had finished
running.

Props jfarthing84.
Fixes #39354.

git-svn-id: https://develop.svn.wordpress.org/trunk@39625 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 03:01:32 +00:00
David A. Kennedy
6c714ab73c Twenty Seventeen: Hardens the logic for calling featured image in header.php
This change uses `get_queried_object_id()` here since the `$post` global may not be set before a call to `the_post()`.

Props westonruter.

Fixes #39302.


git-svn-id: https://develop.svn.wordpress.org/trunk@39624 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 22:59:28 +00:00
David A. Kennedy
87ed10d7ec Twenty Seventeen: Ensure functions in customize-controls.js don't count on Customizer sections always being present
Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Props westonruter.

Fixes #39335.


git-svn-id: https://develop.svn.wordpress.org/trunk@39623 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 22:16:35 +00:00
Weston Ruter
460c358859 Customize: Fix visible edit shortcuts for wp_nav_menu() instances using the menu arg (such as in the Custom Menu widget) instead of the theme_location arg.
Also fix logic for `focus-control-for-setting` handler to focus on the first control (lowest `priority` value) associated with a given setting instead of the last control encountered when iterating over all controls, as this ensures the first control in a `nav_menu` section is focused rather than the last one.

Props westonruter, sirbrillig.
See #27403.
Fixes #39101.


git-svn-id: https://develop.svn.wordpress.org/trunk@39622 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 22:04:22 +00:00
James Nylen
130adf0dc2 REST API: Improve the rest_*_collection_params filter docs and fix the terms filter.
The `rest_{$taxonomy}_collection_params` filter in 4.7 is incorrectly using
single quotes instead of double quotes, which means it is not working correctly
as a dynamic filter.  This fixes the quotes around the filter name, and also
updates the docblocks for the other 3 similar filters for better conformance to
the documentation standards.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.


git-svn-id: https://develop.svn.wordpress.org/trunk@39621 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 01:36:47 +00:00
James Nylen
8bbfc6ef28 REST API: Fix PHP warnings when get_theme_support( 'post-formats' ) is not an array.
If `add_theme_support( 'post-formats' )` is called with no additional
arguments, then `get_theme_support( 'post-formats' )` returns `true` rather
than an array of supported formats.  Avoid generating PHP warnings in this
situation.

Props dreamon11, ChopinBach.
Fixes #39293.


git-svn-id: https://develop.svn.wordpress.org/trunk@39620 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 00:55:04 +00:00
Ella van Dorpe
9705ad5510 Editor: Let the Add New link disappear in DFW mode.
The link was moved outside the heading in [38983].

Fixes #39313 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@39619 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-17 10:22:49 +00:00
David A. Kennedy
665d60d680 Twenty Seventeen: Improves code readability and code standards in files
Adds better DocBlock comments and fixes some spacing issues based on PHP_CodeSniffer WordPress coding standards.

Props sstoqnov.

Fixes #39152.


git-svn-id: https://develop.svn.wordpress.org/trunk@39618 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 22:07:41 +00:00
Joe McGill
1f48d453d8 Media: Allow PDF fallbacks filter to process custom sizes.
This fixes an oversight in [39246], which added a hook for filtering
the array of sizes used for PDF thumbnails, but failed to provide a way
for sizes added through `add_image_size()` to be processed.

Props gitlost.
Fixes #39231. See #38594.

git-svn-id: https://develop.svn.wordpress.org/trunk@39617 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 20:29:26 +00:00
Weston Ruter
bad6ddc45d Customize: Bump wp_custom_css_cb from running at wp_head priority 11 to 101 to ensure Custom CSS overrides other CSS.
Aligns `wp_head` action priority with Jetpack's Custom CSS.

Amends [38829].
See #35395, #38672.
Fixes #39270.


git-svn-id: https://develop.svn.wordpress.org/trunk@39616 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 07:28:14 +00:00
Dion Hulse
a5bb301d0b Feeds: Replace the RSS2 lastBuildDate date field with the r date specifier.
See #39141.


git-svn-id: https://develop.svn.wordpress.org/trunk@39614 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:41:45 +00:00
Dion Hulse
939e806ef1 Feeds: Do not translate the lastBuildDate field in RSS feeds.
Props stevenkword, dd32.
Fixes #39141


git-svn-id: https://develop.svn.wordpress.org/trunk@39613 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:38:10 +00:00
Dion Hulse
0abe687fe8 Media: Move a variable definition outside of conditionals to ensure it's always available.
This fixes cases where the URL to a PDF preview may be incorrectly calculated when no thumbnails were generated for the PDF (and avoids a PHP Notice at the same time).

Fixes #39250.


git-svn-id: https://develop.svn.wordpress.org/trunk@39612 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:20:40 +00:00
Adam Silverstein
7503daedd1 WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Fixes #39070.


git-svn-id: https://develop.svn.wordpress.org/trunk@39603 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-15 12:53:26 +00:00
Ella van Dorpe
79ded07a1a Editor: Remove target=_blank when unchecked in the link modal.
Fixes #39276 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@39601 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 20:30:00 +00:00
John Blackbourn
ca92da24da General: Use interpolation instead of concatenation for all dynamic hook names.
This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148


git-svn-id: https://develop.svn.wordpress.org/trunk@39600 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 04:17:38 +00:00
John Blackbourn
c0bb5e4972 Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.
Props natereist, dlh
Fixes #39211


git-svn-id: https://develop.svn.wordpress.org/trunk@39599 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 03:42:58 +00:00
James Nylen
2642833293 REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added
via the `posts_clauses` filter and the `_filter_query_attachment_filenames()`
function.  This moves `_filter_query_attachment_filenames()` from
`wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be
applied in the same manner in the REST API media endpoint.

Props jblz, tyxla.
Fixes #39092.


git-svn-id: https://develop.svn.wordpress.org/trunk@39598 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 14:08:24 +00:00
James Nylen
03c947c7fd REST API: Allow sending an empty or no-op comment update.
In general, updates that don't actually change anything should succeed.
[39371] added tests for other object types, and this commit fixes empty updates
for comments and adds the missing test.

Fixes #38700.


git-svn-id: https://develop.svn.wordpress.org/trunk@39597 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 13:52:49 +00:00
Gary Pendergast
25330a0220 Libraries: Update zxcvbn from version 1.0 to 4.4.1
This includes masses of bug fixes, as well as tweaks to how passwords are scored.

QUnit tests have been updated to reflect tha scoring changes.

Full changelog: https://github.com/dropbox/zxcvbn/compare/v1.0...v4.4.1

Fixes #31647.



git-svn-id: https://develop.svn.wordpress.org/trunk@39596 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 11:22:28 +00:00
James Nylen
9bf4440213 REST API: Do not include the password argument when getting media items
Currently, `attachment` is the only post type exposed via the REST API that
does not support password protection, but it's possible for other post types to
remove password support.

Fixes #38977.


git-svn-id: https://develop.svn.wordpress.org/trunk@39595 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 03:51:01 +00:00
James Nylen
68b6a6197b REST API: Do not error on empty JSON body
It's fairly common for clients to send `Content-Type: application/json` with an
empty body.  While technically not valid JSON, we've historically supported
this behaviour, so it shouldn't cause an error.

Props JPry.
Fixes #39150.


git-svn-id: https://develop.svn.wordpress.org/trunk@39594 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 03:33:14 +00:00
Boone Gorges
012d1977e2 Taxonomy: Use get_term_link() instead of get_category_link() in get_term_parents_list().
`get_category_link()` is a wrapper for `get_term_link()`. Using the
unwrapped function makes more sense semantically (it's taxonomy-
agnostic) and it's also more parsimonious (the `WP_Error` check in
`get_category_link()` is redundant with similar checks just before
in `get_term_link()`).

Props keesiemeijer.
Fixes #17069.

git-svn-id: https://develop.svn.wordpress.org/trunk@39593 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 02:56:32 +00:00
Ryan McCue
bc2d2858f9 General: Correctly detect trailing newline when prepending.
We need to check that the final line is actually an artifact of explode(), not just an empty input string.

See #37082.


git-svn-id: https://develop.svn.wordpress.org/trunk@39592 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 02:47:07 +00:00
Ryan McCue
32ed2a1ffa General: Remove most uses of create_function()
create_function() is equivalent to eval(), and most of our uses can be refactored. This is simpler, more secure, and slightly more performant.

Props sgolemon.
Fixes #37082.


git-svn-id: https://develop.svn.wordpress.org/trunk@39591 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 01:48:41 +00:00
Felix Arntz
b171b64d3c Tests: Use wp_delete_user() during teardown to delete a single site's user.
Fixes failing tests for `get_dashboard_url()`.

Fixes #39065.


git-svn-id: https://develop.svn.wordpress.org/trunk@39590 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 23:17:35 +00:00
Felix Arntz
b4317ea053 Multisite: Replace is_super_admin() with manage_network in get_dashboard_url().
Unit tests for `get_dashboard_url()` have been added.

Props iaaxpage.
Fixes #39065. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39589 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 22:40:03 +00:00