Commit Graph

28862 Commits

Author SHA1 Message Date
Gary Pendergast be3c59e64c WPDB: Some character set tests were failing if `DB_CHARSET` was empty, or a non-utf8 character set.
git-svn-id: https://develop.svn.wordpress.org/trunk@31372 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-09 00:38:11 +00:00
Gary Pendergast afdd7da11b WPDB: When we're removing invalid text text from strings with multiple different character sets, `wpdb::strip_invalid_text()` wasn't correctly switching connection character sets.
Fixes #31262



git-svn-id: https://develop.svn.wordpress.org/trunk@31371 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-09 00:33:32 +00:00
Dominik Schilling (ocean90) 2518bbbb1f Customizer: Introduce an API to create WP_Customize_Settings for dynamically-created settings.
* Introduce WP_Customize_Manager::add_dynamic_settings() to register dynamically-created settings.
* Introduce `customize_dynamic_setting_args` filter to pass an array of args to a dynamic setting's constructor.
* Add unit tests for WP_Customize_Manager and WP_Customize_Widgets.
* See WP_Customize_Widgets as an example.

props westonruter.
fixes #30936.

git-svn-id: https://develop.svn.wordpress.org/trunk@31370 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-08 23:10:05 +00:00
Boone Gorges 76b84b9231 Add `orderby=meta_value_num` support to `WP_User_Query`.
Props tyxla, genkisan.
Fixes #27887.

git-svn-id: https://develop.svn.wordpress.org/trunk@31369 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-08 16:58:14 +00:00
Sergey Biryukov ad90613648 Use a positive wording for translations update notice.
props DrewAPicture, siobhan, netweb.
fixes #28199.

git-svn-id: https://develop.svn.wordpress.org/trunk@31368 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-08 04:08:50 +00:00
Boone Gorges b121105f26 Late escaping in `get_terms()` and `WP_Tax_Query`.
Props vortfu, dd32.

git-svn-id: https://develop.svn.wordpress.org/trunk@31367 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-08 01:58:51 +00:00
Boone Gorges bdda122e7f In `WP_Query::get_queried_object()`, avoid PHP notices when `is_tax` is paired with an empty `tax_query`.
It's possible to have an empty `tax_query` and `is_tax=true` when the initial
query contains a taxonomy var (and is processed as such during
`WP_Query::parse_query()`) but the taxonomy var is unset during a 'parse_query'
callback. While this kind of behavior is not necessarily something we need to
support, we should continue to avoid PHP notices in such cases, as we did prior
to WP 4.1.

Fixes #31246.

git-svn-id: https://develop.svn.wordpress.org/trunk@31366 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-07 19:49:17 +00:00
Sergey Biryukov fa1a382dff Remove unnecessary `array_shift()` usage in `get_terms()` for better performance.
props bswatson, VolodymyrC.
fixes #31182.

git-svn-id: https://develop.svn.wordpress.org/trunk@31365 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-07 19:44:13 +00:00
Sergey Biryukov 692f79087f In `_wp_menu_output()`, `$submenu_items` is an array and should be initialized as such.
props ipm-frommen.
fixes #31257.

git-svn-id: https://develop.svn.wordpress.org/trunk@31364 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-07 17:56:18 +00:00
Sergey Biryukov 8aac5ba74e Avoid inadvertent stomping of the original `$args` parameter passed to `plugins_api_result` and `themes_api_result` filters in `plugins_api()` and `themes_api()`, respectively.
Fixes a regression introduced in [25956].

props Corphi, obenland.
fixes #29079.

git-svn-id: https://develop.svn.wordpress.org/trunk@31363 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-07 06:20:42 +00:00
Andrew Ozz 24a33d8181 TinyMCE: ensure the image toolbar stays visible when the image is much wider than the editor. Props iseulde, fixes #20696 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@31362 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 22:59:35 +00:00
Andrew Ozz 329115bf05 Editor: prevent errors in editor-expand when the Text editor is not used. Props iseulde, fixes #31163.
git-svn-id: https://develop.svn.wordpress.org/trunk@31361 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 22:24:43 +00:00
Dominik Schilling (ocean90) 1b6e82cf98 Customizer: Add changelog entry for the 'default' parameter added in [31329].
props westonruter.
see #30988.

git-svn-id: https://develop.svn.wordpress.org/trunk@31360 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 21:13:50 +00:00
Boone Gorges fb4048fcdd Parse non-hierarchical tag input into term IDs before sending to `wp_insert_post()`.
When editing a post, non-hierarchical taxonomy terms are sent as the
comma-separated list entered into the tax_input metabox. Passing these
values directly to `wp_update_post()` meant that they were interpreted as
term slugs rather than term names, causing mismatches when a typed string
matched the slug of one term and the name of a different term. We fix the
problem by preprocessing tax_input data sent from post.php, converting it to
unambiguous term_ids before saving.

Props boonebgorges, ArminBraun.
Fixes #30615.

git-svn-id: https://develop.svn.wordpress.org/trunk@31359 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 20:31:37 +00:00
Gary Pendergast 8f02177c40 Upgrades: wp_usermeta is a global table in multisite, so it should only be upgraded by the single site routines when we're not in a multisite install.
See #21212



git-svn-id: https://develop.svn.wordpress.org/trunk@31358 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 13:40:17 +00:00
Drew Jaynes 88b0b7d9da Update the DocBlock for `wp_dropdown_categories()` to reflect that the entire `$args` parameter array is optional instead of individual arugments.
See #30306.


git-svn-id: https://develop.svn.wordpress.org/trunk@31357 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 09:03:26 +00:00
Drew Jaynes 475337bd97 Adjust the DocBlock for `wp_dropdown_pages()` to mark the entire `$args` parameter array as optional instead of each individual argument.
See #12494.


git-svn-id: https://develop.svn.wordpress.org/trunk@31356 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 08:55:52 +00:00
Drew Jaynes 53209f19b3 Add documentation for the `$value_field` argument added to `wp_dropdown_pages()` in [31338].
See #12494.


git-svn-id: https://develop.svn.wordpress.org/trunk@31355 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 08:50:20 +00:00
Gary Pendergast 029f637aa5 Upgrades: When upgrading a table to utf8mb4, we should run the `ALTER TABLE` query, even if it doesn't have any text columns. This will update the table's default character set, so that any text columns added in the future will have the expected character set.
See #21212 



git-svn-id: https://develop.svn.wordpress.org/trunk@31354 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 05:58:15 +00:00
Aaron Jorbin 0b5e8a1702 Travis hates tabs.
Related [31352]

see #30755


git-svn-id: https://develop.svn.wordpress.org/trunk@31353 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 05:57:54 +00:00
Aaron Jorbin b42b3b7c14 Update Travis-ci Slack notification token
see #30755



git-svn-id: https://develop.svn.wordpress.org/trunk@31352 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 05:51:58 +00:00
Gary Pendergast 8004484a6b Upgrades: When deciding if we can upgrade a table to utf8mb4, make sure we're checking the character set, not the collation.
Bump the DB version as well, as the update in [31349] wouldn't have triggered for anyone who tried it.

See #21212



git-svn-id: https://develop.svn.wordpress.org/trunk@31351 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 05:25:22 +00:00
Aaron Jorbin 6a100e472f Temporarily (I hope) remove PHP 5.2 from tests being run on travis-ci
Travis-ci has disabled PHP 5.2. This has happened before when 5.2 didn't compile and then was restored when that was fixed.

upstream: https://github.com/travis-ci/travis-ci/issues/3152
related: https://github.com/WP-API/WP-API/issues/846

See #31244.



git-svn-id: https://develop.svn.wordpress.org/trunk@31350 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 05:13:37 +00:00
Gary Pendergast 9f6ddf8944 WPDB: If a site is using the `utf8` charset, and their version of MySQL supports `utf8mb4`, auto-upgrade them to `utf8mb4`.
This patch also resizes some indexes, to allow for the 767 byte index size limit in standard MySQL installs.

See #21212



git-svn-id: https://develop.svn.wordpress.org/trunk@31349 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 04:50:19 +00:00
Andrew Nacin 43789f822a Remove leading space from the definition of a global cache group.
This only applied in a rare situation during the switch_to_blog() process where no global groups were currently defined.

see #31243.


git-svn-id: https://develop.svn.wordpress.org/trunk@31348 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 03:25:32 +00:00
Andrew Nacin 30e57104e6 Add useremail and userslugs as global cache groups. fixes #31243.
git-svn-id: https://develop.svn.wordpress.org/trunk@31347 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 03:23:46 +00:00
Boone Gorges 41db99c31a Use field-specific sanitization in `WP_Tax_Query::transform_query()`.
When terms are entered into the database, term fields are sanitized with
`sanitize_term_field()`. To ensure that the `SELECT ... WHERE` queries in
`WP_Tax_Query::transform_query()` are not broken by overzealous sanitization,
`sanitize_term_field()` should be used in that case as well. This fixes a bug
where a tax_query using 'field=name' would fail if the 'terms' parameter
contained characters (like spaces) that were improperly removed by
`sanitize_title_for_query()`.

Fixes #27810.

git-svn-id: https://develop.svn.wordpress.org/trunk@31346 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 02:01:24 +00:00
Gary Pendergast ba2beaf37d Shiny Updates: Fix a PHP warning when installing new plugins.
Props lgladdy for the initial patch.

See #29820



git-svn-id: https://develop.svn.wordpress.org/trunk@31345 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 00:33:49 +00:00
boonebgorges 77aebc6d71 Use minified jquery-ui-core file during qunit:compiled Grunt task.
[30989] made jQuery UI Core a dependency for QUnit tests. This change did not
account for the fact that jQuery JS assets are minimized (and non-minimized
versions unavailable) when `grunt copy` populates the `/build` directory. To
ensure that QUnit tests pass when run during `grunt qunit:compiled`, we
manually fix the asset path to read 'core.min.js'.

See #25781.

git-svn-id: https://develop.svn.wordpress.org/trunk@31344 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 20:35:02 +00:00
Helen Hou-Sandi cdbea14c09 MCE views: Always refresh the view after updating a gallery.
This allows things like caption changes to be synced, as they are tied to the attachment and not the shortcode.

props iseulde.
fixes #31239.


git-svn-id: https://develop.svn.wordpress.org/trunk@31343 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 20:11:04 +00:00
Boone Gorges 90947c2c45 Another array syntax fix for Customizer tests.
See [31339], #30988.

git-svn-id: https://develop.svn.wordpress.org/trunk@31342 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:54:06 +00:00
Boone Gorges cc6ef67db7 jshint fixes for shiny updates JS.
As introduced in [31333].

Props iseulde.
See #29820.

git-svn-id: https://develop.svn.wordpress.org/trunk@31341 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:51:42 +00:00
Boone Gorges 0f28011bcf Modify `meta_query orderby syntax to use array keys as clause "handles".
The implementation of `meta_query` orderby introduced in [31312] put clause
identifiers into a 'name' parameter of the clause. For greater clarity, this
changeset updates the syntax to use the associative array key used when
defining `meta_query` parameters, instead of the 'name' parameter.

Props Funkatronic, DrewAPicture.
Fixes #31045.

git-svn-id: https://develop.svn.wordpress.org/trunk@31340 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:37:47 +00:00
Boone Gorges 9d72e1c6a2 Use temporary variable for array in `Tests_Customize_Setting::test_preview_standard_types_multidimensional()`.
The syntax previously used - `call_user_func( 'foo' )['bar']`, where `foo()`
returns an array - is not valid on all supported versions of PHP, and was
breaking the CI builds.

See #30988.

git-svn-id: https://develop.svn.wordpress.org/trunk@31339 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:18:16 +00:00
Boone Gorges c9c9af5df8 Introduce `'value_field'` parameter to `wp_dropdown_pages()`.
This parameter allows developers to choose the post field that will be used to
fill in the 'option' attribute of the generated dropdown markup.

See [31006] #30306 for a parallel enhancement in `wp_dropdown_categories()`.

Props jfarthing84.
Fixes #12494.

git-svn-id: https://develop.svn.wordpress.org/trunk@31338 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:03:52 +00:00
Boone Gorges a710c0451c Use hash notation for `wp_dropdown_pages()` argument documentation.
git-svn-id: https://develop.svn.wordpress.org/trunk@31337 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 18:59:22 +00:00
Drew Jaynes ffb4ec93b8 Clarify inline documentation for `WP_Date_Query` to better explain the relationship between an individual clause's 'compare' argument and various integer-based date arguments.
If the 'compare' argument equals 'IN' or 'NOT IN', arrays of any number of specific, valid values are accepted and simply considered based on the value of 'operator' (OR or AND). If the 'compare' argument is a range such as 'BETWEEN' or 'NOT BETWEEN', arrays of only two valid values are accepted.
 
Props boonebgorges.
Fixes #31036.


git-svn-id: https://develop.svn.wordpress.org/trunk@31336 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 06:16:35 +00:00
Gary Pendergast 4c49dd62e3 Shiny Updates: If the current user is not allowed to install/update plugins, we should return a JSON error, so it can be used by the JS handlers.
See #29820



git-svn-id: https://develop.svn.wordpress.org/trunk@31335 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 06:15:59 +00:00
Gary Pendergast d0379f4fb7 Shiny Updates: Add capability checks to the ajax callbacks, to ensure the current user is allowed to install/update plugins.
See #29820



git-svn-id: https://develop.svn.wordpress.org/trunk@31334 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 06:04:32 +00:00
Gary Pendergast 748d595b5c Shiny Updates: Add ajax-y updates to the plugin list page, and ajax-y updates and installs to the plugin card page.
This also includes JS architecture that can be expanded to support theme, core and language pack updates.

Props pento, ericlewis, lgladdy, adamsilverstein, DrewAPicture

See #29820



git-svn-id: https://develop.svn.wordpress.org/trunk@31333 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 04:18:57 +00:00
Andrew Ozz f205eb63d0 Fix displaying long tag names in the Tags postbox. Props trishasalas, carolinegeven, iseulde. Fixes #18946.
git-svn-id: https://develop.svn.wordpress.org/trunk@31332 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-04 22:14:31 +00:00
Helen Hou-Sandi 8d0b774e65 Accessibility: remove remaining instances of accesskey.
It is a poorly implemented browser feature, not particularly discoverable, and causes more problems than it helps solve.

props afercia.
fixes #29715.


git-svn-id: https://develop.svn.wordpress.org/trunk@31331 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-04 03:45:24 +00:00
Helen Hou-Sandi fe32344314 Themes: Allow version number in the overlay to be selected.
props johneckman.
fixes #31205.


git-svn-id: https://develop.svn.wordpress.org/trunk@31330 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 15:14:59 +00:00
Dominik Schilling (ocean90) 8bc9ad756d Ensure that `WP_Customize_Setting::value()` returns default value for setting if not dirty.
There was regression introduced by #28580 where only changed (dirty) settings now are POST'ed to the Customizer preview.

* Allow WP_Customize_Manager::post_value() to accept a second $default argument.
* Introduce WP_Customize_Manager::unsanitized_post_values() for accessing previously-private member variable _post_values.
* Do require_once instead of require for Customizer classes.
* Add unit tests for WP_Customize_Manager and WP_Customize_Setting.

props westonruter.
fixes #30988.

git-svn-id: https://develop.svn.wordpress.org/trunk@31329 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 10:14:28 +00:00
Dion Hulse 5811dcbcd6 Remove an extra indent from most of media-new.php.
git-svn-id: https://develop.svn.wordpress.org/trunk@31328 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 07:46:21 +00:00
Dion Hulse 4ed2d89ced WP_Upgrader: Remove references to non-existant variables that have never existed.
Props jdgrimes. Fixes  #29087


git-svn-id: https://develop.svn.wordpress.org/trunk@31327 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 06:17:05 +00:00
dd32 5f13a0e3e5 Remove an unused parameter on install_plugins_upload().
Props michalzuber. Fixes #28964


git-svn-id: https://develop.svn.wordpress.org/trunk@31326 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 06:13:02 +00:00
Sergey Biryukov 4aada86274 Add `'widget_nav_menu_args'` filter for Custom Menu widget arguments.
props cyman, DrewAPicture.
fixes #29463.

git-svn-id: https://develop.svn.wordpress.org/trunk@31325 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 02:55:21 +00:00
Sergey Biryukov 5e9b89bf59 When using WP_Query's `'fields' => 'ids'` (or `'fields' => 'id=>parent'`), make sure the returned result is always an array of integers.
fixes #31194. see #27252.

git-svn-id: https://develop.svn.wordpress.org/trunk@31324 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-03 02:28:52 +00:00
Boone Gorges f05f380638 In `get_sample_permalink()`, override 'future' status before generating permalink.
In [31114], `get_permalink()` was modified to prevent pretty permalinks from
being generated for posts with the 'future' post status. This inadvertently
broke the pretty permalink preview for scheduled posts. The fix is to include
the 'future' status in the list of statuses that `get_sample_permalink()` fakes
as 'publish' before it fetches a permalink.

Props DrewAPicture.
Fixes #30910.

git-svn-id: https://develop.svn.wordpress.org/trunk@31323 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-02 16:49:23 +00:00