Commit Graph

11564 Commits

Author SHA1 Message Date
Rachel Baker
6e47838053 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38968 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 21:36:29 +00:00
Weston Ruter
fda4409f40 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38967 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 20:02:51 +00:00
David A. Kennedy
67420e4986 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38966 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 18:42:44 +00:00
Andrea Fercia
29e75c5d77 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38965 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 17:58:34 +00:00
David A. Kennedy
16768b39cf 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38964 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 17:38:59 +00:00
David A. Kennedy
cd910cffdc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38963 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 17:24:06 +00:00
David A. Kennedy
64117bbc6e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38962 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 16:42:10 +00:00
Dominik Schilling (ocean90)
9e3f6d338b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38961 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 15:35:58 +00:00
Boone Gorges
a6a15b1819 REST API: Use term-specific caps for permission checks in term update and delete endpoints.
See #38505.

git-svn-id: https://develop.svn.wordpress.org/trunk@38960 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:51:54 +00:00
Sergey Biryukov
509a314de8 Comments: In comment_form(), bail early if comments for the post are closed.
Props jipmoors.
Fixes #38514.

git-svn-id: https://develop.svn.wordpress.org/trunk@38959 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:47:09 +00:00
John Blackbourn
573912fcfd Administration: Standardise the docblocks for the handle_bulk_actions-* filters.
Props ericlewis, Veraxus
Fixes #16031


git-svn-id: https://develop.svn.wordpress.org/trunk@38958 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:44:57 +00:00
John Blackbourn
df8b6cf282 Administration: Switch to handle_network_bulk_actions-{$screen} for the bulk listing screen actions in the network admin area.
Props ericlewis, Veraxus
See #16031


git-svn-id: https://develop.svn.wordpress.org/trunk@38957 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:36:06 +00:00
John Blackbourn
0dff84ad23 Formatting: Don't overwrite the status header for Ajax responses that use output buffering or otherwise set their headers early.
Fixes #35666


git-svn-id: https://develop.svn.wordpress.org/trunk@38956 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:31:33 +00:00
Dominik Schilling (ocean90)
368d6ba190 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38955 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 14:14:44 +00:00
Rachel Baker
3e3ac4d727 REST API: Add constructor to the WP_REST_Settings_Controller class.
Provides consistency with the other API endpoint controller classes.

Props Soean.
Fixes #38429.

git-svn-id: https://develop.svn.wordpress.org/trunk@38954 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 13:44:37 +00:00
Sergey Biryukov
4f033e5487 I18N: Allow for WordPress Plugin Directory URL in plugin details modal to be localized.
Props Soean.
Fixes #38495. See #37501.

git-svn-id: https://develop.svn.wordpress.org/trunk@38953 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 12:16:14 +00:00
Dominik Schilling (ocean90)
36e260f1b5 About Page: Use get_user_language() for the video subtitles.
Rename `$locale` to `$lang_code` to avoid stomping of the global `$locale`.

See #38485.

git-svn-id: https://develop.svn.wordpress.org/trunk@38952 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 12:10:35 +00:00
Pascal Birchler
a9516abb54 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38951 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 08:06:43 +00:00
Mike Schroder
35e6dbe14f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38949 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 07:27:51 +00:00
Weston Ruter
16bfeb6608 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38948 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 06:51:11 +00:00
Gary Pendergast
84d9dcb1e6 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38947 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 06:27:04 +00:00
Andrew Ozz
9b8697aea3 TinyMCE: revert removing the numbers (2-6) after the headings in the drop-down. Seems it causes more confusion.
See #27159.

git-svn-id: https://develop.svn.wordpress.org/trunk@38946 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 06:15:54 +00:00
Gary Pendergast
85eb52669d 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38944 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 05:16:09 +00:00
Jeremy Felt
e06b7111e5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38943 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 03:38:48 +00:00
Rachel Baker
2b12294a0a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38942 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 02:28:13 +00:00
Gary Pendergast
bfce3fda86 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38940 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 01:57:57 +00:00
Andrew Ozz
3af74dfcbb 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38939 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 01:41:46 +00:00
Andrew Ozz
1f49a4c0cf TinyMCE: adjust the shortcuts position and font size in the Formats drop-down to better match the shortcuts in the buttons tooltips.
See #38063.

git-svn-id: https://develop.svn.wordpress.org/trunk@38937 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 00:36:05 +00:00
Jeremy Felt
1515813dd4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38936 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 23:43:01 +00:00
Jeremy Felt
6f1ed31931 Multisite: Replace get_blog_details() in wp_xmlrpc_server::_multisite_getUsersBlogs().
Use `get_site()` instead.

Props flixos90.
Fixes #38350.


git-svn-id: https://develop.svn.wordpress.org/trunk@38934 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 22:53:44 +00:00
Weston Ruter
c6d8d79f15 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38933 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 22:50:39 +00:00
Andrew Ozz
7f8003e6ea TinyMCE: remove and rearrange some of the editor buttons to improve user experience.
Props hugobaeta, melchoyce, celloexpressions, mor10, iseulde, mrwweb.
See #27159.

git-svn-id: https://develop.svn.wordpress.org/trunk@38932 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 22:50:21 +00:00
Weston Ruter
5de6c7927d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38931 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 22:32:55 +00:00
John Blackbourn
895203b3e4 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38929 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 21:53:22 +00:00
Dominik Schilling (ocean90)
ad25902a65 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38928 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 21:25:25 +00:00
Weston Ruter
87e7c0cd96 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38926 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:52:58 +00:00
Rachel Baker
ea3b41d8e3 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38925 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:47:06 +00:00
Dominik Schilling (ocean90)
ade972bf86 Embeds: Realign the provider list after [38693].
See #38003.

git-svn-id: https://develop.svn.wordpress.org/trunk@38923 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:15:45 +00:00
Dominik Schilling (ocean90)
fe100549a7 Upgrade: Realign $_new_bundled_files after [38921].
git-svn-id: https://develop.svn.wordpress.org/trunk@38922 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:02:39 +00:00
Dominik Schilling (ocean90)
95fb8d8221 Upgrade: Add Twenty Seventeen to $_new_bundled_files.
This indicates that Twenty Seventeen should be installed with a WordPress upgrade.

See #38372.

git-svn-id: https://develop.svn.wordpress.org/trunk@38921 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:01:22 +00:00
Dominik Schilling (ocean90)
425589e77f Nav Menus: Update help text to include the two latest default themes, Twenty Sixteen and Twenty Seventeen.
See #38372.

git-svn-id: https://develop.svn.wordpress.org/trunk@38920 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:00:19 +00:00
Dominik Schilling (ocean90)
1f1a105820 Install: Update sidebars_widgets option for Twenty Seventeen to match its three sidebars.
See #38372.

git-svn-id: https://develop.svn.wordpress.org/trunk@38919 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 19:59:31 +00:00
David A. Kennedy
988e2d03b4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38918 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 19:59:11 +00:00
Jeremy Felt
1c034393f0 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38916 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 19:22:32 +00:00
Jeremy Felt
9543b9e259 Multisite: Replace get_blog_details() in wp-includes/ms-blogs.php with get_site().
Props flixos90.
See #37102.
Fixes #38351.


git-svn-id: https://develop.svn.wordpress.org/trunk@38915 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 18:49:03 +00:00
Jeremy Felt
148d7790d7 Multisite: Replace get_blog_details() in get_active_blog_for_user() with get_site().
Props flixos90.
Fixes #38355.


git-svn-id: https://develop.svn.wordpress.org/trunk@38914 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 18:05:20 +00:00
Andrea Fercia
590a7de43b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38912 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 17:28:40 +00:00
Joe Hoyle
6d8e277152 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38911 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 17:12:18 +00:00
Joe Hoyle
57aec4798f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38910 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 17:07:20 +00:00
Tammie Lister
c388ff84ee Twenty Seventeen: Display scroll down arrow when no menu
This improves scrollability without a menu.

Props nnaimov, melchoyce, davidakennedy
Fixes #38392



git-svn-id: https://develop.svn.wordpress.org/trunk@38909 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 16:50:49 +00:00
Weston Ruter
4e8410a886 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38906 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 06:30:27 +00:00
jeremyfelt
32fce2093c Multisite: Replace get_blog_details() with get_site() in is_user_member_of_blog().
Props flixos90.
Fixes #38358.


git-svn-id: https://develop.svn.wordpress.org/trunk@38905 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 06:01:03 +00:00
Jeremy Felt
0b0a009bfc Multisite: Replace get_blog_details() in ms_site_check() with get_site().
Props flixos90.
Fixes #38357.


git-svn-id: https://develop.svn.wordpress.org/trunk@38904 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 05:54:19 +00:00
Jeremy Felt
701dbe4271 Multisite: Replace get_blog_details() in add_user_to_blog() with get_site().
Adds tests for `add_user_to_blog()`.

Props flixos90.
Fixes #38356.


git-svn-id: https://develop.svn.wordpress.org/trunk@38903 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 05:48:22 +00:00
Jeremy Felt
9ae33a3be4 Multisite: Replace get_blog_details() with get_site() in get_dashboard_blog().
Props dipesh.kakadiya.
Fixes #38353.


git-svn-id: https://develop.svn.wordpress.org/trunk@38902 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 05:04:37 +00:00
Weston Ruter
e6425b0735 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38901 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 04:46:36 +00:00
Weston Ruter
31156b0bfb Customize: Skip attaching expansion event handlers to section containers with the cannot-expand class.
Props kkoppenhaver, celloexpressions.
Fixes #37980.


git-svn-id: https://develop.svn.wordpress.org/trunk@38900 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 04:36:00 +00:00
Dion Hulse
7e9848df2b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38899 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 03:14:31 +00:00
Dion Hulse
7aa09b6d24 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38898 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 02:23:18 +00:00
Andrew Ozz
277bb681d7 TinyMCE: make keyboard shortcuts more discoverable by adding them to the buttons tooltips and in the Formats drop-down.
Props mor10, azaozz.
Fixes #38063.

git-svn-id: https://develop.svn.wordpress.org/trunk@38897 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 01:39:15 +00:00
Dion Hulse
3df3b11e98 HTTP: Call mbstring_binary_safe_encoding() before making a request with Requests to avoid issues with mbstring.func_overload.
Props SergeyBiryukov.
Fixes #38226.


git-svn-id: https://develop.svn.wordpress.org/trunk@38894 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 00:44:13 +00:00
Dion Hulse
cedd323452 Docs: Correct a number of typos/spelling mistakes in inline comments.
Props ottok.
Fixes #38464.


git-svn-id: https://develop.svn.wordpress.org/trunk@38893 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 00:37:50 +00:00
Tammie Lister
edf8779f71 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



git-svn-id: https://develop.svn.wordpress.org/trunk@38892 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 22:29:42 +00:00
Andrew Ozz
c108fdc0ba TinyMCE: change the icon and tooltip for the remove link button in the inline link toolbar.
Props hardeepasrani, ocean90, magicroundabout, iseulde.
Fixes 37278.

git-svn-id: https://develop.svn.wordpress.org/trunk@38891 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 21:57:22 +00:00
Weston Ruter
a89aef0f6e Customize: Harden url matching to account for varying ports and ensuring matching base pathname for allowed urls
Fixes #38409.


git-svn-id: https://develop.svn.wordpress.org/trunk@38890 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 20:06:06 +00:00
Weston Ruter
b5bc4fde53 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38889 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 19:14:26 +00:00
Tammie Lister
71cbe11ee3 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



git-svn-id: https://develop.svn.wordpress.org/trunk@38888 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 19:10:59 +00:00
Weston Ruter
81c6e564fc Customize: Disable theme installation in multisite.
Props celloexpressions, iamfriendly.
Fixes #38370.


git-svn-id: https://develop.svn.wordpress.org/trunk@38887 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 18:16:41 +00:00
David A. Kennedy
ad319b1b1f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38886 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 17:58:18 +00:00
Tammie Lister
58075601c6 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



git-svn-id: https://develop.svn.wordpress.org/trunk@38885 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 17:26:45 +00:00
John Blackbourn
f948218d0f General: Correct the docs for the default HTTP status code used by wp_die().
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38884 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 13:12:52 +00:00
pento
2e9b3c22d8 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38883 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 04:44:07 +00:00
Gary Pendergast
1377523033 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38882 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-24 00:31:21 +00:00
Andrea Fercia
1574d89dfb 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38881 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 19:56:43 +00:00
Andrea Fercia
e232ed28dc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38880 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 18:15:07 +00:00
John Blackbourn
dcd129e5b8 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458
See #38456


git-svn-id: https://develop.svn.wordpress.org/trunk@38879 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 15:55:53 +00:00
John Blackbourn
e02a26d1a5 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458


git-svn-id: https://develop.svn.wordpress.org/trunk@38878 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 15:51:07 +00:00
Aaron D. Campbell
73a1aed2cd 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38877 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 14:24:26 +00:00
Dominik Schilling (ocean90)
3a97668d06 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38876 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 14:01:53 +00:00
Tammie Lister
633c58b4e4 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38875 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 12:28:27 +00:00
Tammie Lister
429527b0f3 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38874 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 12:22:25 +00:00
Tammie Lister
a5d69e176a 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38873 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 12:06:10 +00:00
Tammie Lister
9e253ab075 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


git-svn-id: https://develop.svn.wordpress.org/trunk@38872 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 11:05:14 +00:00
Peter Wilson
3f14125b2b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38870 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-23 01:55:49 +00:00
Peter Wilson
d792f370ef 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38869 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-22 23:59:56 +00:00
David A. Kennedy
67d767514e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38868 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 22:14:26 +00:00
David A. Kennedy
4b9833b656 Twenty Seventeen: Add theme support for customize selective refresh widgets
Props celloexpressions.

Fixes #38400.


git-svn-id: https://develop.svn.wordpress.org/trunk@38867 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 21:47:15 +00:00
David A. Kennedy
3e8333b0de 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38866 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 20:50:36 +00:00
David A. Kennedy
90eddc0630 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38865 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 20:36:24 +00:00
Rachel Baker
39226db649 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38864 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 18:27:18 +00:00
Dominik Schilling (ocean90)
ef43d7b0fa Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.

git-svn-id: https://develop.svn.wordpress.org/trunk@38863 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 17:00:29 +00:00
Weston Ruter
2d7c2823b6 Customize: Revert part of [38859] which caused sections to get deactivated in the customizer.
See #37128.


git-svn-id: https://develop.svn.wordpress.org/trunk@38862 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 16:16:17 +00:00
Pascal Birchler
e4cbb7d031 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38859 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 11:11:42 +00:00
Sergey Biryukov
e7d639345f Remove an obsolete 1 == $total check in paginate_links().
`$total` cannot be a negative number since [4276].

Props jdgrimes.
Fixes #38421.

git-svn-id: https://develop.svn.wordpress.org/trunk@38857 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 10:45:21 +00:00
Pascal Birchler
5224e2bd84 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38856 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 10:40:02 +00:00
Pascal Birchler
bb4da6448f Themes: After [38788], further improve the update button when there's no update package.
Prevents running shiny install when no package exists.


Fixes #37774.

git-svn-id: https://develop.svn.wordpress.org/trunk@38855 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 10:35:51 +00:00
Pascal Birchler
f508d80a1b List Tables: Do not show filter button when there are no filter options available.
Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.

git-svn-id: https://develop.svn.wordpress.org/trunk@38854 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 10:32:55 +00:00
Weston Ruter
5fb3d3f279 Customize: Add sticky headers for panels and sections.
Includes autoprefixing of CSS.

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


git-svn-id: https://develop.svn.wordpress.org/trunk@38853 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 06:36:57 +00:00
Gary Pendergast
2d6badf6ab 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38852 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 05:59:34 +00:00
Gary Pendergast
90f8c9314a 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38850 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-21 05:27:56 +00:00