Commit Graph

23418 Commits

Author SHA1 Message Date
Adam Silverstein
717aeab3cc REST API: JavaScript client should use _.extend when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.


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


git-svn-id: http://core.svn.wordpress.org/trunk@39977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 21:46:43 +00:00
Sergey Biryukov
8f855f46b0 Media: In wp_unique_filename(), use explicit type casting when incrementing $number.
This prevents the "non-numeric value encountered" warning in PHP 7.1, caused by trying to increment an empty string on the first loop iteration.

Props drrobotnik for initial patch.
Fixes #39774.


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


git-svn-id: http://core.svn.wordpress.org/trunk@39976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 20:58:42 +00:00
Sergey Biryukov
e0e9568e24 REST API: After [38947], improve the wording of the message to clarify that rest_authentication_errors is a filter.
See #38446.
Built from https://develop.svn.wordpress.org/trunk@40038


git-svn-id: http://core.svn.wordpress.org/trunk@39975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 21:32:47 +00:00
James Nylen
19ae50d9fa REST API: Improve posts orderby tests
This commit adds tests for `orderby=relevance` combined with a search term in the REST API.

It also improves tests for the `orderby` parameter in `WP_REST_Posts_Controller` by looking at the generated SQL query instead of creating a bunch of carefully arranged test objects.  This should be much more robust, and we can use this approach in other places (such as #39055).

Fixes #39079.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 20:32:04 +00:00
Weston Ruter
e34ee2f25b Customize: Ensure root values are accessible in multidimensional custom setting types.
Fixes bad conditions in `WP_Customize_Setting::get_root_value()` and `WP_Customize_Setting::set_root_value()`.

Props dlh.
Amends [35007].
See #32103.
Fixes #36952.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 01:40:52 +00:00
Sergey Biryukov
222ee437fe Update/Install: Give context to "Deleted! string to allow for differentiation between theme and plugin translations.
Props swissspidy.
See #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40035


git-svn-id: http://core.svn.wordpress.org/trunk@39972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:59:40 +00:00
Sergey Biryukov
9264813949 Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.
Fixes #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40034


git-svn-id: http://core.svn.wordpress.org/trunk@39971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:27:41 +00:00
Sergey Biryukov
a6215fd8ac I18N: Use a consistent translator comment ("accessibility text") for strings used in aria-label attributes.
See #32000.
Built from https://develop.svn.wordpress.org/trunk@40033


git-svn-id: http://core.svn.wordpress.org/trunk@39970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 08:55:41 +00:00
Sergey Biryukov
cb46332a82 Text Changes: Remove periods from checkbox labels in Discussion meta box to improve consistency throughout the admin.
Checkbox labels generally don't have periods, unless it's a complete sentence.

Props juhise.
Fixes #33780.
Built from https://develop.svn.wordpress.org/trunk@40032


git-svn-id: http://core.svn.wordpress.org/trunk@39969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 07:05:39 +00:00
Boone Gorges
e836e47a8a Avoid PHP notices in get_post_type_archive_template().
The function should fail more gracefully when called in the context
where `get_query_var( 'post_type' )` doesn't represent an actual post
type.

Props technopolitica, dlh.
Fixes #38374.
Built from https://develop.svn.wordpress.org/trunk@40031


git-svn-id: http://core.svn.wordpress.org/trunk@39968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-30 19:32:42 +00:00
Peter Wilson
c957e3acb0 Feeds: Prevent empty feeds from returning 404 errors.
Partial revert of [38929].

This reverts the source code from the commit for #30210 to prevent valid but empty feeds from returning 404 file not found errors for the home and custom feeds.

The tests in the commit that remain applicable are retained.

Props pavelevap for reporting, stevenkword for initial patch.
See #30210.
Fixes #39157.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 23:09:41 +00:00
Sergey Biryukov
8e84504401 Link Manager: Correct version number for _deprecated_argument() in xfn_check().
Props grapplerulrich.
Fixes #39737.
Built from https://develop.svn.wordpress.org/trunk@40029


git-svn-id: http://core.svn.wordpress.org/trunk@39966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 22:14:40 +00:00
Sergey Biryukov
9d7ea04936 I18N: Merge similar strings in _deprecated_argument() calls.
Add translator comments.

Props ramiy, SergeyBiryukov.
Fixes #39020.
Built from https://develop.svn.wordpress.org/trunk@40028


git-svn-id: http://core.svn.wordpress.org/trunk@39965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 11:50:41 +00:00
Sergey Biryukov
b0bcea2a18 Docs: Clarify that wp_list_pages() and get_pages() only work with hierarchical post types.
Props doublehhh.
Fixes #39369.
Built from https://develop.svn.wordpress.org/trunk@40027


git-svn-id: http://core.svn.wordpress.org/trunk@39964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 10:59:42 +00:00
Sergey Biryukov
e1906ab3f1 Embeds: After [31148], list correct method in WP_oEmbed::$compat_methods.
Props LewisCowles.
Fixes #39292.
Built from https://develop.svn.wordpress.org/trunk@40026


git-svn-id: http://core.svn.wordpress.org/trunk@39963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 07:32:43 +00:00
Pascal Birchler
b076f7e4a8 Plugins: Remove trailing pipe symbol in sub navigation after updating the last plugin.
Props sagarprajapati.
Fixes #39655.
Built from https://develop.svn.wordpress.org/trunk@40025


git-svn-id: http://core.svn.wordpress.org/trunk@39962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-28 17:01:46 +00:00
David A. Kennedy
1015c3b3a0 Twenty Seventeen: Rename "Sidebar" widget area for clarity
Renames the "Sidebar" widget area to "Blog Sidebar" and adjust its description to set better expectations for users as to where it appears in the theme.

Props apmarshall 

Fixes #39567.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-28 00:25:42 +00:00
David A. Kennedy
ca0274c2ce Bundled Themes: Allow category display in post preview even when only one category
The category is not shown in the preview. And because of how `themename_categorized_blog()` function in each theme returns false for 1 or fewer categories,  and in this case it won't show the new category.

The patch uses `is_preview()` to fix that in Twenty Fourteen, Fifteen and Seventeen.

Props lancewillett.

Fixes #39531.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 22:09:42 +00:00
David A. Kennedy
bccec366ca Twenty Fourteen: Fix fatal errors in WordPress versions before 4.0.0
The line of code throwing the error was introduced in WordPress 4.5 in r37040 "Customize: Require opt-in for selective refresh of widgets". Since `is_customize_preview()` was introduced in 4.0.0 and Twenty Fourteen should work from WordPress 3.6 and up, this caused the issue.

The patch adds an `is_customize_preview` function if it's missing.

Props adamsilverstein.

Fixes #39407.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 20:31:42 +00:00
Andrea Fercia
4ca4ff999a Accessibility: Make the inline uploader button a real button.
See `wp.media.view.UploaderWindow`.

Fixes #39305.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 18:32:41 +00:00
Adam Silverstein
a6d772108d Media: ensure JavaScript initialized when media edit screen is loaded directly.
Fix a JavaScript error when the media edit screen is loaded directly via a url such as `/wp-admin/post.php?post={post_id}&action=edit&image-editor`. Add a check in `imgLoaded` for `this.hold.sizer` which is set up during initialization and required for the cropping tool. Call `init` if this is undefined.

Props NoseGraze.
Fixes #38138.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 18:30:43 +00:00
Andrew Ozz
69c29935d5 TinyMCE: improve the previews for embedded WordPress posts:
- Add option to force a sandbox iframe in wpview.
- Use it to show the embedded post preview.
- Remove the deprecated `wpembed` plugin.js

Fixes #39513.
Built from https://develop.svn.wordpress.org/trunk@40019


git-svn-id: http://core.svn.wordpress.org/trunk@39956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 04:25:44 +00:00
Weston Ruter
b6281dbd75 Customize: Trim whitespace from nav menu item titles so that the underlying object's original title appears as input placeholder and in the control's title.
Whitespace is trimmed from titles in PHP when saved in any case, so this aligns the client-side behavior with what happens on the server.

Amends [38618].
See #38015.
Fixes #39600.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 18:08:40 +00:00
Boone Gorges
fe1e3dba98 Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the
REST API fetches posts and other objects.

See #38792, #37738.
Built from https://develop.svn.wordpress.org/trunk@39992


git-svn-id: http://core.svn.wordpress.org/trunk@39929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 16:53:41 +00:00
Joe Hoyle
9463f7640b REST API: Fix unit tests for posts out of bounds errors
Previously we were assuming pagination headers would be sent when the request for posts is out of bounds. Instead presume it will return an error.

See #39061.
Built from https://develop.svn.wordpress.org/trunk@39991


git-svn-id: http://core.svn.wordpress.org/trunk@39928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 15:16:43 +00:00
Dominik Schilling
21264a31e0 Press This: Do not show Categories & Tags UI for users who cannot assign terms to posts anyways.
Built from https://develop.svn.wordpress.org/trunk@39968


git-svn-id: http://core.svn.wordpress.org/trunk@39905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:58:44 +00:00
Joe Hoyle
99cf07d882 REST API: Return an error if the page number is out of bounds.
Return an error from the REST API if a page number larger than the total pages count is requested.

Props morganestes.
Fixes #39061.
Built from https://develop.svn.wordpress.org/trunk@39967


git-svn-id: http://core.svn.wordpress.org/trunk@39904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:54:41 +00:00
John Blackbourn
4482f92070 Posts, Post Types: When using Excerpt mode on the Posts list table, ensure the excerpt output matches what was manually entered into the Excerpt field.
Built from https://develop.svn.wordpress.org/trunk@39956


git-svn-id: http://core.svn.wordpress.org/trunk@39893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:41:44 +00:00
Joe Hoyle
e357195ce3 REST API: Unify object access handling for simplicity.
Rather than repeating ourselves, unifying the access into a single method keeps everything tidy. While we're at it, add in additional schema handling for common parameters.

See #38792.
Built from https://develop.svn.wordpress.org/trunk@39954


git-svn-id: http://core.svn.wordpress.org/trunk@39891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:39:41 +00:00
Dominik Schilling
85384297a6 Query: Ensure that queries work correctly with post type names with special characters.
Built from https://develop.svn.wordpress.org/trunk@39952


git-svn-id: http://core.svn.wordpress.org/trunk@39889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:33:45 +00:00
Weston Ruter
a44f8db73d Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.
Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh.
See #27403.
Fixes #39498.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 03:47:41 +00:00
Sergey Biryukov
d10f451770 Docs: Add missing file header to wp-admin/includes/noop.php, introduced in [34037].
Props carl-alberto.
Fixes #39690.
Built from https://develop.svn.wordpress.org/trunk@39950


git-svn-id: http://core.svn.wordpress.org/trunk@39887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-25 23:10:43 +00:00
Peter Wilson
1a18262fd5 Menus: Prevent notice thrown in class-walker-page.php.
Calling `Walker_Page::walk()` directly was causing an `Undefined index: item_spacing` notice to be thrown, this adds an `isset()` check to prevent it.

Props bhargavbhandari90.
Fixes #39564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 23:29:42 +00:00
Felix Arntz
832b16b966 Multisite: Show menu items in My Sites > Network Admin admin bar menu based on more precise capability checks.
Previously the menu items would all be displayed solely based on the `manage_network` capability. This change provides parity with the network admin menu.

Unit tests for the network admin menu functionality of `wp_admin_bar_my_sites_menu()` have been added.

Props chandrapatel.
Fixes #39082.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 16:29:40 +00:00
Felix Arntz
82dc367cd4 Multisite: Replace is_super_admin() with a proper capability check when showing a notice about WPLANG.
In multisite, the notice is displayed to users that have the `manage_network_options` capability. In non-multisite, the notice is displayed to users with the `manage_options` capability.

Props Dhaval Parekh.
Fixes #39207. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 13:13:41 +00:00
Felix Arntz
34ad21bcfa Multisite: Remove unnecessary is_super_admin() check when adding an existing user to a site.
Prior to this change, a super admin user that is added to a site who they are already a member of would still get reinvited.

Props supercoder.
Fixes #39220. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 12:03:43 +00:00
Felix Arntz
36fa7f72c0 Multisite: Replace is_super_admin() with manage_network_users when trying to import new users.
Props bhargavbhandari90.
Fixes #39212. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:39:40 +00:00
Felix Arntz
ff74a4cb7b Multisite: Replace is_super_admin() with manage_network when showing a message to the network administrator in wp-signup.php.
Props jignesh.nakrani.
Fixes #39209. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:08:42 +00:00
Felix Arntz
6fcb0e8b7f Multisite: Replace is_super_admin() with manage_network_users when trying to change the role of oneself.
Props abhishek kaushik.
Fixes #39204. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:04:44 +00:00
Sergey Biryukov
64694c6742 Twenty Seventeen: Improve typography for Simplified Chinese (zh_CN).
Props ze3kr, Dharm1025.
Fixes #39379.
Built from https://develop.svn.wordpress.org/trunk@39942


git-svn-id: http://core.svn.wordpress.org/trunk@39879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 07:27:44 +00:00
Sergey Biryukov
ca832f66f3 Text Changes: Add a period to the only wp_die() message that didn't have it: "Invalid plugin page".
Props Presskopp.
Fixes #39664.
Built from https://develop.svn.wordpress.org/trunk@39941


git-svn-id: http://core.svn.wordpress.org/trunk@39878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-22 02:33:42 +00:00
Sergey Biryukov
bf1e6d1226 Docs: After [39939], "locales" should be plural.
See #39658.
Built from https://develop.svn.wordpress.org/trunk@39940


git-svn-id: http://core.svn.wordpress.org/trunk@39877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 17:26:41 +00:00
Sergey Biryukov
bee96601bd I18N: Add support for Bosnian locale in remove_accents().
Applies "letter D with stroke" replacement made in [38646] for Serbian (`sr_RS`) to Bosnian (`bs_BA`) as well.

Props H3llas for the report.
Fixes #39658.
Built from https://develop.svn.wordpress.org/trunk@39939


git-svn-id: http://core.svn.wordpress.org/trunk@39876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 17:16:43 +00:00
Sergey Biryukov
35d5918a1d Posts, Post Types: Preserve author filter in list table after entering a page number in paging input.
Props sagarprajapati.
Fixes #39523.
Built from https://develop.svn.wordpress.org/trunk@39938


git-svn-id: http://core.svn.wordpress.org/trunk@39875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 02:22:26 +00:00
Sergey Biryukov
8f0e75db16 Users: Preserve role filter in list table after entering a page number in paging input.
Props kailanitish90, sagarprajapati.
Fixes #39435.
Built from https://develop.svn.wordpress.org/trunk@39937


git-svn-id: http://core.svn.wordpress.org/trunk@39874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 02:21:43 +00:00
Sergey Biryukov
4fbcfe3a8c Docs: After [38672], update $type parameter description for submit_button() and get_submit_button().
Remove the mention of `secondary` and `delete` classes as core values, add `small` and `large`.

Props afercia.
Fixes #23477.
Built from https://develop.svn.wordpress.org/trunk@39936


git-svn-id: http://core.svn.wordpress.org/trunk@39873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 20:37:42 +00:00
Felix Arntz
41fc0c0f5a Multisite: Replace is_super_admin() with manage_network_users when trying to add an existing user via username.
Props dhanendran.
Fixes #39202. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:49:41 +00:00
Felix Arntz
c22fea9120 Multisite: Replace is_super_admin() with manage_network_users when checking for users autocomplete capabilities.
Props ashokkumar24.
Fixes #39201. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:43:42 +00:00
Felix Arntz
6e5cd6d397 Multisite: Replace is_super_admin() with manage_network_options in wp-admin/options.php.
Props sathyapulse.
Fixes #39200. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:39:41 +00:00
Felix Arntz
dd23a8f48c Multisite: Do not check for is_super_admin() when trying to set user settings.
The checks were introduced in [22256] to prevent user settings to be set for super admins that were not a member of the current site. However the latter should apply to any kind of user, so the `is_super_admin()` check is redundant. Furthermore, removing these checks is necessary for the ongoing effort to get rid of `is_super_admin()` checks in general.

Props chandrapatel for initial patch.
Fixes #39199. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:33:41 +00:00