Commit Graph

22820 Commits

Author SHA1 Message Date
Andrew Ozz
3807829ac4 TinyMCE: if the current editor configuration is without toolbars, prevent errors when adding the labels for custom shortcuts.
Fixes #38063.
Built from https://develop.svn.wordpress.org/trunk@38997


git-svn-id: http://core.svn.wordpress.org/trunk@38939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 20:07:32 +00:00
David A. Kennedy
a8b19ca223 Twenty Seventeen: Fix broken and crowded pagination navigation on small screens
* Hides page numbers visually at smaller screen sizes.
* Reduced padding around `.wrap` class on smaller screens.
* Fixed issue with the page numbers not displaying the underline on `:hover`. This has been updated in the custom colors files, too.

Props laurelfulford, caspie.

Fixes #38394.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 17:38:42 +00:00
Helen Hou-Sandí
529ca4d134 Post-4.7 beta 1 bump.
Built from https://develop.svn.wordpress.org/trunk@38995


git-svn-id: http://core.svn.wordpress.org/trunk@38937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 04:33:42 +00:00
Weston Ruter
e35ac97641 Customize: Remove premature (and verbose) check of fresh_site option due to database not being ready on multisite.
Fixes regression in [38991].
See #38114.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 03:43:30 +00:00
Helen Hou-Sandí
7343b3bf40 WordPress 4.7 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@38992


git-svn-id: http://core.svn.wordpress.org/trunk@38935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 03:01:43 +00:00
Weston Ruter
75535c596b Customize: Introduce starter content and site freshness state.
A theme can opt-in for tailored starter content to apply to the customizer when previewing the theme on a fresh install, when `fresh_site` is at its initial `1` value. Starter content is staged in the customizer and does not go live unless the changes are published. Initial starter content is added to Twenty Seventeen.

* The `fresh_site` flag is cleared when a published post or page is saved, when widgets are modified, or when the customizer state is saved.
* Starter content is registered via `starter-content` theme support, where the argument is an array containing `widgets`, `posts`, `nav_menus`, `options`, and `theme_mods`. Posts/pages in starter content are created with the `auto-draft` status, re-using the page/post stubs feature added to nav menus and the static front page controls.
* A `get_theme_starter_content` filter allows for plugins to extend a theme's starter content.
* Starter content in themes can/should re-use existing starter content items in core by using named placeholders.
* Import theme starter content into customized state when fresh site.
* Prevent original_title differences from causing refreshes if title is present.
* Ensure nav menu item url is set according to object when previewing.
* Make sure initial saved state is false if there are dirty settings without an existing changeset.
* Ensure dirty settings are cleaned upon changeset publishing.

Props helen, westonruter, ocean90.
Fixes #38114, #38533.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:57:35 +00:00
Gary Pendergast
60eb1ddc5c REST API: Revert [38980].
`/users/me` still needs attention, but this change wasn't quite ready.

See #38521.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:07:35 +00:00
Joe McGill
f9f6dd7958 Customizer: Fix name of a partial in export_header_video_settings()
Following [38985], this updates a check for partials being set in
`export_header_video_settings()` to use the correct name.

Props bradyvercher.
See #38172.
Built from https://develop.svn.wordpress.org/trunk@38989


git-svn-id: http://core.svn.wordpress.org/trunk@38932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 01:51:31 +00:00
David A. Kennedy
69c8c4ede0 Twenty Seventeen: Make border colors for panels match WordPress UI
Also, fixes the visibility of the borders for panels after the header videos commit.

Props celloexpressions.

Fixes #38408.
See #38172.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 23:24:32 +00:00
David A. Kennedy
1ccea74e32 Twenty Seventeen: Fix issue with missing background color in dark color scheme.
A background color style that was added to the front page during video header implementation did not get included in the `colors-dark.css`, causing a display issue with the dark color scheme.

Props laurelfulford.

See #38172.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 23:01:30 +00:00
David A. Kennedy
769e718d2c Twenty Seventeen: Improve user and developer experience with the customizer integration
* Rename customizer JS files to customize-preview.js and customize-controls.js to align with the core file naming and make it clearer where each file runs.
* Only show the colorscheme_hue control when there's a custom color scheme.
* Update preview JS handling for revised front page section handling, see below.
* Remove all references to "Theme Customizer" in code comments. It hasn't been called that since before 4.0.
* Clarify the purpose of the JS files by updated the code comments in the file headers.
* Improve code readability.
* Make the arbitrary number of front page sections filterable, for UI registration and output.
* Rename twentyseventeen_sanitize_layout to twentyseventeen_sanitize_page_layout to be clearer about what it sanitizes in case child themes or plugins consider reusing it.
* Rename page_options setting/control to page_layout as that's more reflective of what that option does; and again, helps for potential extensions.
* Make the page layout option contextual to pages and the sidebar being inactive, as the option only applies when there is no sidebar (per its description).
* Condense options into a single section.
* Add selective refresh for front page sections.
* Locate active_callback functions within customizer.php so that they're easier to find when editing customizer registrations, similarly to sanitize callbacks.
* Adjust the styling for placeholders for panels that aren't active. 
* Ensure that the new visible edit shortcuts don't have any issues.

Props celloexpressions.

Fixes #38426.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 22:09:40 +00:00
Joe McGill
030bc377dd Themes: Enable video in custom headers.
This adds the ability for themes to add support for videos in custom headers
by passing `'video' => true` as an argument when adding theme support for
custom headers.

Custom video headers are managed through the “Header Visuals” (i.e. “Header Image”)
panel in the Customizer where you can select a video from the media library or set a
URL to an external video (YouTube for now) for use in custom headers.

This introduces several new functions:

`has_header_video()` – Check whether a header video is set or not.
`get_header_video_url()` – Retrieve header video URL for custom header.
`the_header_video_url()` – Display header video URL.
`get_header_video_settings()` – Retrieve header video settings.
`has_custom_header()` – Check whether a custom header is set or not.
`get_custom_header_markup()` – Retrieve the markup for a custom header.
`the_custom_header_markup()` – Print the markup for a custom header.

And a new file, `wp-includes/js/wp-custom-header.js` that handles loading videos
in custom headers.

This also enables video headers in the Twenty Seventeen and Twenty Fourteen themes.

Props davidakennedy, celloexpressions, bradyvercher, laurelfulford, joemcgill.
Fixes #38172.
Built from https://develop.svn.wordpress.org/trunk@38985


git-svn-id: http://core.svn.wordpress.org/trunk@38928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 21:51:31 +00:00
Andrea Fercia
7b0abd1cea Accessibility: Hide the Toolbar sub-menu icons from assistive technologies.
CSS generated content is going to be rendered for speech output more and more in
the next future. When it's not intended to be available for speech output, for
example with font icons, then special care should be used to hide it from
assistive technologies. At the moment, the only reliable way to do this is making 
use of a wrapper element and set `aria-hidden="true"` on it.

Fixes #37513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 20:53:30 +00:00
Andrea Fercia
7a60d6571c Accessibility: Remove inappropriate content from the Posts and Edit screens headings.
Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia.

See #26601.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 20:39:39 +00:00
Rachel Baker
4a37a04d0f REST API: Return WP_Error when a client is attempting to update an option with a non-scalar value to null.
A `null` value is returned in the response for any option that has a non-scalar value.

To protect clients from accidentally including the `null` values from a response object in a request, we do not allow options with non-scalar values to be updated to `null`. Without this added protection a client could mistakenly delete all options that have non-scalar values from the database.

Props joehoyle, rachelbaker.
Fixes #38527.
Built from https://develop.svn.wordpress.org/trunk@38982


git-svn-id: http://core.svn.wordpress.org/trunk@38925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 16:08:45 +00:00
Andrea Fercia
432f5e76b2 Accessibility: Improve the Menus post type meta boxes pagination links.
- adds hidden text to the pagination links
- slightly increases the links clickable area
- fixes a JS error when clicking on the current page number
- avoids to generate nested `<div>` elements at each click 

Props xavortm, cwpnolen, afercia.

Fixes #35577.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 15:23:31 +00:00
Rachel Baker
d42acc530c REST API: Remove the Location header redirect for the /users/me endpoint.
Props youknowriad jnylen0.
Fixes #38521.
Built from https://develop.svn.wordpress.org/trunk@38980


git-svn-id: http://core.svn.wordpress.org/trunk@38923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 14:37:36 +00:00
Weston Ruter
a6d3ba96e8 Customize: Add all dynamic settings for nav menus and nav menu items before previewing to ensure new entries (placeholders) will be recognized.
See #30937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 08:30:30 +00:00
Pascal Birchler
e8af4e510d I18N: Apply the locale filter when returning early in get_locale().
See [38976].
See #29783.
Built from https://develop.svn.wordpress.org/trunk@38978


git-svn-id: http://core.svn.wordpress.org/trunk@38921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 06:40:33 +00:00
Weston Ruter
62445cd41b Customize: Check for existence of controls and settings for background properties before attempting to access.
Amends [38948].
See #22058.
Fixes #38523.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 05:02:35 +00:00
Gary Pendergast
1c5c130af9 I18N: Fix a PHP fatal when get_locale() is called before $wpdb is ready.
If WPDB needs to bail early, it loads the translations, which need to load the locale. Without WPDB, we can't get any database options, so can only rely on what's been loaded so far.

Fixes #29783.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 03:43:49 +00:00
Boone Gorges
f2a7e841eb Share fixtures in REST API endpoint tests.
As sparrows' tears shed steadily
Make widest rivers filled,

`setUp()` routines run prodig'ly
Add minutes to a build.

So cull ye fixtures profligate!
Direct thine frugal gaze!

Our savings here - a half-minute -
When multiplied: Amaze!

See #30017.
Built from https://develop.svn.wordpress.org/trunk@38975


git-svn-id: http://core.svn.wordpress.org/trunk@38918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 02:57:41 +00:00
Boone Gorges
493f76a3d2 REST API: Use wp_get_object_terms() when fetching terms for a post object.
The WP-API plugin originally used a custom method for fetching object
terms in a way that supported the object cache and also accepted all
parameters for `get_terms()`. In [38667], the internals of
`wp_get_object_terms()` were modified to use `WP_Term_Query`, thus
delivering in a native fashion the features that the API had
previously achieved bespokely.

Fixes #38504.
Built from https://develop.svn.wordpress.org/trunk@38974


git-svn-id: http://core.svn.wordpress.org/trunk@38917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 01:42:32 +00:00
Gary Pendergast
582c8a12d2 Customize: Remove an unused variable.
The cleanup in [38972] missed a variable that is no longer being used.

Fixes #27403.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 00:31:29 +00:00
Weston Ruter
022ee8ec36 Customize: Remove unnecessary code for edit shortcuts which is no longer required due to moving buttons inside of partial placement containers.
Props sirbrillig.
Amends [38967].
See #27403.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:38:33 +00:00
Rachel Baker
21e0f964e3 REST API: Add the default_comment_status and default_ping_status options to the setting endpoint.
Props joehoyle.
See #38490.
Built from https://develop.svn.wordpress.org/trunk@38971


git-svn-id: http://core.svn.wordpress.org/trunk@38914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:21:01 +00:00
Andrew Ozz
95720f3b7c TinyMCE: after chats in #core-editor and #desing on Slack, the decision is to not remove Heading 1 for beta1.
See #38049.
Built from https://develop.svn.wordpress.org/trunk@38970


git-svn-id: http://core.svn.wordpress.org/trunk@38913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:01:33 +00:00
Tammie Lister
4233a600bf Twenty Seventeen: Placeholder styling
These were designed but never implemented.

Props melchoyce, davidakennedy
Fixes #38519


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


git-svn-id: http://core.svn.wordpress.org/trunk@38912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 21:56:29 +00:00
Rachel Baker
d359ffc270 REST API: Remove experimental filter wrapper parameter from the Posts Controller class.
Hiding WP_Query params under the filter key (instead of allowing them to be top-level params) was one of our biggest complaints from users of v1 of our REST API. This walks back the re-introduction of the `filter` param during Beta 15, which introduced an "inconsistent mess" and "exposing WP_Query through filter has and will continue to be difficult to support." See https://github.com/WP-API/WP-API/issues/2799.

Props websupporter, rachelbaker.
Fixes #38378.
Built from https://develop.svn.wordpress.org/trunk@38968


git-svn-id: http://core.svn.wordpress.org/trunk@38911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 21:37:31 +00:00
Weston Ruter
71afe657b6 Customize: Add edit shortcuts in customizer preview to visually expose editable elements and focus on the corresponding controls when clicked.
* Edit shortcuts show initially for a moment and then fade away so as to not get in the way of the preview. 
* Visibility of edit shortcuts is toggled by clicking/touching anywhere inert in the document.
* Implements UI for mobile and touch devices which do not support shift-click.
* Adds `editShortcutVisibility` state.
* Adds new methods to `wp.customize.selectiveRefresh.Partial` for managing edit shortcuts.

Incorporates aspects of the Customize Direct Manipulation feature plugin.

Props sirbrillig, mattwiebe, celloexpressions, melchoyce, westonruter, afercia.
Fixes #27403.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 20:03:32 +00:00
David A. Kennedy
834b7c608e Twenty Seventeen: Implement selective refresh for site title and tagline
Adding the `opacity` property to the site title prevents opacity from changing during selective refreshes in the Customizer preview.

Props celloexpressions.

Fixes #38513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 18:43:42 +00:00
Andrea Fercia
6fe17e2a3d Administration: Better accessibility for the "Post locked" indicator.
- hides the locked icon from assistive technologies
- adds hidden text to indicate the post is locked
- moves the info about who's currently editing to the top of the title table cell

Props mariovalney.
Fixes #38185.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:59:29 +00:00
David A. Kennedy
a6df2cced5 Twenty Seventeen: Fix header height on sub-pages.
Moves `setNavProps` so it's no longer only fired on load when the scroll down arrow is present.

Props laurelfulford.

Fixes #38496.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:39:31 +00:00
David A. Kennedy
3103b1ac78 Twenty Seventeen: Make table styles more consistent
* Removes the left padding on the first cell in a row, and the right padding on the last cell in each row - the padding is still there between cells, so the contents don't meet.
* Does the opposite for RTL, and fixes some spacing issues.
* Updates the editor styles to match.

Props laurelfulford, snacking.

Fixes #38447.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:25:40 +00:00
David A. Kennedy
24ab3657cb Twenty Seventeen: Improve front end display in Internet Explorer 8
* Fixes the display issues with the header. The header doesn't look exactly like it does in newer browsers, but it's closer.
* Gets the font sizes a bit more consistent with how it looks like other browsers.
* IE8 doesn't support SVGs, so it's using the fallback styles for some of the icons. The fallbacks are limited to the absolutely necessary icons - so there is one for the submenu dropdown toggle icon, but not for the little 'hamburger' and X that sit in front of the 'menu' button.

Props laurelfulford.

Fixes #38472.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 16:43:34 +00:00
Dominik Schilling
7819e2b4ba I18N: Introduce a locale-switching function.
With the introduction of user-specific languages in [38705] it's necessary to be able to switch translations on the fly. For example emails should be sent in the language of the recipient and not the one of the current user.

This introduces a new `WP_Locale_Switcher` class which is used for switching locales and translations. It holds the stack of locales whenever `switch_to_locale( $locale )` is called. With `restore_previous_locale()` you can restore the previous locale. `restore_current_locale()` empties the stack and sets the locale back to the initial value.

`switch_to_locale()` is added to most of core's email functions, either with the value of `get_locale()` (site language) or `get_user_locale()` (user language with fallback to site language).

Props yoavf, tfrommen, swissspidy, pbearne, ocean90.
See #29783.
Fixes #26511.
Built from https://develop.svn.wordpress.org/trunk@38961


git-svn-id: http://core.svn.wordpress.org/trunk@38904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 15:36:31 +00:00
Boone Gorges
91b518a716 REST API: Use term-specific caps for permission checks in term update and delete endpoints.
See #38505.
Built from https://develop.svn.wordpress.org/trunk@38960


git-svn-id: http://core.svn.wordpress.org/trunk@38903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:52:29 +00:00
Sergey Biryukov
919f08fd2d Comments: In comment_form(), bail early if comments for the post are closed.
Props jipmoors.
Fixes #38514.
Built from https://develop.svn.wordpress.org/trunk@38959


git-svn-id: http://core.svn.wordpress.org/trunk@38902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:48:29 +00:00
John Blackbourn
bc5c87710e Administration: Standardise the docblocks for the handle_bulk_actions-* filters.
Props ericlewis, Veraxus
Fixes #16031

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


git-svn-id: http://core.svn.wordpress.org/trunk@38901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:45:29 +00:00
John Blackbourn
d2173fd5b0 Administration: Switch to handle_network_bulk_actions-{$screen} for the bulk listing screen actions in the network admin area.
Props ericlewis, Veraxus
See #16031

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


git-svn-id: http://core.svn.wordpress.org/trunk@38900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:37:29 +00:00
John Blackbourn
6161ad9020 Formatting: Don't overwrite the status header for Ajax responses that use output buffering or otherwise set their headers early.
Fixes #35666

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


git-svn-id: http://core.svn.wordpress.org/trunk@38899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:32:28 +00:00
Dominik Schilling
49c5fb895d I18N: Add $user_id argument to get_user_locale().
This allows to retrieve the locale of any user with the additional fallback to the site locale.

Fixes #38512.
See #29783, #26511.
Built from https://develop.svn.wordpress.org/trunk@38955


git-svn-id: http://core.svn.wordpress.org/trunk@38898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:15:32 +00:00
Rachel Baker
0c2a6184eb REST API: Add constructor to the WP_REST_Settings_Controller class.
Provides consistency with the other API endpoint controller classes.

Props Soean.
Fixes #38429.
Built from https://develop.svn.wordpress.org/trunk@38954


git-svn-id: http://core.svn.wordpress.org/trunk@38897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 13:45:47 +00:00
Sergey Biryukov
4bd54798ec I18N: Allow for WordPress Plugin Directory URL in plugin details modal to be localized.
Props Soean.
Fixes #38495. See #37501.
Built from https://develop.svn.wordpress.org/trunk@38953


git-svn-id: http://core.svn.wordpress.org/trunk@38896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 12:18:06 +00:00
Dominik Schilling
946da2d398 About Page: Use get_user_language() for the video subtitles.
Rename `$locale` to `$lang_code` to avoid stomping of the global `$locale`.

See #38485.
Built from https://develop.svn.wordpress.org/trunk@38952


git-svn-id: http://core.svn.wordpress.org/trunk@38895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 12:11:43 +00:00
Pascal Birchler
81a26f6900 Posts, Post Types: Add support for post type templates.
WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages.
While this feature is very helpful, it has always been limited to the 'page' post type and not was not available to other post types.

By opening up the page template functionality to all post types, we continue to improve the template hierarchy's flexibility.

In addition to the `Template Name` file header, the post types supported by a template can be specified using `Template Post Type: post, foo, bar`.
When at least one template exists for a post type, the 'Post Attributes' meta box will be displayed in the back end, without the need to add post type support for `'page-attributes'`. 'Post Attributes' can be customized per post type using the `'attributes'` label when registering a post type.

Props johnbillion, Mte90, dipesh.kakadiya, swissspidy.
Fixes #18375.
Built from https://develop.svn.wordpress.org/trunk@38951


git-svn-id: http://core.svn.wordpress.org/trunk@38894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 08:07:30 +00:00
Konstantin Kovshenin
a91706df62 Tests: Use correct arguments for wp_newComment XML-RPC method.
Fixes #38454
Props markoheijnen

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


git-svn-id: http://core.svn.wordpress.org/trunk@38893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:52:29 +00:00
Mike Schroder
a8e304ec8e Media: Add support for rendering PDF thumbnails.
When support for PDFs is available, on upload,
render 'Thumbnail', 'Medium', 'Large', and 'Full' sizes of
the first page, and save them in attachment meta.

Use these renders within Add Media, Media Gallery and List views,
Attachment Details, Post/Attachment Edit screens, and Attachment pages.

Support available by default via Imagick -> ImageMagick -> Ghostscript,
but can be provided by any `WP_Image_Editor` that supports PDFs.

Props adamsilverstein, azaozz, celloexpressions, desrosj, dglingren, ericlewis, ipstenu, joemcgill, joyously, markoheijnen, melchoyce, mikeschroder, tomauger.
Fixes #31050.
Built from https://develop.svn.wordpress.org/trunk@38949


git-svn-id: http://core.svn.wordpress.org/trunk@38892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:28:32 +00:00
Weston Ruter
a86496aea4 Customize: Improve custom background properties UI.
Introduces new control for managing the background position. Adds control for setting the `background-size`.

Props cdog, celloexpressions, grapplerulrich, MikeHansenMe, FolioVision, afercia, helen, melchoyce, karmatosed, westonruter, Kelderic, sebastian.pisula.
Fixes #22058.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:52:29 +00:00
Gary Pendergast
6b4357e14b REST API: Deprecate the rest_enabled filter.
As the REST API becomes more integral to WordPress Core, turning it off will cause a... suboptimal experience. If we don't want it to be turned off, the off switch needs to be removed.

Props jorbin, pento.
Fixes #38446.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:28:30 +00:00
Andrew Ozz
11e7d3d250 TinyMCE: revert removing the numbers (2-6) after the headings in the drop-down. Seems it causes more confusion.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38946


git-svn-id: http://core.svn.wordpress.org/trunk@38889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:16:30 +00:00
Gary Pendergast
a91a41c10c Tests: Fix some query typos introduced in [38940].
Props piewp for the catch.
See #35272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 05:49:44 +00:00
Gary Pendergast
9ff54f214f General: Add a sanitize_textarea_field() function.
Like its predecessor (`sanitize_text_field()`), `sanitize_textarea_field()` is a helper function to sanitise user input. As the name suggests, this function is for sanitising input from `textarea` fields - it strips tags and invalid UTF-8 characters, like `sanitize_text_field()`, but retains newlines and extra inline whitespace.

Props ottok, nbachiyski, chriscct7, pento.
Fixes #32257.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 05:17:35 +00:00
Jeremy Felt
555466ab82 Multisite: Replace get_blog_details() in inline documentation.
Some documentation is now out of date and some can be replaced with a mention of `get_site()`.

Fixes #37102.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 03:39:29 +00:00
Rachel Baker
b13da6ae73 REST API: Add missing sanitization callback for the hide_empty parameter of the Terms Controller.
Fixes a bug where the boolean parameter `hide_empty` was not being properly sanitized in the Terms controller.

Props websupporter.
Fixes #38465.
Built from https://develop.svn.wordpress.org/trunk@38942


git-svn-id: http://core.svn.wordpress.org/trunk@38885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 02:29:30 +00:00
Boone Gorges
50e4ab375d Tests: Share fixtures in term endpoint tests.
See #30017.
Built from https://develop.svn.wordpress.org/trunk@38941


git-svn-id: http://core.svn.wordpress.org/trunk@38884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:59:30 +00:00
Gary Pendergast
fe86e61f0b Menus: Add the menu-item-home class to the static front page item.
When a site is using a static front page, and that page is in a menu, it isn't given the CSS class `menu-item-home`, contrary to the developer documentation.

An incorrect solution was originally added in [35272], and is now gone. Let us never speak of it again.

Props mdgl, adamsilverstein, welcher, pento.
Fixes #35272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:58:30 +00:00
Andrew Ozz
ed2e427b9d TinyMCE: remove the numbers (2-6) after the headings in the drop-down. These are previews for the actual styling of headings in the editor.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38939


git-svn-id: http://core.svn.wordpress.org/trunk@38882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:42:48 +00:00
John Blackbourn
b4db9fbe3d Build/Test Tools: Continue eliminating randomness in tests.
See #37371

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


git-svn-id: http://core.svn.wordpress.org/trunk@38881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:24:43 +00:00
Andrew Ozz
5dda286548 TinyMCE: adjust the shortcuts position and font size in the Formats drop-down to better match the shortcuts in the buttons tooltips.
See #38063.
Built from https://develop.svn.wordpress.org/trunk@38937


git-svn-id: http://core.svn.wordpress.org/trunk@38880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 00:37:30 +00:00
Jeremy Felt
a545afb331 Multisite: Deprecate the blog_details filter.
`get_site()` has replaced `get_blog_details()` throughout core and is the recommended way to retrieve a current or single site object.

The `blog_details` filter is applied when full details are requested from `get_blog_details()`.

To ensure backwards compatibility in the switch to `get_site()`, this `blog_details` filter is now applied in `WP_Site::get_details()` and marked as deprecated with a note to rely instead on the `site_details` filter introduced in 4.6.

Props flixos90.
See #37102.
Fixes #38491.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 23:44:30 +00:00
Jeremy Felt
78fc0386af Multisite: Use get_site() in tests where get_blog_details() is not tested.
Remaining tests either rely on the `blog-details` cache key or test `get_blog_details()` itself.

Props flixos90.
Fixes #38497.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 23:04:30 +00:00
Jeremy Felt
a4e98f7cb9 Multisite: Replace get_blog_details() in wp_xmlrpc_server::_multisite_getUsersBlogs().
Use `get_site()` instead.

Props flixos90.
Fixes #38350.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:54:35 +00:00
Weston Ruter
02ce8db6de Customize: Add explanatory note for custom_css control via textarea[placeholder] and expose any defined input_attrs on such textarea controls.
Props melchoyce, westonruter, celloexpressions.
See #37439.
Fixes #38493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:52:10 +00:00
Andrew Ozz
e1ae827577 TinyMCE: remove and rearrange some of the editor buttons to improve user experience.
Props hugobaeta, melchoyce, celloexpressions, mor10, iseulde, mrwweb.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38932


git-svn-id: http://core.svn.wordpress.org/trunk@38875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:51:36 +00:00
Weston Ruter
8d1cb3068a Customize: Add hue-only mode to color picker.
The color control in the customizer can use the new mode by supplying the `mode` param with `hue` (as opposed to the new default `full` value). New control replaces the `range` control in Twenty Seventeen for `colorscheme_hue`. The `wpColorPicker` can opt for hue-only mode via supplying `hue` as the `type` option. Iris Color Picker is updated from v1.0.7 to v1.1.0-beta.

Props mattwiebe, celloexpressions.
Fixes #38263.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:33:30 +00:00
Dominik Schilling
e048613585 Tests: Update language files to include a Language header.
See #26511.
Built from https://develop.svn.wordpress.org/trunk@38930


git-svn-id: http://core.svn.wordpress.org/trunk@38873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:26:29 +00:00
John Blackbourn
1e6a12db38 Feeds: Don't attempt to generate RSS feeds for invalid feed URLs such as wp-content/feed.
Props stevenkword, JRGould, lyubomir_popov, johnbillion
Fixes #30210

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


git-svn-id: http://core.svn.wordpress.org/trunk@38872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:54:31 +00:00
Dominik Schilling
7cce73a634 General: Introduce a wp_list_sort() helper function, v2.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

This was previously committed in [38859] but got reverted in [38862] and [38863]. To fix the previous issues, `wp_list_sort()` supports now an additional argument to preserve array keys via `uasort()`.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38928


git-svn-id: http://core.svn.wordpress.org/trunk@38871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:26:32 +00:00
John Blackbourn
d151e08aa6 Feeds: Greatly reduce the number of dummy posts that are generated for the Atom tests, following on from [38924].
See #35160

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


git-svn-id: http://core.svn.wordpress.org/trunk@38870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:59:30 +00:00
Weston Ruter
54465a68db Customize: Fix logic inversion in determining whether a URL is previewable which prevented previewing anything but homepage.
Fixes regression introduced in [38890].

See #38409.
Fixes #38492.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:53:29 +00:00
Rachel Baker
2f263fce99 Feeds: Always return a valid timestamp for the Last-Modified header of comment or post feeds.
Fixes bug where an invalid Last-Modified value would be returned in feed requests for sites that had 0 items to return. Comment or post feeds will now return the current timestamp as the Last-Modified header value.  Example: a request for the comments feed for a site without any comments.

Replaced use of the local static variable `$cache_lastcommentmodified` to store the modified date in `get_lastcommentmodified()` with the Object Cache API.  The `get_lastcommentmodified()` function returns early if there is a cached value and returns `false` if there where no comments found. Introduced `_clear_modified_cache_on_transition_comment_status()` to flush the `lastcommentmodified` cache key when a comment enters or leaves approval status. In `get_lastpostmodified()` return early if there is a cached value and return `false` if there are no posts found.

Props swissspidy, rachelbaker, dllh, leobaiano.
Fixes #38027.
Built from https://develop.svn.wordpress.org/trunk@38925


git-svn-id: http://core.svn.wordpress.org/trunk@38868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:48:29 +00:00
John Blackbourn
92dfd29aee Feeds: Greatly reduce the number of dummy posts that are generated for the RSS2 tests. This speeds the tests up.
See #35160, #30210

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


git-svn-id: http://core.svn.wordpress.org/trunk@38867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:17:37 +00:00
Dominik Schilling
c40eadefb2 Embeds: Realign the provider list after [38693].
See #38003.
Built from https://develop.svn.wordpress.org/trunk@38923


git-svn-id: http://core.svn.wordpress.org/trunk@38866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:16:56 +00:00
Dominik Schilling
1159185401 Upgrade: Realign $_new_bundled_files after [38921].
Built from https://develop.svn.wordpress.org/trunk@38922


git-svn-id: http://core.svn.wordpress.org/trunk@38865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:04:31 +00:00
Dominik Schilling
6e08d8303d Upgrade: Add Twenty Seventeen to $_new_bundled_files.
This indicates that Twenty Seventeen should be installed with a WordPress upgrade.

See #38372.
Built from https://develop.svn.wordpress.org/trunk@38921


git-svn-id: http://core.svn.wordpress.org/trunk@38864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:03:03 +00:00
Dominik Schilling
3db5fa6c90 Nav Menus: Update help text to include the two latest default themes, Twenty Sixteen and Twenty Seventeen.
See #38372.
Built from https://develop.svn.wordpress.org/trunk@38920


git-svn-id: http://core.svn.wordpress.org/trunk@38863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:02:32 +00:00
Dominik Schilling
652742bf0a Install: Update sidebars_widgets option for Twenty Seventeen to match its three sidebars.
See #38372.
Built from https://develop.svn.wordpress.org/trunk@38919


git-svn-id: http://core.svn.wordpress.org/trunk@38862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:01:13 +00:00
David A. Kennedy
df7e53707e Twenty Seventeen: Refresh color patterns for changes in style.css
This brings the custom colors CSS in line with the stylesheet. Some selectors were missing since many changes occurred in `style.css` a few days before the original merge to Core.

Props celloexpressions, laurelfulford.

Fixes #38389.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:00:42 +00:00
Jeremy Felt
5981dd3107 REST API: Adjust test_get_items_invalid_status_param_is_discarded() after [38911].
Previously, if an invalid post status was assigned to a media object, the object would be returned with an unchanged status. After [38911], an error response is returned.

The assertion in test_get_items_invalid_status_param_is_discarded() needs to be updated to account for the expected error response. The test name has been changed to `test_get_items_invalid_status_param_is_error_response()`.

Fixes #38417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 19:34:30 +00:00
Jeremy Felt
8972cb70b6 Options: Make $passed_default available in remaining default_option_{$option} filter.
Pass `false` as the `$passed_default` value when the `default_option_{$option}` filter is applied in `update_option` as no default is ever passed.

This resolves an error in tests where the 3rd parameter is not available to `filter_default_option()`.

Fixes #38176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 19:23:32 +00:00
Jeremy Felt
680f14fcd1 Multisite: Replace get_blog_details() in wp-includes/ms-blogs.php with get_site().
Props flixos90.
See #37102.
Fixes #38351.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:50:30 +00:00
Jeremy Felt
84f25462e1 Multisite: Replace get_blog_details() in get_active_blog_for_user() with get_site().
Props flixos90.
Fixes #38355.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:06:29 +00:00
Jeremy Felt
4c0d82d653 Multisite: Introduce tests for get_active_blog_for_user().
Props flixos90.
See #38355.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:03:29 +00:00
Andrea Fercia
48b12e9dd6 Menus: Improve the HTML semantics of the "Menu Settings" section.
- removes the previous markup based on a definition list
- groups checkboxes in `fieldset` elements with a `legend`
- simplifies the CSS lowering selectors specificity

Props xavortm.

Fixes #38023.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:29:30 +00:00
Joe Hoyle
e8a311ed02 REST API: Validate posts status enum
Currently we are using a different validate callback, so the `enum` is not interpretted. We just have to fallback to the result of `rest_validate_request_arg` in our custom wrapper function.

Fixes #38417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:13:28 +00:00
Joe Hoyle
5f777155f2 Options: Add 'default' to register_setting
Add a `default` argument to `register_setting` that will be used an the default option value viet `get_option()` in the event of no other option being specified. This means (if chosen) developers can define their default once via `register_option` and not have to duplicate the value every time they make a call to `get_option()`.

Props rmccue, jorbin, jtsternberg.
Fixes #38176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:08:29 +00:00
Tammie Lister
67dbadd476 Twenty Seventeen: Display scroll down arrow when no menu
This improves scrollability without a menu.

Props nnaimov, melchoyce, davidakennedy
Fixes #38392


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


git-svn-id: http://core.svn.wordpress.org/trunk@38852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 16:51:35 +00:00
Gary Pendergast
a62d04afd6 Tests: Fix a PHP notice introduced in [38907].
`WP_DEFAULT_THEME` was being defined in the wrong location.

Also, if WordPress has the original "default" theme installed, ensure that our test theme overrides it.

Props swissspidy for daring to dive into Themes of WordPress Past.
See #31550, #38457.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 11:06:30 +00:00
Gary Pendergast
3ce2dd4131 Tests: Use a minimal theme for tests.
This functionality was originally added in [38858], using `symlink()` to put a link to the theme in WordPress' `themes` directory. Unfortunately, not all installs have write access to the `themes` directory, causing unit tests to fail.

The new method is to add the test theme directory to `$wp_theme_directories`, and fix the handful of tests that don't expect `$wp_theme_directories` to have multiple entries.

The test install/bootstrap routines now also check that `WP_DEFAULT_THEME` is defined, in case the tests are being run on a system that hasn't upgraded its' `wp-tests-config.php`.

See #31550.
Fixes #38457.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 10:25:53 +00:00
Weston Ruter
30a71555cb Customize: Allow page stubs to be created via dropdown-pages controls in the Static Front Page section.
This ability was previously added to nav menus via the available page items panel. The "Add New Page" button only appears when the `allow_addition` control param is supplied as `true`. Code is adapted from the Customize Posts feature plugin.

Props celloexpressions, westonruter.
See #38013, #34923.
Fixes #38164.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 06:31:31 +00:00
Jeremy Felt
6a0ca394e8 Multisite: Replace get_blog_details() with get_site() in is_user_member_of_blog().
Props flixos90.
Fixes #38358.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 06:02:35 +00:00
Jeremy Felt
6e1c166dfb Multisite: Replace get_blog_details() in ms_site_check() with get_site().
Props flixos90.
Fixes #38357.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:55:30 +00:00
Jeremy Felt
390dc4b345 Multisite: Replace get_blog_details() in add_user_to_blog() with get_site().
Adds tests for `add_user_to_blog()`.

Props flixos90.
Fixes #38356.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:49:29 +00:00
Jeremy Felt
749b480de0 Multisite: Replace get_blog_details() with get_site() in get_dashboard_blog().
Props dipesh.kakadiya.
Fixes #38353.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:05:33 +00:00
Weston Ruter
afe90360b5 Customize: Prevent absent site icon link from outputting an empty string as href in customizer; use /favicon.ico as fallback.
An empty string causes some browsers to use the current URL as the `href`. When using `history.replaceState()` Chrome will re-fetch the favicon with each call, meaning that `customize.php` gets hit with wasted requests which tax the server.

Fixes #38377.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 04:47:29 +00:00
Weston Ruter
a1777db166 Customize: Skip attaching expansion event handlers to section containers with the cannot-expand class.
Props kkoppenhaver, celloexpressions.
Fixes #37980.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 04:36:39 +00:00
Dion Hulse
0314e29667 Drop the requirement for the entry points to WordPress to be parsable by PHP4.
Previously we ensured that the entry points to WordPress were parsable by PHP4 in order to display a friendly not-supported-php error message.
However, for the last two years the main entry points have not actually parsed, and we've only added extra parse errors since it last worked in 3.9, so it's time we just remove this 'feature'.
The PHP version checks are still there for PHP 5.0/5.1, and so it's inplace when we eventually drop PHP 5.2 support.

See #29489.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 03:15:30 +00:00
Dion Hulse
2b788037c7 Upgrade: Don't fail a core update just because readme.html or license.txt couldn't be modified.
A number of locked down installs remove `readme.html` or make it inaccessible which would result in an update failure.

Props polevaultweb for the initial patch.
Fixes #31420.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 02:24:31 +00:00
Andrew Ozz
913926c1bd TinyMCE: make keyboard shortcuts more discoverable by adding them to the buttons tooltips and in the Formats drop-down.
Props mor10, azaozz.
Fixes #38063.
Built from https://develop.svn.wordpress.org/trunk@38897


git-svn-id: http://core.svn.wordpress.org/trunk@38840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 01:40:31 +00:00
Dion Hulse
7d24c2cb2a Revert the svn:ignore changes in [38394] which was missed in the original revert.
See #36335

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


git-svn-id: http://core.svn.wordpress.org/trunk@38839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 01:13:29 +00:00
Dion Hulse
7ac6b18d89 HTTP: Call mbstring_binary_safe_encoding() before making a request with Requests to avoid issues with mbstring.func_overload.
Props SergeyBiryukov.
Fixes #38226.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 00:45:29 +00:00
Dion Hulse
e8211f783a Docs: Correct a number of typos/spelling mistakes in inline comments.
Props ottok.
Fixes #38464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 00:38:35 +00:00
Tammie Lister
23a4550b0d Twenty Seventeen: Resolves the pin icon having variations
This fixes the pin icon having variations in position and size depending on screen and device. 

Props metodiew, mbelchev, davidakennedy
Fixes #38407


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


git-svn-id: http://core.svn.wordpress.org/trunk@38835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 22:31:12 +00:00
Andrew Ozz
1a7a00d14f TinyMCE: change the icon and tooltip for the remove link button in the inline link toolbar.
Props hardeepasrani, ocean90, magicroundabout, iseulde.
Fixes 37278.
Built from https://develop.svn.wordpress.org/trunk@38891


git-svn-id: http://core.svn.wordpress.org/trunk@38834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 21:59:22 +00:00
Weston Ruter
885d1dd89d Customize: Harden url matching to account for varying ports and ensuring matching base pathname for allowed urls
Fixes #38409.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 20:07:31 +00:00
Weston Ruter
1129311849 Customize: Fix live preview button in theme details modal so it includes target theme.
Fixes issue introduced in [38813].

Props celloexpressions.
See #37661.
Fixes #38475.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 19:15:29 +00:00
Tammie Lister
e2c22fa367 Twenty Seventeen: iPad mini, iPhone 5 search form rendering issues fix
On the these devices, there is an issue with the button rendering for the search form. This resolves that.

Props Caspie, alex27, davidakennedy
Fixes #38396


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


git-svn-id: http://core.svn.wordpress.org/trunk@38831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 19:11:35 +00:00
Weston Ruter
d93636bd11 Customize: Disable theme installation in multisite.
Props celloexpressions, iamfriendly.
Fixes #38370.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 18:17:39 +00:00
David A. Kennedy
5452a6a21d Twenty Seventeen: Fix smooth scrolling skip link
The link was scrolling too far. The main problem was that the `menuTop` variable lost it's initial definition of `0`, so all future subtractions were failing.

Props tywayne.

Fixes #38448.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 17:59:47 +00:00
Tammie Lister
bb91701a02 Twenty Seventeen: Fixes incorrect use of _x()
There is an incorrect use in twentyseventeen_posted_on(). This fixes that.

Props ocean90, dineshc, mbelchev, davidakennedy
Fixes #38383


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


git-svn-id: http://core.svn.wordpress.org/trunk@38828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 17:27:51 +00:00
John Blackbourn
2dfc3a7572 General: Correct the docs for the default HTTP status code used by wp_die().
See #37770

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


git-svn-id: http://core.svn.wordpress.org/trunk@38827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 13:13:58 +00:00
Gary Pendergast
b21d1cb6e6 General: Check to see that the PHP-XML module is enabled before using XML functions.
There are a handful of places where we don't check that the XML functions exist before we use them. Ubuntu's PHP 7 packages don't include PHP-XML by default, increasing the chance of this causing issues.

Props kraftbj, markoheijnen.
Fixes #37122.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 04:45:31 +00:00
Gary Pendergast
efaf9bae66 Menus: Add the menu-item-home class to the static front page.
When a site is using a static front page, and that page is in a menu, it isn't given the CSS class `menu-item-home`, contrary to the developer documentation.

Props christophherr.
Fixes #35272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 00:32:32 +00:00
Andrea Fercia
46bae0275c Customize: Keep previously uploaded header images in place.
On the Header Image section, the previously uploaded images disappeared off-screen
when using the keyboard to navigate and the remove "X" button got keyboard focus.
Changing the off-screen CSS technique used for the "X" buttons fixes it.

- improves the focus style on the previously uploaded and suggested images
- removes a `tabindex="0"` attribute from the current header image

Fixes #38156.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 19:57:32 +00:00
Andrea Fercia
5c555e5d10 Accessibility: Improve the Tags meta box accessibility.
- changes the "X" links in buttons, improves their color contrast ratio and focus style
- adds screen reader text "Remove item: + tagname"
- uses `wp.a11y.speak()` to give screen reader users feedback when adding/removing tags
- makes the `tagcloud-link` toggle a button, with an `aria-expanded` attribute to indicate the tag cloud collapsed/expanded state
- changes colors for the autocomplete highlighted option in order to have a better color contrast ratio
- reduces the font size for the autocomplete on Press This
- removes CSS related to the old `suggest.js` from Press This

Props joedolson, cgrymala, azaozz, afercia.
Fixes #27555.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 18:16:42 +00:00
John Blackbourn
4e65c0cfb4 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458
See #38456

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


git-svn-id: http://core.svn.wordpress.org/trunk@38822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 15:56:30 +00:00
John Blackbourn
f96940f574 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458

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


git-svn-id: http://core.svn.wordpress.org/trunk@38821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 15:52:40 +00:00
Aaron Campbell
3a761adbd7 Shortcodes: Add new strip_shortcodes_tagnames filter.
With the new `strip_shortcodes_tagnames` filter you can specify which shortcodes are stripped by `strip_shortcodes()`. The default is all registered shortcodes.

Props DylanAuty, orvils, swissspidy.
Fixes #37767.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 14:25:31 +00:00
Dominik Schilling
8b3c9607e5 Users: Use self_admin_url() for the email change confirmation link.
Prevents sending users to wp-admin/profile.php if they only have access to wp-admin/user/profile.php.

Props dave.pullig.
Fixes #38451.
Built from https://develop.svn.wordpress.org/trunk@38876


git-svn-id: http://core.svn.wordpress.org/trunk@38819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 14:02:31 +00:00
Tammie Lister
dc35c19f60 Twenty Seventeen: Renaming of directory structure
This changes components directory to be called template-parts. Changes reflected in all files that call those sections.

Props bronsonquick, dd32

Fixes #38375

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


git-svn-id: http://core.svn.wordpress.org/trunk@38818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:29:30 +00:00
Tammie Lister
05e4d10851 Revert [38873]: Commit does not keep file history due to deleted directory
The last commit to change directory structure for Twenty Seventee, didn't keep the file history so reverting in favour of doing that.

Props Ocean90

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


git-svn-id: http://core.svn.wordpress.org/trunk@38817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:23:41 +00:00
Tammie Lister
552b119431 Twenty Seventeen: Renaming of directory structure
This changes components directory to be called template-parts. Changes reflected in all files that call those sections.

Props bronsonquick, dd32

Fixes #38375

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


git-svn-id: http://core.svn.wordpress.org/trunk@38816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:07:32 +00:00
Tammie Lister
85d3ca7940 Twenty Seventeen: Remove whitelisting comments for PHP_Codesniffer
Some comments to whitelist PHP_CodeSniffer errors were left in the theme as on GitHub it intergrated with Travis testing. Those are now removed in this patch.

props davidakennedy

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


git-svn-id: http://core.svn.wordpress.org/trunk@38815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 11:06:31 +00:00
Pascal Birchler
5eb3ed3499 Date/Time: Fix unit tests after [38804].
The tests for `date_i18n()` need to use a delta for comparing timestamps.

Fixes #38381. See #37910.
Built from https://develop.svn.wordpress.org/trunk@38871


git-svn-id: http://core.svn.wordpress.org/trunk@38814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 07:19:40 +00:00
Peter Wilson
8db6c6c4ef Bundled theme: Add preconnect to fonts.gstatic.com in 2012-15 themes.
Add preconnect hinting for `https://fonts.gstatic.com` in the bundled themes using Google fonts. WordPress versions 4.7+ include a crossorigin attribute, earlier versions will not.

Props leobaiano, swissspidy, peterwilsoncc.
Fixes #37171.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 01:56:32 +00:00
Peter Wilson
e73ba84b04 Emoji: Load polyfill responsibly.
Improve performance of Emoji tests and loading of the polyfill.

Reduces the number of tests to determine browser support for emoji to those most likely to fail. Adds the defer flag to the loaded scripts for browsers lacking support.

Props superpoincare for perf testing, peterwilsoncc.
Fixes #37817.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 00:00:34 +00:00
David A. Kennedy
e58856bbd0 Twenty Seventeen: Display featured image on static front page
This improves UX, since an image added will be displayed on front end as opposed to not at all. This fix added the front page's featured image above the front page content, similar to how it's handled in the other panels. Also it removed code that was setting the front page's featured image as a fallback to the custom header, and updated the conditions that add the `has-header-image` to remove reference to the front page's featured image.

Props laurelfulford.

Fixes #38402.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 22:15:50 +00:00
David A. Kennedy
0794b2489b Twenty Seventeen: Add theme support for customize selective refresh widgets
Props celloexpressions.

Fixes #38400.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 21:48:48 +00:00
David A. Kennedy
222240c4da Twenty Seventeen: Fix spacing issue on pages with comments
This effected the two column layout on pages. The entry content and comment areas needed to be floated and cleared properly.

Props laurelfulford.

Fixes #38388.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 20:51:53 +00:00
David A. Kennedy
36f6079b15 Twenty Seventeen: Add post author comment styles
Currently, it's hard to output an SVG in the comment function without a lot of extra effort. So this adds a simple border to the author avatar and removes previous code related to SVGs and/or Genericons.

Props laurelfulford.

Fixes #38403.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 20:37:34 +00:00
Rachel Baker
cdce9d5dac REST API: Allow comments to be created setting the user_agent parameter.
As of WordPress 4.3 the `wp_new_comment()` function has been updated to allow the comment_agent value to be set when a comment is created. The comments API endpoint now allows the comment author's user agent to be set when creating a comment.
Also, the `readonly` property on the `author_user_agent` parameter in the schema was removed.

Props rabmalin for the initial patch.
Fixes #38425.
Built from https://develop.svn.wordpress.org/trunk@38864


git-svn-id: http://core.svn.wordpress.org/trunk@38807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 18:28:32 +00:00
Dominik Schilling
6c8508023f Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.
Built from https://develop.svn.wordpress.org/trunk@38863


git-svn-id: http://core.svn.wordpress.org/trunk@38806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 17:01:32 +00:00
Weston Ruter
2e173f9e44 Customize: Revert part of [38859] which caused sections to get deactivated in the customizer.
See #37128.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 16:17:41 +00:00
John Blackbourn
e099b4d947 Role/Capability: Add tests for the exist user capability.
See #38236

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


git-svn-id: http://core.svn.wordpress.org/trunk@38804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 14:12:32 +00:00
John Blackbourn
16ccab2ef9 Role/Capability: Improve the test which asserts that a user can edit their own profile.
All users can edit their own profile, as this ability is not linked to an explicit capability. Technically, it should map to the `exist` capability, which will be addressed at a later date.

See #31518 

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


git-svn-id: http://core.svn.wordpress.org/trunk@38803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 13:47:33 +00:00
Pascal Birchler
f54558e75b General: Introduce a wp_list_sort() helper function.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38859


git-svn-id: http://core.svn.wordpress.org/trunk@38802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:12:51 +00:00
Gary Pendergast
7d9563801a Tests: Use a minimal theme for tests.
New default themes require workarounds being added to several unit tests, as they often alter default WordPress behaviour. To avoid ongoing maintenance issues, this change switches to a minimal theme when running tests.

This change also removes the old workarounds for default themes.

Fixes #31550.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:03:39 +00:00
Sergey Biryukov
aa3b4f911d Remove an obsolete 1 == $total check in paginate_links().
`$total` cannot be a negative number since [4276].

Props jdgrimes.
Fixes #38421.
Built from https://develop.svn.wordpress.org/trunk@38857


git-svn-id: http://core.svn.wordpress.org/trunk@38800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:46:29 +00:00
Pascal Birchler
badf0925a8 I18N: Improve "Site Language" label for per-user language selection.
Renames the label to "Language" and adds an explanation of the feature to the help tab.

Props johnbillion, jorbin.
Fixes #38344.
Built from https://develop.svn.wordpress.org/trunk@38856


git-svn-id: http://core.svn.wordpress.org/trunk@38799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:41:51 +00:00
Pascal Birchler
f88c248a52 Themes: After [38788], further improve the update button when there's no update package.
Prevents running shiny install when no package exists.


Fixes #37774.
Built from https://develop.svn.wordpress.org/trunk@38855


git-svn-id: http://core.svn.wordpress.org/trunk@38798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:36:46 +00:00
Pascal Birchler
11a13f147b List Tables: Do not show filter button when there are no filter options available.
Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.
Built from https://develop.svn.wordpress.org/trunk@38854


git-svn-id: http://core.svn.wordpress.org/trunk@38797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:33:54 +00:00
Weston Ruter
4ba392975a Customize: Add sticky headers for panels and sections.
Includes autoprefixing of CSS.

Props delawski, celloexpressions.
See #35186.
Fixes #34343.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 06:37:30 +00:00
Gary Pendergast
16f0c6877e Pings: Allow ping functions to accept WP_Post objects as well as post IDs.
This removes the use of several `global $wpdb` instances, as well as bringing the ping functions into line with other post-related functions, which will accept a post ID or `WP_Post` object.

Props dshanke.
Fixes #38202.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 06:00:31 +00:00
Gary Pendergast
2e04d2a192 Tests: Prevent Twenty Seventeen from interfering with Customizer ajax tests.
Missed in [38850].

See #38372.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 05:51:30 +00:00
Gary Pendergast
802736514b Tests: Prevent Twenty Seventeen from interfering with Customizer tests.
This was previously fixed in [38837], but it wasn't really the correct answer, to fix it in the theme. So, [38837] is reverted in this commit, and the Twenty Seventeen actions causing problems are unhooked before tests are run.

See #38372.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 05:28:31 +00:00
Aaron Jorbin
82911b1756 Cache API: introduce wp_cache_get_last_changed to improve DRY
One thing fairly common to the cache groups is a block of code to look to see when the cache was last changed, and if there isn't one, to set it for the current microtime(). It appears in 8 different places in core. This adds a new helper `wp_cache_get_last_changed` to DRY things up a bit.

Since `wp-includes/cache.php` isn't guaranteed to be loaded, this new function is in `wp-includes/functions.php`

Props spacedmonkey, desrosj.
Fixes #37464.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 02:54:34 +00:00
Aaron Jorbin
56dfed874f Build/Test Tools: Allow Minimal Builds
Builds can hang or get very slow on copy when you have alot of files. Alot of files can suddenly appear when you are developing new themes or plugins. Often, it's nice to have a minimal build, especially if you are preparing a commit.

This adds a new flag `--minimal-copy` that can be added to any task which does a copy. These tasks include build, test, and copy. This flag will cause no plugins to be copied and only the twenty series of default themes to be copied. Everything else remains the same.

Fixes #38423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 22:24:40 +00:00
David A. Kennedy
8cfe2973d3 Twenty Seventeen: Replace inline control structure to improve code readability
Props vrundakansara, aaroncampbell.

Fixes #38384.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 22:18:29 +00:00
David A. Kennedy
89b20fcf8f Twenty Fifteen, Twenty Seventeen: Add documentation to filters in themes.
Documents a missing one Twenty Fifteen and all four missing ones in Twenty Seventeen.

Props brainstormforce.

Fixes #38382.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 20:34:31 +00:00