Commit Graph

33769 Commits

Author SHA1 Message Date
Weston Ruter
bd09cddfc1 Customize: Update unit test for WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() to account for slashing if user can't unfiltered_html.
Fixes unit tests which broke under multisite config after [36608].

Fixes #35869.


git-svn-id: https://develop.svn.wordpress.org/trunk@36610 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 05:09:34 +00:00
Boone Gorges
969f98ecee Docs: WP_Meta_Query accepts 'EXISTS' or 'NOT EXISTS' for $compare.
Props apaliku, jdgrimes.
Fixes #35891.

git-svn-id: https://develop.svn.wordpress.org/trunk@36609 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 03:55:09 +00:00
Weston Ruter
d06329d035 Customize: Fix previewing and updating of nav menu items containing slashed/slashable characters.
Prevents slashes from being added when a user without `unfiltered_html` previews a nav menu item containing an apostrophe or some other slashable character, and prevents the loss of an intentional slash (e.g. "\o/") when saving a nav menu item, regardless of capability.

Fixes #35869.


git-svn-id: https://develop.svn.wordpress.org/trunk@36608 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 00:13:53 +00:00
Eric Andrew Lewis
c592a7262e Posts: Non-trashed posts should take slug priority over trashed posts.
When determining a unique post slug, trashed posts are taken into account. Previously, new posts would add suffixes to their slugs (e.g. `about-2`) when a post in the trash had the desired slug (e.g. `about`). 

To avoid this behavior, when a post is trashed its slug (i.e. `post_name`) is now suffixed with `-%trashed%`. The post's pre-trash slug is stored as post meta, and if the post is restored from trash, its desired slug is reapplied. 

For existing trashed posts which don't have the `-%trashed%` suffix, the suffix is added when a post with its desired slug is created.

Props ocean90, boonebgorges, ryan, SergeyBiryukov, coffee2code, helen, williamsba1.
See #11863.


git-svn-id: https://develop.svn.wordpress.org/trunk@36607 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-21 21:44:14 +00:00
Weston Ruter
9d29858b25 Customize: Fix "Loading..." message from persisting in panel title when user does not have manage_options cap to edit blogname.
Reverts part of [36388].

Fixes #35579.


git-svn-id: https://develop.svn.wordpress.org/trunk@36606 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-21 06:14:59 +00:00
Dominik Schilling (ocean90)
0659293ee2 JSHint for [36602].
See #33301.

git-svn-id: https://develop.svn.wordpress.org/trunk@36605 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 22:13:17 +00:00
Dominik Schilling (ocean90)
6e493b1713 Script Loader: Fix missing script output when the groups of dependencies are different.
Aka: Don't lose the grandchild.

Props gitlost, ocean90.
Fixes #35873.

git-svn-id: https://develop.svn.wordpress.org/trunk@36604 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 22:10:01 +00:00
Dominik Schilling (ocean90)
78ed4e109a i18n-tools: Respect the coding standards when adding textdomains with add-textdomain.php.
Props GaryJ, groovecoder.
Fixes #21616.

git-svn-id: https://develop.svn.wordpress.org/trunk@36603 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 21:43:51 +00:00
Andrew Ozz
2ba684e7e4 TinyMCE, inline link dialog:
- Fix passing values to the (old) modal on open when non-linked text is selected and Advanced is clicked before pasting an URL.
- When the user has selected text partially including a link and opens the editing dialog, auto-select the link only. Helps when a linked word is selected by double-clicking.
- Remove all placeholders on saving.
- Do not add undo level on inserting link placeholder.
- Remove the placeholder when canceling from the modal.

See #33301.

git-svn-id: https://develop.svn.wordpress.org/trunk@36602 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 21:35:54 +00:00
Drew Jaynes
75e314e23e Docs: Fix two incorrect notations of the $show_admin_bar global to specify a boolean type, not WP_Admin_Bar.
See [36491]. Fixes #35686.


git-svn-id: https://develop.svn.wordpress.org/trunk@36601 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 21:26:26 +00:00
Dominik Schilling (ocean90)
113288c4b1 i18n-tools: Add the ability to parse a whole directory with add-textdomain.php.
Props iamntz.
Fixes #35499.

git-svn-id: https://develop.svn.wordpress.org/trunk@36600 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 21:02:33 +00:00
Dominik Schilling (ocean90)
4c4add2837 i18n-tools: Remove PHP4 constructor from add-textdomain.php.
`_deprecated_constructor()` isn't available in non-WordPress context.

See #31982.

git-svn-id: https://develop.svn.wordpress.org/trunk@36599 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 20:33:48 +00:00
Boone Gorges
8b37597ad3 In get_terms(), assemble WHERE conditions in an array instead of concatenating.
This method is more reliable when adding new `WHERE` conditions.

See #35495.

git-svn-id: https://develop.svn.wordpress.org/trunk@36598 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 20:03:31 +00:00
Andrew Ozz
d51e116298 TinyMCE: fix the regex that removes spaces from empty paragraphs. Was causing problems when wpautop is disabled and there are many U+00A0 chars between the opening <p> and an inline tag. These chars are inserted by the browsers to maintain consecutive spaces typed by the users in contentEditable.
Fixes #35890.

git-svn-id: https://develop.svn.wordpress.org/trunk@36597 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 19:55:03 +00:00
Dominik Schilling (ocean90)
5f9d1fa799 Tests: Test that jQuery can be moved into footer after [36550].
Props gitlost.
See #25247.

git-svn-id: https://develop.svn.wordpress.org/trunk@36596 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 16:16:35 +00:00
Dominik Schilling (ocean90)
c5b09498f5 Theme Compat: Replace the custom comment form with comment_form() and reduce number of links.
`comment_form()` has nearly the same markup as the custom form but also includes the latest enhancements like improved a11y and more filters.

Add translators comments, props ramiy.

Fixes #35888.

git-svn-id: https://develop.svn.wordpress.org/trunk@36595 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 14:40:33 +00:00
Boone Gorges
c43fc5ac2b Tests: Add decorators to PHPMailer mock object.
The new `get_recipient()` and `get_sent()` methods greatly simplify the
syntax required when writing tests for `wp_mail()`.

Props welcher.
Fixes #34161.

git-svn-id: https://develop.svn.wordpress.org/trunk@36594 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 03:40:49 +00:00
Rachel Baker
6779bd5734 Docs: Add missing @since and @access tags to get_curies method and filter from r36533
See #34729, #32246.

git-svn-id: https://develop.svn.wordpress.org/trunk@36593 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 23:41:43 +00:00
Dominik Schilling (ocean90)
3ec5b18d40 Styles: Pass the media attribute as an argument to the style_loader_tag filter.
Props sebastian.pisula.
Fixes #34765.

git-svn-id: https://develop.svn.wordpress.org/trunk@36592 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 21:04:53 +00:00
Dominik Schilling (ocean90)
3748ec5249 Script Loader: Don't parse $src if the current color scheme isn't registered.
Avoids a `parse_url()` call on each request if the default colors scheme is in use.

Fixes #35882.

git-svn-id: https://develop.svn.wordpress.org/trunk@36591 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 20:43:10 +00:00
Dominik Schilling (ocean90)
066f081ed5 Styles: Bail if WP_Styles::_css_href() returns an empty value.
The style `colors` gets registered with `true` as the source value which gets handled later by `wp_style_loader_src()`, a callback for the `style_loader_src` filter in `WP_Styles::_css_href()`. `wp_style_loader_src()` may return false, for example for the default color scheme.

This was removed in [36550].

See #35229.

git-svn-id: https://develop.svn.wordpress.org/trunk@36590 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 20:33:42 +00:00
Andrew Ozz
218c1240b8 TinyMCE: update to 4.3.4. Changelog: https://github.com/tinymce/tinymce/blob/master/changelog.txt.
Fixes #35876.

git-svn-id: https://develop.svn.wordpress.org/trunk@36589 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 19:18:59 +00:00
Rachel Baker
ca008e9f51 Comments: Refresh the Moderate Comment screen for a friendlier experience with email moderation actions.
Brings some love to this neglected screen:
* format `comment_content`, instead of escaping in one massive block of text
* only wrap the comment date in a link if the comment permalink exists
* include link to the Edit Comment screen at the bottom of the comment_content
* update the message styles to match other screens
* append `#wpbody-content` to the comment email message links for accessibility

Props johnbillion, rachelbaker, afercia, melchoyce, karmatosed.

Fixes #34133

git-svn-id: https://develop.svn.wordpress.org/trunk@36588 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 19:13:59 +00:00
Andrea Fercia
15a26902a6 Accessibility: Improve color contrast updating any #999 gray used for text or icons to a darker gray.
Fixes #35660.

git-svn-id: https://develop.svn.wordpress.org/trunk@36587 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 18:43:04 +00:00
Weston Ruter
03360d143d Customize: Add selective refresh framework with implementation for widgets and re-implementation for nav menus.
See https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-customizer/.

Props westonruter, valendesigns, DrewAPicture, ocean90.
Fixes #27355.


git-svn-id: https://develop.svn.wordpress.org/trunk@36586 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 18:40:06 +00:00
Andrea Fercia
29e2274793 Accessibility: Fix displaying of Universal time and Local time info on the General Settings screen.
In [36263] they were mistakenly moved within a conditional check.

Fixes #35064.

git-svn-id: https://develop.svn.wordpress.org/trunk@36585 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 16:08:51 +00:00
Andrea Fercia
e4e9e19f4a Accessibility: after [36000] conditionally print out the aria-describedby attribute on the Featured Image postbox.
Fixes #35076.

git-svn-id: https://develop.svn.wordpress.org/trunk@36584 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 15:09:51 +00:00
Weston Ruter
73f2866194 Customize: Prevent consecutive refresh requests from preview from causing JS error.
Fixes "Uncaught TypeError: this.targetWindow is not a function".

See #27355.
Fixes #35866.


git-svn-id: https://develop.svn.wordpress.org/trunk@36583 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-19 03:46:59 +00:00
Andrea Fercia
bd6fc729e9 Accessibility: Reduce the WordPress shades of grey, Episode 2.
See #35783.

git-svn-id: https://develop.svn.wordpress.org/trunk@36582 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 22:29:29 +00:00
Andrea Fercia
985e22828e Plugins: Remove an unused variable after [35953].
Fixes #35050.

git-svn-id: https://develop.svn.wordpress.org/trunk@36581 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 21:32:37 +00:00
Dominik Schilling (ocean90)
57ebfc9b94 Themes: After [36546] restore theme search functionality.
* Correct several incorrect uses of `_.union`. Since Underscore 1.7.0 `_.union` supports only arrays and not variadic args.
* Use a namespaced event `themes:update`. Backbone 1.2 added a built in `update` event that triggers after any amount of models are added or removed from a collection.

Props adamsilverstein.
See #34350.

git-svn-id: https://develop.svn.wordpress.org/trunk@36580 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 21:20:33 +00:00
Dominik Schilling (ocean90)
e636f79308 Themes: Fix flickering of the theme screenshot on hover in WebKit browsers.
Props JoeFusco.
Fixes #35787.

git-svn-id: https://develop.svn.wordpress.org/trunk@36579 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 21:10:17 +00:00
Dominik Schilling (ocean90)
2d7150e40d Formatting: Avoid a PHP warning when wptexturize() is called with a trailing less-than symbol.
Props westonruter.
Fixes #35864.

git-svn-id: https://develop.svn.wordpress.org/trunk@36578 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 20:30:54 +00:00
Drew Jaynes
1663c24df4 Docs: Add an explanation for the dynamic portion of the {$taxonomy}_term_edit_form_top hook, introduced in [36526].
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36577 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 18:19:00 +00:00
DrewAPicture
305e314259 Docs: Add formatting to a changelog entry in the hook doc for the rest_dispatch_request filter.
See [36534]. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36576 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 18:17:04 +00:00
Dominik Schilling (ocean90)
e7a6236168 Media Library: After [36546] restore the "Add new" functionality.
Rework handling of the `'toggle:upload:attachment'` event using `.on` vs `.listenTo` for better compatibility with the current version of Backbone.

Props adamsilverstein.
See #34350.
Fixes #35853.

git-svn-id: https://develop.svn.wordpress.org/trunk@36575 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 17:49:21 +00:00
Dominik Schilling (ocean90)
9f5eb3c604 Add missing test changes for [36573].
See #34755.

git-svn-id: https://develop.svn.wordpress.org/trunk@36574 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 17:43:56 +00:00
Dominik Schilling (ocean90)
cc59bf5f3b Customizer: In nav menus show the location name instead of slug.
Props ryankienstra.
Fixes #34755.

git-svn-id: https://develop.svn.wordpress.org/trunk@36573 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 17:15:28 +00:00
Jeremy Felt
a16d97039b Remove extra spaces between function names and brackets
These were introduced when making list table view modes sticky.

See #16774, #34365.


git-svn-id: https://develop.svn.wordpress.org/trunk@36572 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 16:50:49 +00:00
Dominik Schilling (ocean90)
c3c16e7c6e Don't display errors during Ajax requests.
See #34915 for REST and #23811 for XML-RPC.

Props pento.
Fixes #26262.

git-svn-id: https://develop.svn.wordpress.org/trunk@36571 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 16:42:48 +00:00
Dion Hulse
d707453bbc HTTP API: Certificate bundle: Attempt to move a certificate lower in the file to allow older OpenSSL versions to parse it & communicate with WordPress.org securely again.
The OpenSSL version which was failing in this case was `OpenSSL 0.9.8e 23 Feb 2007`.

See #35637 #30434 #25007


git-svn-id: https://develop.svn.wordpress.org/trunk@36570 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 08:20:42 +00:00
Andrew Ozz
bb49a958d2 Replace wp_upload_dir() with the new wp_get_upload_dir() in all cases where a file is not being uploaded. Deprecate _wp_upload_dir_baseurl(), and replace it with wp_get_upload_dir().
See #34359.

git-svn-id: https://develop.svn.wordpress.org/trunk@36569 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 00:23:04 +00:00
Drew Jaynes
e2dd03abd4 Docs: Remove a duplicate @static tag from the WP_Customize_Panel->instance_count property DocBlock.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36568 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-18 00:13:21 +00:00
Boone Gorges
0e9ff07da5 Reintroduce term meta unit test accidentally removed in [36566].
git-svn-id: https://develop.svn.wordpress.org/trunk@36567 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 23:01:05 +00:00
Boone Gorges
28fad09b61 More performance improvements to metadata lazyloading.
Comment and term meta lazyloading for `WP_Query` loops, introduced in 4.4,
depended on filter callback methods belonging to `WP_Query` objects. This meant
storing `WP_Query` objects in the `$wp_filter` global (via `add_filter()`),
requiring that PHP retain the objects in memory, even when the local variables
would typically be expunged during normal garbage collection. In cases where a
large number of `WP_Query` objects were instantiated on a single pageload,
and/or where the contents of the `WP_Query` objects were quite large, serious
performance issues could result.

We skirt this problem by moving metadata lazyloading out of `WP_Query`. The
new `WP_Metadata_Lazyloader` class acts as a lazyload queue. Query instances
register items whose metadata should be lazyloaded - such as post terms, or
comments - and a `WP_Metadata_Lazyloader` method will intercept comment and
term meta requests to perform the cache priming. Since `WP_Metadata_Lazyloader`
instances are far smaller than `WP_Query` (containing only object IDs), and
clean up after themselves far better than the previous `WP_Query` methods (bp
only running their callbacks a single time for a given set of queued objects),
the resource use is decreased dramatically.

See [36525] for an earlier step in this direction.

Props lpawlik, stevegrunwell, boonebgorges.
Fixes #35816.

git-svn-id: https://develop.svn.wordpress.org/trunk@36566 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 22:57:33 +00:00
Andrew Ozz
c7936b8785 Improve the performance of wp_upload_dir():
- Cache the output in non-persistent cache.
- Cache the result from `wp_mkdir_p()` in persistent cache (when present).
- Introduce `wp_get_upload_dir()` for use when not uploading files. It is equivalent to `wp_upload_dir()` but does not check for the existence or create the upload directory.
- Change tests to use the non-cached `_wp_upload_dir()`. They change options on the fly (should never be used in production) to simulate different environments.
- Introduce `_upload_dir_no_subdir()` and `_upload_dir_https()` to facilitate testing. These use the proper `upload_dir` filter to simulate different environments.

Props kovshenin, azaozz.
See #34359.

git-svn-id: https://develop.svn.wordpress.org/trunk@36565 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 22:51:01 +00:00
Boone Gorges
1afe1da216 Add changelog entry for publicly_queryable argument in register_taxonomy().
Missed in [36525].

Fixes #34491.

git-svn-id: https://develop.svn.wordpress.org/trunk@36564 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 22:03:50 +00:00
Dominik Schilling (ocean90)
bc95fd2884 Tests: Add test for wp_get_installed_translations().
Introduces language files in /tests/phpunit/data/language. Each file includes the header and 5 translations.

Props realloc for initial patch.
Fixes #35284.

git-svn-id: https://develop.svn.wordpress.org/trunk@36563 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 22:01:11 +00:00
Jeremy Felt
fafbd9fafd Multisite: Make view mode sticky for network users and sites list tables.
Fixes #34365.


git-svn-id: https://develop.svn.wordpress.org/trunk@36562 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 21:59:51 +00:00
Jeremy Felt
e198e92dff Multisite: Avoid a PHP Notice when saving a site address without a path.
Props kjbenk.
Fixes #35631.


git-svn-id: https://develop.svn.wordpress.org/trunk@36561 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 20:49:29 +00:00