Commit Graph

36304 Commits

Author SHA1 Message Date
Andrew Ozz 1a068f2a61 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@40019 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-27 04:24:58 +00:00
Weston Ruter a2ac38016d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39994 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 18:07:58 +00:00
Boone Gorges 18e09d246e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39992 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 16:52:51 +00:00
Joe Hoyle 0167cea791 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39991 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 15:15:07 +00:00
Dominik Schilling (ocean90) 4c00303955 Press This: Do not show Categories & Tags UI for users who cannot assign terms to posts anyways.
git-svn-id: https://develop.svn.wordpress.org/trunk@39968 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:57:55 +00:00
Joe Hoyle 38b400c4d7 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39967 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:52:06 +00:00
John Blackbourn a96089e8e6 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.
git-svn-id: https://develop.svn.wordpress.org/trunk@39956 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:40:17 +00:00
Joe Hoyle 0a82ee0a31 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39954 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:38:27 +00:00
Dominik Schilling (ocean90) d2374614c2 Query: Ensure that queries work correctly with post type names with special characters.
git-svn-id: https://develop.svn.wordpress.org/trunk@39952 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:32:24 +00:00
Weston Ruter 8f4e0b7ed8 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39951 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 03:46:52 +00:00
Sergey Biryukov f6938b23b1 Docs: Add missing file header to `wp-admin/includes/noop.php`, introduced in [34037].
Props carl-alberto.
Fixes #39690.

git-svn-id: https://develop.svn.wordpress.org/trunk@39950 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-25 23:09:37 +00:00
Peter Wilson 6de7c69c0d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39949 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 23:28:13 +00:00
Felix Arntz cf0ca2645f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39948 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 16:28:30 +00:00
Felix Arntz ed4e456601 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39947 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 13:12:28 +00:00
Felix Arntz 88c2b69d9e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39946 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 12:02:25 +00:00
Felix Arntz 34c9399db8 Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to import new users.
Props bhargavbhandari90.
Fixes #39212. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39945 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 11:39:01 +00:00
Felix Arntz 8bf00cceaf 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39944 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 11:07:15 +00:00
Felix Arntz 816686b709 Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to change the role of oneself.
Props abhishek kaushik.
Fixes #39204. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39943 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 11:03:07 +00:00
Sergey Biryukov b7b052df58 Twenty Seventeen: Improve typography for Simplified Chinese (`zh_CN`).
Props ze3kr, Dharm1025.
Fixes #39379.

git-svn-id: https://develop.svn.wordpress.org/trunk@39942 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 07:26:34 +00:00
Sergey Biryukov c9d95475c6 Text Changes: Add a period to the only `wp_die()` message that didn't have it: "Invalid plugin page".
Props Presskopp.
Fixes #39664.

git-svn-id: https://develop.svn.wordpress.org/trunk@39941 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-22 02:32:57 +00:00
Sergey Biryukov cc9843a12c Docs: After [39939], "locales" should be plural.
See #39658.

git-svn-id: https://develop.svn.wordpress.org/trunk@39940 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 17:25:40 +00:00
Sergey Biryukov 385e9d1a78 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39939 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 17:15:57 +00:00
Sergey Biryukov a37269ee4a Posts, Post Types: Preserve author filter in list table after entering a page number in paging input.
Props sagarprajapati.
Fixes #39523.

git-svn-id: https://develop.svn.wordpress.org/trunk@39938 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 02:20:38 +00:00
Sergey Biryukov 33cf1046db Users: Preserve role filter in list table after entering a page number in paging input.
Props kailanitish90, sagarprajapati.
Fixes #39435.

git-svn-id: https://develop.svn.wordpress.org/trunk@39937 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 02:20:23 +00:00
Sergey Biryukov 34bc9bde36 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39936 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 20:36:07 +00:00
Felix Arntz 51c38bec8b Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to add an existing user via username.
Props dhanendran.
Fixes #39202. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39935 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:48:31 +00:00
Felix Arntz 043cf0fc00 Multisite: Replace `is_super_admin()` with `manage_network_users` when checking for users autocomplete capabilities.
Props ashokkumar24.
Fixes #39201. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39934 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:42:21 +00:00
Felix Arntz d0bdcb93f0 Multisite: Replace `is_super_admin()` with `manage_network_options` in `wp-admin/options.php`.
Props sathyapulse.
Fixes #39200. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39933 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:38:15 +00:00
Felix Arntz 60f3612684 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39932 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:32:13 +00:00
Sergey Biryukov c0926aa662 REST API: Add `group` and description to `WP_Test_REST_Request_Validation`.
Props danielbachhuber.
Fixes #39654.

git-svn-id: https://develop.svn.wordpress.org/trunk@39931 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:12:59 +00:00
Felix Arntz efbe7902ce Multisite: Display correct scheme for the main site in `site-info.php`.
Props greatislander.
Fixes #39365.


git-svn-id: https://develop.svn.wordpress.org/trunk@39930 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:02:37 +00:00
Felix Arntz 29aa25c4af Multisite: Correct and improve i18n strings in `wp-signup.php`.
The strings addressing the network administrator in `wp-signup.php` were still using the old terminology of blogs and sites. Furthermore concatenation of the strings has been removed to make them i18n-friendly.

Props jignesh.nakrani, SergeyBiryukov.
Fixes #39611.


git-svn-id: https://develop.svn.wordpress.org/trunk@39929 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 16:51:59 +00:00
Adam Silverstein 3a449139db Menus: trigger an event when menu items are added or removed.
Fire a `menu-item-added` event after a menu item is added to the DOM. Fire a `menu-removing-item` event before a menu item is removed from the DOM. Enables hooking into and responding to menu changes.

Props welcher, adamsilverstein.
Fixes #31218.


git-svn-id: https://develop.svn.wordpress.org/trunk@39928 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 16:14:23 +00:00
Sergey Biryukov 83e7606f76 Customize: Remove redundant context for "Reorder" and "Done" strings in nav menu and widget area controls to ensure consistent translations.
Props pavelevap, Presskopp.
Fixes #33747.

git-svn-id: https://develop.svn.wordpress.org/trunk@39927 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 05:59:32 +00:00
Sergey Biryukov 1925fd16e4 Media: Pass the current attachment object to `display_media_states` filter, for consistency with `display_post_states`.
Props pbiron, chriseverson.
Fixes #39628.

git-svn-id: https://develop.svn.wordpress.org/trunk@39926 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 05:19:26 +00:00
Sergey Biryukov 7a9d5c9ab9 Media: After [36837], check the correct theme modification name for custom logo in `_media_states()`.
Props pbiron, mitraval192.
Fixes #39627.

git-svn-id: https://develop.svn.wordpress.org/trunk@39925 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-19 02:02:39 +00:00
Weston Ruter 4e8e97983c Customize: Allow custom post types to be used in starter content.
Changes `WP_Customize_Nav_Menus::insert_auto_draft_post()` so it can be invoked for a `post_type` that is not registered (yet).

See #38615, #38114.
Fixes #39610.


git-svn-id: https://develop.svn.wordpress.org/trunk@39924 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-19 00:00:24 +00:00
Ryan McCue 7d2c104068 REST API: Correctly serve the index with PATH_INFO
When hitting the index, untrailingslashit() would make the REST route empty, which would then use the fallback inside WP_REST_Server. This isn't a problem most of the time, but WP_REST_Server contains a fallback to PATH_INFO. Combined with PATH_INFO permalinks, this would give a 404 on the API index, as it attempts to look up a route for "/wp-json/".

Props ccprog.
Fixes #39432.


git-svn-id: https://develop.svn.wordpress.org/trunk@39923 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 05:39:15 +00:00
Ryan McCue bbf129c935 REST API: Allow shortcircuiting rest_pre_insert_comment
rest_pre_insert_{post_type} allows returning a WP_Error from the filter to shortcircuit actually creating the object, so it makes sense to do so for comments too.

Props dspilka.
Fixes #39578.


git-svn-id: https://develop.svn.wordpress.org/trunk@39922 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 05:17:15 +00:00
Gary Pendergast 16bbc492a5 dbDelta: Ignore index subparts when checking for duplicate indices.
If index lengths change in table definitions, we don't recreate the index - instead, we throw a database error, as `dbDelta()` tries to create a new index with the same name.

It's better to leave the index as is, MySQL doesn't have an efficient process for resizing indices, and dropping/creating is a slow process which we don't want to trigger automatically.

Fixes #34870.



git-svn-id: https://develop.svn.wordpress.org/trunk@39921 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 04:00:09 +00:00
Sergey Biryukov 0358e8e2cf Users: Introduce `signup_site_meta` and `signup_user_meta` for filtering signup metadata in `wpmu_signup_blog()` and `wpmu_signup_user()`, respectively.
Props Mista-Flo.
Fixes #39223.

git-svn-id: https://develop.svn.wordpress.org/trunk@39920 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 03:52:24 +00:00
Sergey Biryukov 97a4d6c16d Build/Test Tools: Add `assertNotFalse()` method to `WP_UnitTestCase` and use it where appropriate.
Props peterwilsoncc.
Fixes #39219.

git-svn-id: https://develop.svn.wordpress.org/trunk@39919 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 03:39:36 +00:00
Sergey Biryukov 550818ac31 Build/Test Tools: Correctly reference function names in `@covers` entries.
Props pbearne.
Fixes #39235.

git-svn-id: https://develop.svn.wordpress.org/trunk@39918 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 02:43:25 +00:00
Sergey Biryukov 15346053d6 List Tables: Pass the `$which` parameter to `restrict_manage_posts` filter instance in `WP_Media_List_Table`, missed in [37422].
Props wpsmith.
Fixes #38772.

git-svn-id: https://develop.svn.wordpress.org/trunk@39917 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 02:37:14 +00:00
Andrew Ozz e3ffbce181 TinyMCE: strip browser inserted `<u>` and <font>` tags from inside links when copying and pasting in IE and Edge.
Fixes #39570.

git-svn-id: https://develop.svn.wordpress.org/trunk@39916 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 01:24:35 +00:00
Gary Pendergast 8e3b56fbe3 User Query: Cast `$user_total` as an `int`.
The `$user_total` member of `WP_User_Query`, and corresponding `get_total()` method, have always been documented as returning an `int`. `$user_total`, however, is populated by `$wpdb->get_var()`, which returns 
a string (containing an integer value). Casting the return value from `get_var()` as an `int` rectifies this discrepency.

Props runciters.
Fixes #39297.



git-svn-id: https://develop.svn.wordpress.org/trunk@39915 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 23:23:06 +00:00
Andrew Ozz 708c750b2e Tests: `wpautop()` should not add extra `</p>` before `<figcaption>`.
Props pbearne.
See #39307.

git-svn-id: https://develop.svn.wordpress.org/trunk@39914 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 17:56:34 +00:00
James Nylen 79589f4195 REST API: Improve test coverage of single user endpoint for public data.
Add test coverage for requests of a single user resource for authors of post types registered as:

- public = true, show_in_rest = true: success without auth.
- public = true, show_in_rest = false: fail without auth.
- public = false, show_in_rest = true: success without auth.
- public = false, show_in_rest = false: fail without auth.

See #38878.
Fixes #39546.


git-svn-id: https://develop.svn.wordpress.org/trunk@39913 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 16:21:00 +00:00
Andrew Ozz 14e5a08f5c Formatting: fix `wpautop()` to stop adding paragraph tags around `<figcaption>`.
Fixes #39307 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@39912 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 01:05:33 +00:00
Andrew Ozz f8cc0fda44 Docs: some improvements/fixes for editor.js.
See #38933.

git-svn-id: https://develop.svn.wordpress.org/trunk@39911 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 00:48:49 +00:00