Commit Graph

35798 Commits

Author SHA1 Message Date
John Blackbourn
765d5feb08 Customize: Avoid using assertNotFalse() in tests because it's not available in PHPUnit 3.6.
See #35395


git-svn-id: https://develop.svn.wordpress.org/trunk@39020 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 15:41:49 +00:00
Andrea Fercia
6f3e4849fd Accessibility: Remove target=_blank from the help tab links in network.php.
Stop taking control of users' browsers.

Props wolly.
Fixes #38572. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@39019 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 15:18:35 +00:00
Weston Ruter
7382bdd6b3 Customize: Prevent toggling edit shortcuts when doing shift-click or when clicking on a descendent of an interactive element.
See #38532, #27403.
Fixes #38554.


git-svn-id: https://develop.svn.wordpress.org/trunk@39018 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 14:58:47 +00:00
John Blackbourn
509df810bf Customize: Correct the CRUD tests for custom CSS on multisite.
See #35395


git-svn-id: https://develop.svn.wordpress.org/trunk@39017 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 14:03:05 +00:00
John Blackbourn
4e262ff6ee Customize: Correct the capability mapping and associated tests for the unfiltered_css capability.
Fixes #35395


git-svn-id: https://develop.svn.wordpress.org/trunk@39016 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 12:46:46 +00:00
Drew Jaynes
db6994c8c6 Docs: Add much more complete and syntactically correct documentation throughout the WP_REST_Comments_Controller class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39015 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 06:54:49 +00:00
Drew Jaynes
6b4e878a0d Docs: Add much more complete and syntactically correct documentation throughout the WP_REST_Comment_Meta_Fields class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39014 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 06:33:34 +00:00
Drew Jaynes
fff3c88cb1 Tests: Helps to also update the hour and not just the timezone to temporarily fix a test broken due to Daylight Saving Time changes in Europe.
git-svn-id: https://develop.svn.wordpress.org/trunk@39013 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 05:53:58 +00:00
Drew Jaynes
64aac0df10 Tests: Temporarily fix a test failing due to European Daylight Saving Time changes.
git-svn-id: https://develop.svn.wordpress.org/trunk@39012 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 05:43:44 +00:00
Drew Jaynes
19ef3b99e7 Docs: Add much more complete and syntactically correct documentation throughout the WP_REST_Attachments_Controller class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39011 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 05:39:09 +00:00
Weston Ruter
4b478549d2 Customize: Reveal controls pane when clicking on edit shortcuts in mobile preview.
Re-use `paneVisible` state to also manage whether the mobile `preview-only` class is applied to the overlay.

Props seancjones.
See #36678, #36678, #27403.
Fixes #38080.


git-svn-id: https://develop.svn.wordpress.org/trunk@39010 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 04:22:18 +00:00
Weston Ruter
a8b4e3c54b Customize: Fix message grammar for custom_css validity error when imbalanced characters possibly due to content CSS property.
Props Presskopp.
See #35395.
Fixes #38564.


git-svn-id: https://develop.svn.wordpress.org/trunk@39009 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 04:03:39 +00:00
johnbillion
5de9799317 Role/Capability: Reuse a fixture in a couple more unit tests.
See #30017


git-svn-id: https://develop.svn.wordpress.org/trunk@39008 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 00:32:03 +00:00
Dominik Schilling (ocean90)
249bde034d XML-RPC: Fix truncated warning message added in [38883].
See #37122.

git-svn-id: https://develop.svn.wordpress.org/trunk@39007 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 21:31:29 +00:00
Andrea Fercia
ea885d3a26 Accessibility: Improve the form labels on the Add New User screen.
On the Multisite - single site "Add New User" screen, some form fields have more
than one label associated with them. Form controls should have at most one
associated label element. If more than one label element is associated to the
control, assistive technologies may not read the appropriate label.

Additionally, labels can be associated to their related form fields either
explicitly (using a `for` attribute referencing the field ID) or implicitly
(using the label to wrap the field). As a best practice, never do both and
prefer explicitly associated labels when possible.

Props Ankit K Gupta.
Fixes #38459.


git-svn-id: https://develop.svn.wordpress.org/trunk@39006 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 12:53:44 +00:00
Dominik Schilling (ocean90)
404c584956 I18N: Don't initialize WP_Locale_Switcher in wp_load_translations_early().
`wp_load_translations_early()` is used when WordPress isn't fully initialized. Therefore using the `WP_Locale_Switcher` with `get_locale()`/`get_user_locale()` can cause PHP fatal errors.
This reverts [38976] and [38977], and instead removes `WP_Locale_Switcher` from `wp_load_translations_early()`.

See #29783.
Fixes #38535.

git-svn-id: https://develop.svn.wordpress.org/trunk@39005 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 11:22:50 +00:00
Tammie Lister
eb68984b1b Twenty Seventeen: Fixes unexpected behaviour of scroll down arrow
This ensures the arrorw disappears once the top menu sticks.

Props LittleBigThing, davidakennedy
Fixes #38555



git-svn-id: https://develop.svn.wordpress.org/trunk@39004 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 09:44:10 +00:00
Weston Ruter
6e59435291 Customize: Move Additional CSS section toward end of list by assigning priority higher than default.
Props Mista-Flo.
Fixes #38524.


git-svn-id: https://develop.svn.wordpress.org/trunk@39003 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 05:10:36 +00:00
Weston Ruter
2982ca5872 Customize: Mark newly-added page/post stubs as added (with checkmark) when they are inserted into the list of available items.
Props ryankienstra, celloexpressions.
See #34923.
Fixes #38499.


git-svn-id: https://develop.svn.wordpress.org/trunk@39002 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-29 05:05:33 +00:00
David A. Kennedy
0599b2d13c Twenty Seventeen: Adds missing theme text domains to starter content
* Also, changes the top menu label so it has better context when read alone by assistive technology.

Props anilbasnet.

Fixes #38542.


git-svn-id: https://develop.svn.wordpress.org/trunk@39001 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 23:43:54 +00:00
David A. Kennedy
0890bf838e Twenty Seventeen: Don't modify excerpt link in admin
* Since this is a filter the original value is returned if `is_admin()` is true.
* Removes portion of the doc block since function is not pluggable.

Props mangeshp.

Fixes #38510.


git-svn-id: https://develop.svn.wordpress.org/trunk@39000 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 23:15:42 +00:00
David A. Kennedy
78a664b210 Twenty Seventeen: Remove excessive escaping in color-patterns.php
Uses `absint()` to escape when getting value. Removes `esc_attr` from each instance of the variable.

Props fencer04.

Fixes #38449.


git-svn-id: https://develop.svn.wordpress.org/trunk@38999 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 21:52:38 +00:00
Tammie Lister
ae72d78fb6 Twenty Seventeen: Hidden article tags on home page fix
This prevents the issue of hidden article tags on home page.

Props ElectricFeet, iv.dimova. morettigeorgiev, davidakennedy
Fixes #38404

M    twentyseventeen/inc/template-tags.php
M    twentyseventeen/style.css


git-svn-id: https://develop.svn.wordpress.org/trunk@38998 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 21:00:14 +00:00
Andrew Ozz
c4145b769e TinyMCE: if the current editor configuration is without toolbars, prevent errors when adding the labels for custom shortcuts.
Fixes #38063.

git-svn-id: https://develop.svn.wordpress.org/trunk@38997 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 20:06:02 +00:00
David A. Kennedy
3cb436603a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38996 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 17:37:50 +00:00
Helen Hou-Sandi
18d1fe4c1d Post-4.7 beta 1 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@38995 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 04:32:19 +00:00
Weston Ruter
e0817ca1f6 Customize: Remove premature (and verbose) check of fresh_site option due to database not being ready on multisite.
Fixes regression in [38991].
See #38114.


git-svn-id: https://develop.svn.wordpress.org/trunk@38994 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 03:42:08 +00:00
Weston Ruter
e0bc1e0c16 Customize: Ensure that qunit test enters in expected state and tests wp.customize.dirtyValues in starter content context.
Fixes regression in [38991].
See #38114.


git-svn-id: https://develop.svn.wordpress.org/trunk@38993 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 03:28:07 +00:00
Helen Hou-Sandi
db66c0d7d2 WordPress 4.7 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@38992 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 03:00:46 +00:00
Weston Ruter
630fd305fc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38991 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 02:56:16 +00:00
Gary Pendergast
76012a9a59 REST API: Revert [38980].
`/users/me` still needs attention, but this change wasn't quite ready.

See #38521.



git-svn-id: https://develop.svn.wordpress.org/trunk@38990 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 02:06:17 +00:00
Joe McGill
f43f3c00c2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38989 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-28 01:50:41 +00:00
David A. Kennedy
d3328e2925 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38988 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 23:23:45 +00:00
David A. Kennedy
38d8e20540 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38987 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 23:00:43 +00:00
David A. Kennedy
42bb3f3789 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38986 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 22:08:33 +00:00
Joe McGill
744f87dbb3 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38985 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 21:50:56 +00:00
Andrea Fercia
6cc9480fd8 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38984 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 20:52:20 +00:00
Andrea Fercia
cc6925d1d5 Accessibility: Remove inappropriate content from the Posts and Edit screens headings.
Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia.

See #26601.


git-svn-id: https://develop.svn.wordpress.org/trunk@38983 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 20:38:09 +00:00
Rachel Baker
3ffefccdf2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38982 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 16:07:06 +00:00
Andrea Fercia
f6c85e6b72 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38981 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 15:22:52 +00:00
Rachel Baker
855a29ccbf REST API: Remove the Location header redirect for the /users/me endpoint.
Props youknowriad jnylen0.
Fixes #38521.

git-svn-id: https://develop.svn.wordpress.org/trunk@38980 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 14:36:49 +00:00
Weston Ruter
3dd4e62653 Customize: Add all dynamic settings for nav menus and nav menu items before previewing to ensure new entries (placeholders) will be recognized.
See #30937.


git-svn-id: https://develop.svn.wordpress.org/trunk@38979 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 08:29:45 +00:00
Pascal Birchler
7d09b0bb0d I18N: Apply the locale filter when returning early in get_locale().
See [38976].
See #29783.

git-svn-id: https://develop.svn.wordpress.org/trunk@38978 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 06:39:16 +00:00
Weston Ruter
968148ec51 Customize: Check for existence of controls and settings for background properties before attempting to access.
Amends [38948].
See #22058.
Fixes #38523.


git-svn-id: https://develop.svn.wordpress.org/trunk@38977 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 05:01:21 +00:00
Gary Pendergast
dcc71eddcd 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38976 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 03:42:09 +00:00
Boone Gorges
eb9e2b9207 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38975 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 02:56:28 +00:00
Boone Gorges
5da7a1dccf 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38974 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 01:41:08 +00:00
Gary Pendergast
3e77cef88a Customize: Remove an unused variable.
The cleanup in [38972] missed a variable that is no longer being used.

Fixes #27403.



git-svn-id: https://develop.svn.wordpress.org/trunk@38973 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-27 00:30:11 +00:00
Weston Ruter
d039c9b4b2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38972 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 22:37:35 +00:00
Rachel Baker
8c0d5292a2 REST API: Add the default_comment_status and default_ping_status options to the setting endpoint.
Props joehoyle.
See #38490.

git-svn-id: https://develop.svn.wordpress.org/trunk@38971 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 22:19:08 +00:00