Commit Graph

33657 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90)
3921eb53ea Autoprefixer for [36532].
See #31195.

git-svn-id: https://develop.svn.wordpress.org/trunk@36548 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 15:38:04 +00:00
Dominik Schilling (ocean90)
de9d091e76 Tests: Indent test_wp_register_style() with tabs.
git-svn-id: https://develop.svn.wordpress.org/trunk@36547 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 15:36:20 +00:00
Dominik Schilling (ocean90)
1750b09775 Update Backbone and Underscore to the latest versions.
Backbone, from 1.1.2 to 1.2.3. Underscore, from 1.6.0 to 1.8.3.

The new versions of Backbone and Underscore offer numerous small bug fixes and some optimizations and other improvements. Check the [http://backbonejs.org/#changelog Backbone changelog] and [http://underscorejs.org/#changelog Underscore changelog] for the full details. 

The new versions include some significant changes that may break existing code. Plugins or themes that rely on the bundled Backbone and/or Underscore libraries should carefully check functionality with the latest versions and run any available unit tests to ensure compatibility.

Some changes of note that were addressed in core as part of this upgrade:

* `_.flatten` no longer works with objects since Underscore.js 1.7. `_.flatten()` working with objects was an unintended side-affect of the implementation, see [https://github.com/jashkenas/underscore/issues/1904#issuecomment-60241576 underscore#1904]. Check any `_flatten` usage and only flatten arrays.
* As of Backbone 1.2.0, you can no longer modify the `events` hash or your view's `el` property in `initialize`, so don't try to modify them there. 
* Since Underscore 1.7, Underscore templates no longer accept an initial data object. `_.template` always returns a function now so make sure you use it that way.

Props adamsilverstein.
Fixes #34350.

git-svn-id: https://develop.svn.wordpress.org/trunk@36546 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 15:21:09 +00:00
Dominik Schilling (ocean90)
f9f0015a90 Setup: Improve wording on the page for the database connection details.
See #26879.

git-svn-id: https://develop.svn.wordpress.org/trunk@36545 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 15:02:03 +00:00
Dominik Schilling (ocean90)
14aa03e37c Setup: Use "Username" instead of "User Name".
Props thisisit.
Fixes #35850.

git-svn-id: https://develop.svn.wordpress.org/trunk@36544 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 14:59:34 +00:00
Andrew Ozz
13a9d1a7e6 Do not strip slashes from the whole &_POST when doing autosaves.
Props joehoyle.
Fixes #35408.

git-svn-id: https://develop.svn.wordpress.org/trunk@36543 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 00:09:42 +00:00
Andrew Ozz
d3a848c773 Comments: look for wp_error when checking whether $wpdb->get_col_length() has failed.
See #10377.

git-svn-id: https://develop.svn.wordpress.org/trunk@36542 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 23:49:43 +00:00
Dominik Schilling (ocean90)
a440256da0 Introduce a $parent_class parameter for _deprecated_constructor().
Use the parameter for the deprecated constructor warning in `WP_Widget` to provide an indication to which widget is using the PHP4 style constructor.

Props sebastian.pisula.
Fixes #33440.

git-svn-id: https://develop.svn.wordpress.org/trunk@36541 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 23:19:38 +00:00
Dominik Schilling (ocean90)
c80ed70337 In wp_title() fix a 7 year old typo.
Props joelerr.
Fixes #34879.

git-svn-id: https://develop.svn.wordpress.org/trunk@36540 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 22:27:05 +00:00
Dominik Schilling (ocean90)
8535f40cf8 Themes: Use the attachment ID as the key in get_uploaded_header_images().
Prevents missing header images when an image has the same name as another header image.

Props sirbrillig.
Fixes #31786.

git-svn-id: https://develop.svn.wordpress.org/trunk@36539 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 22:11:14 +00:00
Dominik Schilling (ocean90)
35579fa786 i18n: Prevent is_textdomain_loaded() from returning true even if there are no translations for the domain.
In `get_translations_for_domain()` don't fill the global `$l10n` with `NOOP_Translations` instances, return a `NOOP_Translations` instance instead.

Props nacin, jrf.
Fixes #21319.

git-svn-id: https://develop.svn.wordpress.org/trunk@36538 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 21:14:45 +00:00
Andrea Fercia
3e7f4fba19 Accessibility: Reduce the WordPress shades of grey, first part.
See #35783.

git-svn-id: https://develop.svn.wordpress.org/trunk@36537 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 16:08:19 +00:00
rmccue
5a945adeed REST API: Apply rest_post_dispatch to embedded responses.
Fixes #35628.
Props @danielbachhuber.


git-svn-id: https://develop.svn.wordpress.org/trunk@36536 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 06:05:02 +00:00
Ryan McCue
10bfe70f06 REST API: Allow explicit HEAD callbacks.
HEAD callbacks can now be registered independently, with the GET
callback still used as a fallback.

Fixes #34841.


git-svn-id: https://develop.svn.wordpress.org/trunk@36535 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 05:50:21 +00:00
Ryan McCue
66fc70f0e1 REST API: Add routing args to rest_dispatch_request filter.
This allows requests to be hijacked via the filter more easily.

Fixes #35507.


git-svn-id: https://develop.svn.wordpress.org/trunk@36534 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 04:40:01 +00:00
Ryan McCue
d7e7c0b81b REST API: Add support for CURIEs.
CURIEs are Compact URIs, which provide a more usable way to use
custom relations in the API. The `wp` CURIE is registered by default
for `https://api.w.org/` URI relations.

Fixes #34729.
Props joehoyle.


git-svn-id: https://develop.svn.wordpress.org/trunk@36533 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 02:18:34 +00:00
Weston Ruter
6dd1dd61a1 Customize: Add a user-friendly way to preview site responsiveness for desktop, tablet, and mobile.
Introduces `WP_Customize_Manager::get_previewable_devices()` with a `customize_previewable_devices` filter to change the default device and which devices are available for previewing. This is a feature that was first pioneered on WordPress.com.

Props celloexpressions, folletto, valendesigns, westonruter, welcher, adamsilverstein, michaelarestad, Fab1en.
Fixes #31195.


git-svn-id: https://develop.svn.wordpress.org/trunk@36532 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 01:56:13 +00:00
Ryan McCue
5534474cef REST API: Fix tests from r36529.
See #35329.


git-svn-id: https://develop.svn.wordpress.org/trunk@36531 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 01:50:06 +00:00
Rachel Baker
0d4a6d0f6e REST API: Don’t display errors during REST API requests.
Uses `wp_debug_mode()` to prevent response from being broken by debug errors. Matches similar behavior of the XML-RPC API.

Props rockwell15.

Fixes #34915.

git-svn-id: https://develop.svn.wordpress.org/trunk@36530 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 01:35:40 +00:00
Ryan McCue
b32aaf603e REST API: Add helper function to get server instance.
This allows using rest_do_request() outside of the API itself easily.

Props danielbachhuber, swissspidy.


git-svn-id: https://develop.svn.wordpress.org/trunk@36529 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-16 01:11:31 +00:00
Andrea Fercia
e9f1903586 Accessibility: improve the color contrast ratio for the TinyMCE button icons.
Also, tries to use the new grays from the Design Handbook wherever applicable.

Props michaelarestad, afercia.
Fixes #35604.

git-svn-id: https://develop.svn.wordpress.org/trunk@36528 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-15 21:10:17 +00:00
Drew Jaynes
3b157e44c7 Docs: Add an internal note to the DocBlock for comment_form_title() explaining restoration of the $comment global.
See [36512]. See #35624.


git-svn-id: https://develop.svn.wordpress.org/trunk@36527 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-13 19:14:01 +00:00
Boone Gorges
f50ed42ca7 Introduce {$taxonomy}_term_edit_form_top action to edit-tag-form.php.
This new action gives developers a place to output content at the beginning
of the form element on edit-tags.php.

Props flixos90.
Fixes #35252.

git-svn-id: https://develop.svn.wordpress.org/trunk@36526 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-13 04:00:07 +00:00
Boone Gorges
7f87a14808 Introduce publicly_queryable taxonomy argument.
Taxonomies registered as `publicly_queryable` can be queried as taxonomy
archives.

If not provided explicitly, the value of `publicly_queryable` is inherited
from `public`.

Props Chouby.
Fixes #34491.

git-svn-id: https://develop.svn.wordpress.org/trunk@36525 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-13 03:50:37 +00:00
Boone Gorges
d03ae82c32 Improve WP_Query lazyloading logic, for better performance.
Lazyloading for comment meta and term meta, introduced into `WP_Query` in
4.4, used flags - `updated_term_meta_cache` and `updated_comment_meta_cache` -
in an attempt to prevent cache priming from happening more than once per query
object. This technique was mostly effective, but not entirely efficient, since
the flag didn't prevent the `lazyload_*_meta` callbacks from running. The
obvious solution - removing the filter callback after it'd be run once - was
dismissed for 4.4 because of concerns that `remove_filter()` could disable
lazyloading too generally in the context of nested queries, due to the way
`_wp_filter_build_unique_id()` doesn't always build sufficiently unique IDs for
similar objects. However, further testing shows that this concern is only valid
in a very small subset of cases, while the cost of keeping the query objects in
memory, via the `$wp_filter` global, is quite significant. As such, this
changeset removes the flags in favor of the `remove_filter()` technique.

See #35454, #35816.

git-svn-id: https://develop.svn.wordpress.org/trunk@36524 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-13 03:04:05 +00:00
Weston Ruter
9a108e99b5 Customize: Ensure that nav menu items can be shift-clicked to edit in secondary instances of the same nav menu.
When the same nav menu is shown multiple times on a page, only the first instance of the nav menu will include `id` attributes. Subsequent instances will have the `id` attributes omitted. However, in both cases the underlying nav menu item's post ID is available among the `class` names, so the post ID can be more reliably obtained from `class` instead of the `id` attribute.  

Amends [36383].
Fixes #32681.


git-svn-id: https://develop.svn.wordpress.org/trunk@36523 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-13 00:11:24 +00:00
Weston Ruter
b5a54ae692 Customize: Hide widgets re-order button when no re-ordering is possible.
Hide the re-order button if there are no widgets in the sidebar, or if there is there is only one sidebar and there is only one widget in the sidebar.

Props rabmalin, westonruter.
Fixes #35533.


git-svn-id: https://develop.svn.wordpress.org/trunk@36522 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 23:51:16 +00:00
Rachel Baker
0b761497c5 Comments: In the comments list table, only link rows inside the “Submitted On” column to the comment if it is publicly viewable.
The date within the comments list table “Submitted On” column will only be wrapped in `get_comment_link()` if the comment is approved and associated with a valid `comment_post_ID`.

Fixes #35279.

git-svn-id: https://develop.svn.wordpress.org/trunk@36521 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 21:42:03 +00:00
Boone Gorges
3a0234982c Make sure fixtures have empty post_content in search test.
The generator sequence was causing false positives when the search terms
('1' and '0') happened to match the current sequence number (eg,
'Post content 190').

Introduced in [36278].

See #31025.

git-svn-id: https://develop.svn.wordpress.org/trunk@36520 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 21:06:41 +00:00
Aaron Jorbin
0e6951b7aa Improve Automated Feed Tests
Multiple improvements to the RSS2 automated tests along with the addition of Atom tests.
1. General whitespace cleanup (since the rss2 file serves as the base of the atom file).
2. Adds an author and category to the tests.
3. Since the content of the posts is the same, we don't need to test all of the post content.
4. Adds many posts so that the post count can be checked

Props stevenkword
Fixes #35160.



git-svn-id: https://develop.svn.wordpress.org/trunk@36519 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 19:02:25 +00:00
Andrea Fercia
a64ab83564 Customizer: reduce the spinner re-painted area to the smallest possible one.
Also, changes the "customize container" and the theme installer preview
background from white to the default body `#f1f1f1` background.

Fixes #35649.

git-svn-id: https://develop.svn.wordpress.org/trunk@36518 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 18:34:46 +00:00
Rachel Baker
e8402e5572 Media: Fix inline docs typo inside wp_calculate_image_srcset() function.
mathces -> matches.

Props neoxx.

Fixes #35714.

git-svn-id: https://develop.svn.wordpress.org/trunk@36517 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 18:14:03 +00:00
Boone Gorges
b5bc8e336e Bail from get_term() if a filter returns an object that is not a WP_Term.
This prevents fatal errors in certain cases.

Props tmuikku.
Fixes #35808.

git-svn-id: https://develop.svn.wordpress.org/trunk@36516 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 14:25:05 +00:00
Rachel Baker
cff37450eb Comments: Unit test for `wp_get_comment_fields_max_lengths().
This adds tests for the comment form field lengths returned by `wp_get_comment_fields_max_lengths()`. Replaces unit test removed in r36514. 

See #10377.

git-svn-id: https://develop.svn.wordpress.org/trunk@36515 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 14:17:13 +00:00
Rachel Baker
8718eb2536 Comments: Change wp_get_comment_column_max_length() function to wp_get_comment_fields_max_lengths() for consolidation and better fallbacks.
Instead of returning a value for each of the related table column lengths, return an array of all of the column lengths used in the comment form.
Better fallback handling, where each field falls back to the expected max_length instead of an arbitrary number.

Props azaozz.

Fixes #10377.

git-svn-id: https://develop.svn.wordpress.org/trunk@36514 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 13:54:50 +00:00
Andrew Ozz
43dae50c0d TinyMCE: fix removing a space before inline tags when applying formatting shortcuts.
Fixes #35798.

git-svn-id: https://develop.svn.wordpress.org/trunk@36513 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 04:22:03 +00:00
Boone Gorges
126193fa3c Set the $comment global in comment_form_title().
In [33963], `comment_form_title()` was refactored so that it no longer made
reference to the `$comment` global. This broke some functionality within the
comment form, as certain template would no longer be able to access the
"current" comment.

Props d4z_c0nf, WisdmLabs, boonebgorges.
Fixes #35624.

git-svn-id: https://develop.svn.wordpress.org/trunk@36512 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 04:09:46 +00:00
Boone Gorges
0ae22e5f4c In delete_metadata(), only invalidate cache for affected objects.
The `$delete_all` flag in `delete_metadata()` triggers cache invalidation for
multiple objects. Previously, invalidation took place for all objects matching
the `$meta_key` parameter, regardless of whether `$meta_value` was also set.
This resulted in overly aggressive invalidation.

Props rahal.aboulfeth.
Fixes #35797.

git-svn-id: https://develop.svn.wordpress.org/trunk@36511 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-12 02:46:28 +00:00
Eric Andrew Lewis
e8ed3fcbf1 Menus: Allow larger menus to be created in the Edit Menu screen.
In the Edit Menu screen, each menu item creates 11 form input elements. In menus with more than 71 menu items, often items after the 71st weren't saved. This was because PHP's runtime configuration `max_input_vars` default value is 1000. Large menus exceed this, so PHP didn't populate the `$_POST` superglobal for the latter menu items.

The entire form is now JSON-encoded into a single input which populates `$_POST` manually on form submission.

This was attempted previously in [36506] which was reverted in [36507]. Some form fields were not being slurped into the form's JSON representation, and it did not scale for a site with many posts. This approach fixes those problems.

Props ocean90, afercia.
See #14134.


git-svn-id: https://develop.svn.wordpress.org/trunk@36510 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-11 19:07:30 +00:00
Boone Gorges
71060260a1 Don't double-unslash meta key when update_metadata() falls back on add_metadata().
Props jdgrimes.
Fixes #35795.

git-svn-id: https://develop.svn.wordpress.org/trunk@36509 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-11 17:34:59 +00:00
Boone Gorges
d2cbbfe28b Remove unused variable from get_terms().
Unused since [31284].

Props TimothyBlynJacobs.
Fixes #35784.

git-svn-id: https://develop.svn.wordpress.org/trunk@36508 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-11 04:32:08 +00:00
Eric Andrew Lewis
44159f1afa Menus: Revert larger menu support in Edit Menus screen in [36506].
JSON encoding the form as it exists on the page will not scale. 

See #14134.


git-svn-id: https://develop.svn.wordpress.org/trunk@36507 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-10 14:10:17 +00:00
Eric Andrew Lewis
afe521a466 Menus: Allow larger menus to be created in the Edit Menu screen.
In the Edit Menu screen, each menu item creates 11 form input elements. In menus with more than 71 menu items, often items after the 71st weren't saved. This was because PHP's runtime configuration `max_input_vars` default value is 1000. Large menus exceed this, so PHP didn't populate the `$_POST` superglobal for the latter menu items.

The entire form is now JSON-encoded into a single input which populates `$_POST` manually on form submission.

See #14134.


git-svn-id: https://develop.svn.wordpress.org/trunk@36506 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-10 03:31:31 +00:00
Dominik Schilling (ocean90)
c7e84936c8 Multisite: Don't show the database upgrade admin notice on the upgrade page itself.
Fixes #35782.

git-svn-id: https://develop.svn.wordpress.org/trunk@36505 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-09 14:29:06 +00:00
Dominik Schilling (ocean90)
92a9a57b63 Users: Display the new user email notice in user admin too.
Also, in `new_user_email_admin_notice()` use the global `$pagenow` and add a translators comment for the placeholder.

Fixes #35767.

git-svn-id: https://develop.svn.wordpress.org/trunk@36504 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 13:53:23 +00:00
Dominik Schilling (ocean90)
96b6828558 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.

Fixes #35766.

git-svn-id: https://develop.svn.wordpress.org/trunk@36503 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 13:25:44 +00:00
Drew Jaynes
1c2f0896db Themes: Pass information about the old theme in the form of a WP_Theme object when the switch_theme action is fired.
Props MikeHansenMe.
See #22401.


git-svn-id: https://develop.svn.wordpress.org/trunk@36502 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 08:25:28 +00:00
Drew Jaynes
2caad3f7b2 Docs: Improove the DocBlock summary for wp_signon().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36501 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 08:10:47 +00:00
Drew Jaynes
1c80e8ca46 Docs: Make a couple of minor improvements to the DocBlock for wp_get_raw_referer(), introduced in [36266].
* Uses a third-person singular verb in the summary
* Makes the return types more specific with `string|false` vs `string|bool`.

See #27152. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36500 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 08:08:48 +00:00
Drew Jaynes
46029e674a Docs: Add a changelog entry for the introduction of maxlength character limits for the 'author', 'email', and 'url' fields in comment_form().
Introduced in [36272].

See #10377. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36499 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 08:04:15 +00:00