Commit Graph

37308 Commits

Author SHA1 Message Date
John Blackbourn
a89374bc30 Embeds: Switch the collegehumor.com oEmbed endpoint to HTTPS, as it redirects there by default now.
See #28507


git-svn-id: https://develop.svn.wordpress.org/trunk@41680 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:05:18 +00:00
Weston Ruter
64f0d4a544 Customize: Fix jumping behavior upon scrolling up when a sticky header has its description expanded.
Props delawski.
See #34343, #41879.
Fixes #41850.


git-svn-id: https://develop.svn.wordpress.org/trunk@41679 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:54:22 +00:00
Adam Silverstein
10488d5fdc WP-API JS Client: Improve support for meta.
* Add/fix `getMeta`, `getMetas`, `setMeta` and `setMetas` helpers for models that support meta.
* Add tests for new helpers, verify meta support for `Posts`, `Comments`, `Tags` and `Users`.
* Include meta data in fixture generation and fixture file driving tests.

Fixes #41055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41678 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:39:30 +00:00
Weston Ruter
ba07b22cb5 Customize: Fix positioning of outer section (e.g. publish settings) on large screen sizes.
Also fix preview link CSS for desktop and mobile.

Props sayedwp, bduclos.
See #39896.
Fixes #42051.


git-svn-id: https://develop.svn.wordpress.org/trunk@41677 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:39:10 +00:00
John Blackbourn
493805239e Embeds: Alignment following [41615].
See #38181


git-svn-id: https://develop.svn.wordpress.org/trunk@41676 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:37:53 +00:00
Adam Silverstein
f2eb141e77 Menus: Increase timeout for QUnit wpNavMenu trigger tests.
Fix an (intermittent) issue where the final assertion verifying all hooks have been triggered ran too early, resulting in the test failing. 

Fixes #31218.


git-svn-id: https://develop.svn.wordpress.org/trunk@41675 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:34:53 +00:00
John Blackbourn
42a74c2aef Taxonomy: Add context and a translator comment to the new most_used label.
Fixes #41150


git-svn-id: https://develop.svn.wordpress.org/trunk@41674 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:24:46 +00:00
Konstantin Obenland
4666f2fd39 Widgets: Revert format of sidebars_widgets.
Restores the data format of the `sidebars_widgets` theme mod to its pre [41555]
format. It can trigger PHP warnings after switching themes if that mod has not
been removed previously.

Fixes #39693.



git-svn-id: https://develop.svn.wordpress.org/trunk@41673 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:10:06 +00:00
Weston Ruter
32a6ac3918 Customize: Improve styling of date/time Customizer control.
* Let date `legend` be screen reader text when time is not included.
* Skip rendering containers for label (title) and description when not supplied in registered control.
* Fix margins and padding.

Amends [41670].
Props westonruter, afercia, sayedwp.
Fixes #42022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41672 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:33:10 +00:00
Weston Ruter
e8e027e7a6 Plugin Editor: Remove plugins_loaded from being re-triggered in plugin_sandbox_scrape().
Props jdgrimes.
Amends [41560].
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41671 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:06:46 +00:00
Weston Ruter
ef14cd1952 Customize: Fix WP_Customize_Date_Time_Control to be re-usable for plugins and custom settings.
* Allow time fields to be omitted by constructing with `timeIncluded` as `false`.
* Ensure `reportValidity` is only called on a control when it is in an expanded section.
* Rename "ampm" to "meridian".
* Improve accessibility and fix HTML validation and style issues for both the date/time control and the preview link control.
* Fix styling of dropdowns and clean CSS.
* Improve accessibility of nav menus component.

Props westonruter, afercia, sayedwp, melchoyce.
Amends [41626].
See #39896.
Fixes #42022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41670 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 04:11:50 +00:00
Peter Wilson
1059c44025 Emoji: Refactor browser support tests.
Moves the repeated code in the emoji browser support test to a function to reduced the potential for errors and follow DRY principles.

Renames the "emoji4" test "emoji" as unicode version specific tests were removed in [38869].

Props peterwilsoncc, pento for code review.
Fixes #41156.



git-svn-id: https://develop.svn.wordpress.org/trunk@41669 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:59:50 +00:00
Jeremy Felt
28b28b581a Multisite: Deprecate is_user_option_local().
`is_user_option_local()` was added during MU development and used for a handful of changesets before the code using it was removed again. It has not been used by MU or core since nor is it widely used elsewhere.

Fixes #41697.
Props bnap00, jeremyfelt.


git-svn-id: https://develop.svn.wordpress.org/trunk@41668 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:37:29 +00:00
Weston Ruter
3fbb8ed287 Customize: Add infrastructure for trashing/reverting of unpublished changes; introduce full-screen OverlayNotification for trashing and theme install/preview.
* Introduce a new `wp.customize.previewer.trash()` JS API to trash the current changeset, along with logic to `WP_Customize_Manager` to handle deleting changeset drafts.
* Add `trashing` to `wp.customize.state` which is then used to update the UI.
* UI for trashing is pending design feedback. One possibility is to add a new trash button to Publish Settings section that invokes `wp.customize.previewer.trash()`.
* Improve logic for managing the visibility and disabled states for publish buttons.
* Prevent attempting `requestChangesetUpdate` while processing and bump processing while doing `save`.
* Update `changeset_date` state only if sent in save response.
* Merge `ThemesSection#loadThemePreview()` into `ThemesPanel#loadThemePreview()`.
* Remove unused `autosaved` state.
* Start autosaving and prompting at beforeunload after a change first happens. This is key for theme previews since even if a user did not make any changes, there were still dirty settings which would get stored in an auto-draft unexpectedly.
* Allow `Notification` to accept additional `classes` to be added to `container`.
* Introduce `OverlayNotification` and use for theme installing, previewing, and trashing. Such overlay notifications take over the entire window.

Props westonruter, celloexpressions.
See #37661, #39896, #21666, #35210.


git-svn-id: https://develop.svn.wordpress.org/trunk@41667 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:36:18 +00:00
Jeremy Felt
8db1a09d09 Docs: Clarify docs for hooked count/date updates
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41666 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:19:17 +00:00
Jeremy Felt
d271e5d356 Multisite: Only update a site's post count when post types of post are updated.
Previously, the query to update the count of published posts would run every time any post type transitioned between a `publish`/non-published status or was deleted.

Props sboisvert, JPry, spacedmonkey.
Fixes #42021.


git-svn-id: https://develop.svn.wordpress.org/trunk@41665 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:08:18 +00:00
Jeremy Felt
e7c17229df Multisite: Use get_networks() instead of a direct query in get_admin_users_for_domain().
Props spacedmonkey.
Fixes #41806.


git-svn-id: https://develop.svn.wordpress.org/trunk@41664 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:05:47 +00:00
Gary Pendergast
d16b885730 Database: Fix some PHP errors introduced in [41662].
PHP < 5.4 requires a `$matches` parameter to be passed to `preg_match_all()`

`wpdb::prepare()` can be called before translations are loaded, so needs appropriate `wp_load_translations_early()` calls.

See #42040.



git-svn-id: https://develop.svn.wordpress.org/trunk@41663 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 02:44:48 +00:00
Gary Pendergast
b4a6de9997 Database: Throw a notice if wpdb::prepare() is called with an incorrect number of arguments
`wpdb::prepare()` currently gives no information if the number of arguments passed doesn't match the number of placeholders in the query. This change gives an explicit notice that the call was incorrect.

Also fixes an enrelated term meta test that was triggering this new notice.

Props thekt12 for the initial patch.
Fixes #42040.



git-svn-id: https://develop.svn.wordpress.org/trunk@41662 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 02:10:14 +00:00
Jeremy Felt
e02c481487 Multisite: Use get_current_blog_id() instead of $wpdb->blogid.
`get_current_blog_id()` is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global `$wpdb` in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.


git-svn-id: https://develop.svn.wordpress.org/trunk@41661 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 01:43:48 +00:00
Gary Pendergast
ea23ff3422 Docs: Clarify the docs for wpdb::prepare().
Make the usage of the `%` wildcard in queries clearer.

Props jrf.
Fixes #41983.



git-svn-id: https://develop.svn.wordpress.org/trunk@41660 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 00:21:06 +00:00
Jeremy Felt
38d5112c25 Build/Test Tools: Add ms-files test group to sub-task list.
Previously, the `ms-files` test group would not run in any automatic configuration. This ensures it is always run as part of the test suite in Travis CI.

Props netweb.
Fixes #41698.


git-svn-id: https://develop.svn.wordpress.org/trunk@41659 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 22:15:16 +00:00
Andrea Fercia
7a414342df Accessibility: Improve the Theme Details modal accessibility.
- sets the modal content to `role="document"` to make screen readers switch back to browse mode
- standardizes the Themes screen and Customizer modals interaction
- Themes screen modal: sets initial focus on the modal overlay instead of the primary button, avoiding to "skip" content for keyboard and screen reader users

Fixes #42055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41658 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:47:29 +00:00
Adam Silverstein
625773bd8b REST API JavaScript Client: improve support for model deletion/trash.
Update the way and location the JavaScript client determines which models/endpoints require the `force=true` parameter when being deleted to avoid a `rest_trash_not_supported` error. Identify models with endpoints that support DELETE, excluding those that support the trash (posts and pages by default). Also, move the check into the default `wp.api.WPApiBaseModel.initialize()` function.

Props caercam, euthelup.
Fixes #40672.



git-svn-id: https://develop.svn.wordpress.org/trunk@41657 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:06:43 +00:00
Andrew Ozz
a0692f9597 Editor: Use editor.$ to improve removeSelectionMarker().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41656 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 10:32:58 +00:00
Andrew Ozz
d36c32e299 Editor: pass the DOM library instance instead of a (fake) editor instance to getCursorMarkerSpan().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41655 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 09:41:23 +00:00
Felix Arntz
84daf097a0 Multisite: Fix wp_get_users_with_no_role() possibly including users with a role on a different site.
Prior to this change, when passing another site than the current one to `wp_get_users_with_no_role()` through its `$site_id` parameter, the function still used the roles available on the current site, which would cause users with other roles that possibly exist on the other site to show up as users without a role. Switching the site before retrieving the available rules fixes the issue.

Fixes #42015.


git-svn-id: https://develop.svn.wordpress.org/trunk@41654 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 04:09:11 +00:00
Felix Arntz
761c45157e Multisite: Fix count_users() possibly querying incorrect roles when passed a different site ID.
The `time` strategy in `count_users()` queries users by role. However, the roles queried for were not affected by passing another site than the current one through the `$site_id` parameter, causing users having roles that were not queried for to appear as users without a role. This changeset fixes the issue by switching the site before retrieving the roles to query for.

Fixes #42014.


git-svn-id: https://develop.svn.wordpress.org/trunk@41653 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 03:53:27 +00:00
Felix Arntz
75c4cb98f4 Multisite: Display correct roles in Network > Site Users screen for sites other than the main site.
Props jeremyfelt.
Fixes #42013.


git-svn-id: https://develop.svn.wordpress.org/trunk@41652 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 03:19:26 +00:00
Weston Ruter
6e74a9bf23 Embeds: Cache oEmbeds in an oembed_cache custom post type instead of postmeta when there is no global $post.
Add processing of embeds to rich Text widget.

Props swissspidy, westonruter, ocean90, johnbillion.
See #40854, #39994, #40935.
Fixes #34115.


git-svn-id: https://develop.svn.wordpress.org/trunk@41651 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 01:14:34 +00:00
Weston Ruter
743494b654 Customize: Remove unused JS variables to fix JSHint.
Amends [41649].
See #37661, #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41650 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 22:03:15 +00:00
Weston Ruter
d2540cfa06 Customize: Improve interactions between the Themes panel and Publish Settings section.
* Deactivate the Themes panel immediately after changing selected status to non-publish.
* Animate publish settings button into view with publish button when collapsing Themes panel.
* Deactivate publish settings section and hide publish settings button entirely when customizer state is clean.
* Harden access of Themes panel in case it was removed by plugin.
* Fix throttling of `renderScreenshots` calls in `ThemesSection`.

Amends [41648], [41626].
See #37661, #39896, #34843.


git-svn-id: https://develop.svn.wordpress.org/trunk@41649 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 21:51:42 +00:00
Weston Ruter
c35fe07703 Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.

Also includes CSS auto-prefixing added via `grunt precommit:css`.

For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.


git-svn-id: https://develop.svn.wordpress.org/trunk@41648 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 20:12:19 +00:00
John Blackbourn
6d399d4de8 Build/Test tools: Partially revert [41367] as gd and exif aren't actually required to run WordPress.
See #41851


git-svn-id: https://develop.svn.wordpress.org/trunk@41647 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 19:56:33 +00:00
Andrew Ozz
b076026362 Editor: improve attaching a callback on editor init.
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41646 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 19:11:08 +00:00
Andrew Ozz
6b72687e10 Editor: Improve keeping text selection when switching between Visual and Text modes.
Props biskobe.
See #42029.

git-svn-id: https://develop.svn.wordpress.org/trunk@41645 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 17:49:43 +00:00
Sergey Biryukov
cc08743ec5 Posts, Post Types: Correct test_submitting_comment_to_trashed_post_returns_error().
`wp_trash_post()` accepts a post ID, not a `WP_Post` object.

See #42030.

git-svn-id: https://develop.svn.wordpress.org/trunk@41644 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 15:09:39 +00:00
Andrew Ozz
1d022678bb TinyMCE: fix "flickering inline toolbar" in Chrome in RTL mode by not showing tooltips while an inline toolbar is shown.
Fixes #42018.

git-svn-id: https://develop.svn.wordpress.org/trunk@41643 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 14:24:19 +00:00
Sergey Biryukov
e549a6c53c Posts, Post Types: In wp_delete_post(), wp_trash_post(), wp_untrash_post(), and wp_delete_attachment(), standardize on WP_Post as a return value and internal representation of the post data.
Props bor0, SergeyBiryukov.
Fixes #42030.

git-svn-id: https://develop.svn.wordpress.org/trunk@41642 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 13:35:42 +00:00
Sergey Biryukov
3edd5dac38 I18N: Use a consistent pattern for translator comments for placeholders in wp-admin/includes/dashboard.php.
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@41641 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:43:27 +00:00
Sergey Biryukov
13b5f8272a I18N: Use a consistent pattern for translator comments for placeholders in Customizer and widget strings.
Props danieltj, Rahmohn.
Fixes #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@41640 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:41:06 +00:00
Sergey Biryukov
b8d32950e7 I18N: Improve i18n in help text for Custom HTML widget and Additional CSS section.
Fixes #42032.

git-svn-id: https://develop.svn.wordpress.org/trunk@41639 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:09:13 +00:00
Sergey Biryukov
fa754724e1 Posts, Post Types: Introduce pre_trash_post and pre_untrash_post filters to allow for short-circuiting wp_trash_post() and wp_untrash_post().
This brings parity with `pre_delete_post` filter in `wp_delete_post()`, introduced in [34082].

Props bor0.
Fixes #42030.

git-svn-id: https://develop.svn.wordpress.org/trunk@41638 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 10:18:11 +00:00
John Blackbourn
58140009e5 Build/Test tools: Update the WP_PHPUnit_Util_Getopt class for PHP 7.2 compatibility.
This removes usage of `each()` which is deprecated in PHP 7.2.

Props ayeshrajans

See #40109
Fixes #41525


git-svn-id: https://develop.svn.wordpress.org/trunk@41636 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 23:14:26 +00:00
John Blackbourn
4277df991d Build/Test tools: Update some test cases in anticipation of code formatting corrections.
These two tests assume a certain level of indentation in code which does not conform to core's coding
standards and will hopefully be corrected at some point in #41057.

See #41057


git-svn-id: https://develop.svn.wordpress.org/trunk@41635 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 22:55:54 +00:00
Dominik Schilling (ocean90)
c8ff7f6592 Embeds: In switched state, restore previous state if no post ID is found.
Fixes #40673.

git-svn-id: https://develop.svn.wordpress.org/trunk@41634 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 16:28:46 +00:00
John Blackbourn
bbf0683deb External Libraries: Update the Text_Diff_Engine_native class for PHP 7.2 compatibility.
This removes usage of `each()` and usage of text strings passed to `assert()`.

Props bor0

Fixes #41526


git-svn-id: https://develop.svn.wordpress.org/trunk@41633 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 13:58:23 +00:00
Gary Pendergast
345aac85a6 Docs: Update the documentation for wpdb::prepare()
The inline documentation for `wpdb::prepare()` was kind of confusing, and didn't describe some of the behaviour correctly.

Fixes #41983.



git-svn-id: https://develop.svn.wordpress.org/trunk@41632 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 11:44:30 +00:00
Gary Pendergast
d93dcaf75f Setup: Hide database errors while testing the table prefix.
If DB errors are shown during installation, the table prefix test will also show an error, even though we're deliberately trying to generate that error.

Fixes #40655.



git-svn-id: https://develop.svn.wordpress.org/trunk@41631 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 07:57:22 +00:00
Gary Pendergast
98cdd162b2 Post Editor: Keep text selection between Visual and Text modes
When switching between post editor modes, the current cursor position and selection is now preserved. This allows authors to switch modes without losing the context of where they were in the document.

Props biskobe.
Fixes #41962.



git-svn-id: https://develop.svn.wordpress.org/trunk@41630 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 06:44:09 +00:00