Commit Graph

33603 Commits

Author SHA1 Message Date
Sergey Biryukov
cab3a242f7 Docs: Correct $number type in number_format_i18n().
Props salcode.
Fixes #35893.

git-svn-id: https://develop.svn.wordpress.org/trunk@36644 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 18:43:47 +00:00
Weston Ruter
c9b47e9d92 Customize: Skip exporting partials to client and handling rendering requests if user can't modify associated settings.
Introduces `WP_Customize_Partial::check_capabilities()` for parity with `WP_Customize_Control::check_capabilities()`.
 
See #27355.
Fixes #35914.


git-svn-id: https://develop.svn.wordpress.org/trunk@36643 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 18:13:30 +00:00
Drew Jaynes
380e94f1ee Docs: Update the type for $callback parameters to callable in DocBlocks for add_settings_section() and add_settings_field().
Props aidanlane.
Fixes #35772.


git-svn-id: https://develop.svn.wordpress.org/trunk@36642 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 18:04:22 +00:00
Dominik Schilling (ocean90)
7e16474308 Customizer: Add visual feedback to reorder buttons.
Props coreymcollins, melchoyce.
Fixes #35041.

git-svn-id: https://develop.svn.wordpress.org/trunk@36641 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 17:53:40 +00:00
Drew Jaynes
66ec958a5f Users: Pass the array of user IDs being deleted to the delete_user_form action hook in two places.
Also updates documentation for the first parameter, `$current_user`, to clarify that it holds the `WP_User` object for the _current_ user, not the one being deleted.

Props usermrpapa.
Fixes #35063. 


git-svn-id: https://develop.svn.wordpress.org/trunk@36640 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 17:41:15 +00:00
Dominik Schilling (ocean90)
ccaa888386 Customizer: Contain "No image set/selected" in dashed border.
Props Ankit K Gupta, chris_dev.
Fixes #35826.

git-svn-id: https://develop.svn.wordpress.org/trunk@36639 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 17:26:58 +00:00
Pascal Birchler
9ac7cc3aa0 Themes: Improve error messages for broken themes.
Props mayukojpn for initial patch.
Fixes #35286.

git-svn-id: https://develop.svn.wordpress.org/trunk@36638 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 17:19:57 +00:00
Pascal Birchler
fe824ee872 Embeds: Make the click event handler work for dynamically added links.
Props JamesDiGioia.
Fixes #35630.

git-svn-id: https://develop.svn.wordpress.org/trunk@36637 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 17:15:23 +00:00
Drew Jaynes
203966bd4f Docs: Improve documentation for WP_REST_Request to highlight a caveat of ArrayAccess when it comes to passing similar arguments for multiple request methods.
Props danielbachhuber, DrewAPicture.
Fixes #35799.


git-svn-id: https://develop.svn.wordpress.org/trunk@36636 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:56:28 +00:00
Pascal Birchler
ee7ac00886 Embeds: Load the default site icon from the wp-includes directory.
Files inside the `wp-admin` directory may not be publicly available. This copies the blue WordPress logo to `wp-includes/images`.

Props thewanderingbrit.
Fixes #35322.

git-svn-id: https://develop.svn.wordpress.org/trunk@36635 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:54:32 +00:00
Boone Gorges
a001f7089b Docs: Improve description of get_term() return value.
Props sebastian.pisula.
Fixes #35919.

git-svn-id: https://develop.svn.wordpress.org/trunk@36634 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:47:47 +00:00
Pascal Birchler
0e13a57288 Script Loader: Introduce wp_add_inline_script().
This new function can be used to add inline JavaScript before and after enqueued scripts, just like `wp_add_inline_style()` works for CSS.

Props atimmer, abiralneupane, ocean90, swissspidy.
Fixes #14853.

git-svn-id: https://develop.svn.wordpress.org/trunk@36633 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:43:41 +00:00
Boone Gorges
0338c8b3a3 Query: Allow a seed value to be passed when using 'rand' $orderby.
`WP_Query` allows random ordering; `'orderby' => 'rand'` translates to
`ORDER BY RAND()`. This syntax results in random ordering that is not
consistent from request to request. MySQL supports the passing of a seed value
to random sorts, such as `ORDER BY RAND(3)`, which will return the same
random value each time it's called. `WP_Query` now supports this syntax, by
passing `RAND(3)` (or whatever integer seed value you'd like) as the value
of `'orderby'`.

Props hlashbrooke.
Fixes #35692.

git-svn-id: https://develop.svn.wordpress.org/trunk@36632 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:39:50 +00:00
Dominik Schilling (ocean90)
7b1c4151dd L10n: Add test for wp_dropdown_languages().
Props realloc.
Fixes #35294.

git-svn-id: https://develop.svn.wordpress.org/trunk@36631 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:27:36 +00:00
Dominik Schilling (ocean90)
b5adc06521 Updates: Pass locales of all available languages to the themes/plugins update API.
This ensures that language packs for all languages in a Multisite install are updated.

Fixes #34937.

git-svn-id: https://develop.svn.wordpress.org/trunk@36630 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:16:29 +00:00
Dominik Schilling (ocean90)
4315a8867d In WP::handle_404() introduce a filter pre_handle_404 to short-circuit default header status handling.
This comes handy if you use WordPress without posts, means `$wp_query` contains no results.

Props prettyboymp, hakre, prettyboymp, Denis-de-Bernardy, ethitter, ocean90.
Fixes #10722.

git-svn-id: https://develop.svn.wordpress.org/trunk@36629 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 16:07:39 +00:00
Andrew Ozz
2dc9766688 In wp_upload_dir() do not cache error from wp_mkdir_p() when a directory cannot be created. Keep trying to create the dirs. This happens mostly in file upload context.
See #34359.

git-svn-id: https://develop.svn.wordpress.org/trunk@36628 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 15:57:23 +00:00
Ella Iseulde Van Dorpe
7040b4d932 TinyMCE: inline text patterns
First run.

See #33300.


git-svn-id: https://develop.svn.wordpress.org/trunk@36627 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 08:32:34 +00:00
Boone Gorges
b4f1d6ff55 Docs: Correct param types on some filters in wp_filter_comment().
Introduced in [26491].

Props meitar, netweb.
Fixes #35908.

git-svn-id: https://develop.svn.wordpress.org/trunk@36626 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 03:05:26 +00:00
Boone Gorges
0809037f61 Query: is_*( $int ) should not falsely match strings starting with "$int".
Another chapter in the Storied Annals of Weird `in_array()` Behavior:
`in_array( 4, array( "4-cool-dudes" ) );` resolves to `true`, such that
`is_page( 4 )` was returning true for posts with the name `'4-cool-dudes'`.

We work around this behavior by ensuring that values passed to the `is_`
methods are cast to strings before the `in_array()` checks. ID checks still
work as expected; see #24674.

Props mikejolley, swissspidy, boonebgorges.
Fixes #35902.

git-svn-id: https://develop.svn.wordpress.org/trunk@36625 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 02:20:28 +00:00
Weston Ruter
b30e77f5fc Customize: Let WP_Customize_Selective_Refresh class be final to match manager and other component classes.
This class is not intended to be extended.
 
See #27355.


git-svn-id: https://develop.svn.wordpress.org/trunk@36624 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 01:27:55 +00:00
Weston Ruter
778ee03179 Customize: Ensure dynamic_sidebar() finishes with removing the sidebar ID from the current_dynamic_sidebar_id_stack.
This ensures that widgets appearing after a nested sidebar will continue to be selective refreshable.
 
See #27355.


git-svn-id: https://develop.svn.wordpress.org/trunk@36623 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 01:21:38 +00:00
Weston Ruter
d14b188c42 Customize: Prevent dropping backslashes from input on general settings and settings for nav menus and some widgets.
Ensures that intentional backslashes (e.g. "\o/") can be used in:

* Site title
* Site description
* Nav menu name
* Custom Menu widget title
* Tag Cloud widget title
* Text widget body if can't `unfiltered_html`

The latter three are also fixed on the widgets admin page.

Fixes #35898.


git-svn-id: https://develop.svn.wordpress.org/trunk@36622 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 01:01:43 +00:00
Dominik Schilling (ocean90)
b17a2e9567 Add translators comments to wp-admin/users.php.
Props ramiy.
Fixes #35885.

git-svn-id: https://develop.svn.wordpress.org/trunk@36621 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-23 00:04:36 +00:00
Dominik Schilling (ocean90)
2d25c6ce26 Template: Update label for the username field in wp_login_form() after [36617].
See #9568.

git-svn-id: https://develop.svn.wordpress.org/trunk@36620 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:37:21 +00:00
Andrea Fercia
b6d18747fc Accessibility: Improve the color contrast ratio for the input placeholders.
Also, cleans up a bit the CSS removing rules for elements that don't use
placeholders any more.

Fixes #35777.

git-svn-id: https://develop.svn.wordpress.org/trunk@36619 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:28:43 +00:00
Andrea Fercia
bf528d321d Accessibility: Remove title attributes from the Plugin details modal.
Also, improves accessibility of the star rating reviews links.

Fixes #35111.

git-svn-id: https://develop.svn.wordpress.org/trunk@36618 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:17:21 +00:00
Dominik Schilling (ocean90)
12cf07c669 Authentication: Allow users to log in using their email address.
Introduces `wp_authenticate_email_password()` which is hooked into `authenticate` after `wp_authenticate_username_password()`.

Props Denis-de-Bernardy, ericlewis, vhomenko, MikeHansenMe, swissspidy, ocean90.
Fixes #9568.

git-svn-id: https://develop.svn.wordpress.org/trunk@36617 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:14:27 +00:00
Mike Schroder
cde3d4c399 Media: Update unit tests after change to default image quality.
Updates unit tests to reflect new default quality setting of '82' after [36615].

See #33642.

git-svn-id: https://develop.svn.wordpress.org/trunk@36616 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:13:27 +00:00
Mike Schroder
c270654d2c Media: Reduce default image compression quality to '82'.
Changes default image compression quality from '90' to '82'.

This reduces generated image file sizes by ~25% while
keeping DSSIM < 0.0023, with both Imagick and GD.

Props @joemcgill, @dnewton.
See #33642.

git-svn-id: https://develop.svn.wordpress.org/trunk@36615 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 22:18:14 +00:00
Boone Gorges
408fb37f2b Allow get_terms() to fetch terms regardless of taxonomy.
`get_terms()` has historically required that a taxonomy be specified when
querying terms. This requirement is related to the fact that terms could
formerly be shared between taxonomies, making `$taxonomies` critical for
disambiguation. Since terms can no longer be shared as of 4.4, it'
s desirable to be able to query for terms regardless of what taxonomy they're in.

Because it's now optional to pass taxonomies, it's no longer necessary to have
`$taxonomies` as the first (and required) parameter for `get_terms()`. The new
function signature is `get_terms( $args )`, where 'taxonomy' can (optionally) be
passed as part of the `$args` array. This syntax is more consistent with
functions like `get_users()` and `get_posts()`.

We've maintained backward compatibility by always giving precedence to the old
argument format. If a second parameter is detected, or if it's detected that
the first parameter is a list of taxonomy names rather than an `$args` array,
`get_terms()` will parse the function arguments in the legacy fashion.

Props flixos90, swissspidy, DrewAPicture, boonebgorges.
Fixes #35495.

git-svn-id: https://develop.svn.wordpress.org/trunk@36614 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 22:16:37 +00:00
Eric Andrew Lewis
572578b8f1 Menus: Ensure backslashes are saved in menu item fields.
This was a regression introduced in [36510] which caused menu item fields to not save field content with backslashes in them.

Props westonruter.
See #14134.


git-svn-id: https://develop.svn.wordpress.org/trunk@36613 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 19:54:39 +00:00
Andrea Fercia
f306793b2c Accessibility: Remove the revisions limit warning from the Publish box.
After [36053] don't show a warning about something users can't change
because there's no control exposed in the UI for that. The Revisions
screen is probably a better place to show a more complete information.

Fixes #35029.

git-svn-id: https://develop.svn.wordpress.org/trunk@36612 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 16:22:53 +00:00
Weston Ruter
56598b5f90 Customize: Prevent PHP notice and JS error caused by widgets and nav menus components if user only has customize capability.
Short-circuits components from initializing their hooks needlessly if current user lacks required capability.

Fixes #35895.


git-svn-id: https://develop.svn.wordpress.org/trunk@36611 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 05:30:30 +00:00
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