Commit Graph

34502 Commits

Author SHA1 Message Date
Andrea Fercia d3f419c53c Accessibility: improve the color contrast in the Edit Comment "Status" box.
The current orange and red used for the radio button labels in the Edit Comment
"Status" box don't have a sufficient color contrast ratio with the background.
Removing the colors improves accessibility and consistency.

See #35659, #35622.
Fixes #36967.

git-svn-id: https://develop.svn.wordpress.org/trunk@37611 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 17:50:50 +00:00
Andrea Fercia 2e54e6cb85 Accessibility: match the visual and tab order in the Media Modal grid.
By moving the Details sidebar after the attachments grid, the tab order is
greatly improved for keyboard users and matches the logical and visual order.

Fixes #36909.

git-svn-id: https://develop.svn.wordpress.org/trunk@37610 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 17:38:04 +00:00
Boone Gorges 04d01a8eb4 Add tests demonstrating individual comment cache invalidation.
See #36906.

git-svn-id: https://develop.svn.wordpress.org/trunk@37609 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 17:15:27 +00:00
Boone Gorges 425fffeb4f Add tests demonstrating query cache invalidation on comment CRUD actions.
See #36909.

git-svn-id: https://develop.svn.wordpress.org/trunk@37608 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 16:59:16 +00:00
Rachel Baker 6655a8d48a Comments: Break the inline display of comment content urls on the Moderate Comment screen
Uses the CSS rule `word-break: break-all`.

Fixes #36568.

git-svn-id: https://develop.svn.wordpress.org/trunk@37607 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 16:04:53 +00:00
Ella Iseulde Van Dorpe aa6e844435 Editor: autoresize fixes for text
* Resize on backspace.
* Don't make it smaller than the minimum height.

Props azaozz, iseulde.

See #36482.



git-svn-id: https://develop.svn.wordpress.org/trunk@37603 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 10:23:17 +00:00
Gary Pendergast 0e8e778af9 Tests: Fix an incorrect `@ticket` header introduced in [37601].
See #32405, #36917.



git-svn-id: https://develop.svn.wordpress.org/trunk@37602 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 02:40:19 +00:00
Gary Pendergast bc975d28d4 Database: Split the logic of `wpdb::init_charset()` into a separate method.
The logic for determining the appropriate character set and collation to use is becoming more complex, particularly with the recent additions of [37522] and [37523]. As `init_charset()` has side effects, and makes use of constants instead of parameters, it's not possible to unit test this logic.

This commit splits the logic part of `init_charset()` out into a new method, `wpdb::determine_charset()`, along with appropriate unit tests.

See #32105, #37522.

Fixes #36917.



git-svn-id: https://develop.svn.wordpress.org/trunk@37601 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-01 02:37:20 +00:00
Boone Gorges 5fdf2b4b44 Add tests for `no_found_rows` behavior of `WP_Query`.
See #29952.

git-svn-id: https://develop.svn.wordpress.org/trunk@37600 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-31 19:28:46 +00:00
Boone Gorges 9b19a33952 Ensure that `get_terms()` can accept querystring-style arguments.
Prior to [37572], arguments passed to `get_terms()` were passed immediately
through `wp_parse_args()`, which made it possible to pass arguments as a
querystring (`hide_empty=0`) rather than an array
(`array( 'hide_empty' => false )`). [37572] moved default argument parsing
into `WP_Term_Query`, while assuming that arguments passed to `get_terms()`
would be formatted as an array.

To provide compatibility, we now parse all args passed to `get_terms()` into
an array before processing.

See #35381.

git-svn-id: https://develop.svn.wordpress.org/trunk@37599 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-31 12:53:27 +00:00
Dion Hulse dd472b7d2e Updates: Only use the filename component of URLs to form part of the temporary filename.
Previously we were passing the entire URL to `wp_tempnam()` (incorrectly) which caused the query string to be used as part of the temporary filename.
We now only use the file component of a url such as `https://example.com/filename.zip?arg1=1&arg2=2....&arg100=100` to prevent a long filename.

Fixes #34938


git-svn-id: https://develop.svn.wordpress.org/trunk@37598 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-31 02:20:58 +00:00
Andrew Ozz 37704c5cb8 TinyMCE: check if `wp.mce.views` exists before loading the wpview plugin. Fixes a js error when the rest of the media scripts are not loaded.
Fixes #36977.

git-svn-id: https://develop.svn.wordpress.org/trunk@37597 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 22:04:18 +00:00
Ella Iseulde Van Dorpe 9e9aeac12b Editor: better resizing for text editor
* Use `scrollHeight` to resize the text editor.
* Don't scroll the cursor into view when under the text editor's toolbar, it
  involves cloning the content which is quite slow.

Props iseulde, azaozz.

See #36482.



git-svn-id: https://develop.svn.wordpress.org/trunk@37596 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 20:31:57 +00:00
Boone Gorges 8f06d6678b Tests: Change some 'group' annotations to 'ticket'.
git-svn-id: https://develop.svn.wordpress.org/trunk@37595 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 04:37:57 +00:00
Boone Gorges cb5b8479f0 In `WP_Meta_Query`, don't cast `meta_value` to `CHAR`.
`CHAR` is redundant, since the `meta_value` column is `LONGTEXT`. Meanwhile,
use of `CAST()` causes MySQL to ignore any index that the administrator may
have added to the column.

A number of automated tests were doing searches for `CAST` in the SQL strings
generated by `WP_Meta_Query` (for reasons unrelated to the `CAST()` behavior).
These tests have been updated to expect the new query format.

Props ericlewis.
Fixes #36625.

git-svn-id: https://develop.svn.wordpress.org/trunk@37594 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 04:35:16 +00:00
Boone Gorges 23d0c953d2 Don't clear object relationship caches on term update.
Since [37573], object relationship caches (`{$taxonomy}_relationships`)
contain term IDs rather than term objects. See #36814. As such, it's no longer
necessary to clear these caches when a term is updated; none of the data that's
changed on update (name, description, count, etc) is stored in the relationship
cache.

Fixes #36251.

git-svn-id: https://develop.svn.wordpress.org/trunk@37593 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 04:10:16 +00:00
Drew Jaynes 8e79f0fb3d Docs: Ensure hook and duplicate hook docs directly precede all instances of the `image_memory_limit` filter.
Hook docs must directly precede hooks in order for the Code Reference parser to correctly identify them as such.

Fixes #36968. 


git-svn-id: https://develop.svn.wordpress.org/trunk@37592 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 02:13:57 +00:00
Drew Jaynes a66277f245 Docs: Correct a duplicate filter comment for the `image_memory_limit` hook to point to the correct file.
Props bobbingwide.
See #36968.


git-svn-id: https://develop.svn.wordpress.org/trunk@37591 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 02:09:46 +00:00
Tammie 5664f0d6ea Twenty Elevent Ephemera widget fix for caching in Customizer preview.
Fixes #36429. Props anneschmidt, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@37590 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-29 16:05:46 +00:00
Boone Gorges c96858b0f2 Allow term meta lazy-loading to be selectively disabled in `WP_Query`.
The process of lazy-loading can be resource intensive for object that have
terms in large numbers of taxonomies and are running a persistent object cache.
This new parameter allows the feature to be disabled in these cases.

Props DBrumbaugh10Up.
See #36953.

git-svn-id: https://develop.svn.wordpress.org/trunk@37589 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-28 03:09:09 +00:00
Aaron Jorbin 13350c95e4 Bootstrap/Load: Load plugin.php earlier in wp-settings.php
In order to allow non-web initializations of WordPress (such as through wp-cli) to modify things like the check for maintenance mode, plugins.php and the associated functions must be available much earlier. The use of these functions earlier than the loading of plugins is not recommended in most use cases.

Fixes #36819. See #34936.
Props jorbin, danielbachhuber for documentation.


git-svn-id: https://develop.svn.wordpress.org/trunk@37588 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 19:19:12 +00:00
Drew Jaynes e890bfae0d Docs: Improve documentation for `wp_generate_tag_cloud()` default arguments by formatting them into in a hash-notation.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37587 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:59:12 +00:00
Drew Jaynes 6695126f24 Docs: Improve formatting in the DocBlock for `sanitize_bookmark_field()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37586 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:15:58 +00:00
Drew Jaynes 1942855ada Docs: Standardizes and improves DocBlock summaries for the `__get()`, `__set()`, `__isset()`, and `__unset()` magic methods in `wpdb`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37585 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 17:11:47 +00:00
Rachel Baker 3ba3c42728 Comments: Display approved comments on the Edit Post screen to users without the `edit_comment` capability.
Matches logic in `wp_dashboard_recent_comments()` where we display approved comments regardless of the edit permission.

Props jfarthing84 for initial patch.
Fixes #24648. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37584 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 14:09:29 +00:00
Dominik Schilling (ocean90) 35a7acb459 Database: Normalize index definitions in `dbDelta()`.
`dbDelta()` compares the index definitions against the result of `SHOW INDEX FROM $table_name`. This requires a specific format so indices are not unnecessarily re-created. This format wasn't ensured, until now.

* Parse the raw index definition to extract the type, name and columns so a normalized definition can be built (#20263, #34873).
* Standardize on uppercase types (#34871) and on 'KEY'. 'INDEX' is only a synonym for 'KEY'.
* Escape index names with backticks (#20263).
* Normalize columns: Ignore ASC and DESC definitions (#34959), remove whitespaces (#34869) and escape column names with backticks (#20263).
* Add backticks to all index change queries (#20263).

Props ocean90, pento, kurtpayne.
Fixes #20263, #34869, #34871, #34873, #34959.

git-svn-id: https://develop.svn.wordpress.org/trunk@37583 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 11:56:20 +00:00
Peter Wilson 531ceb899e Customize: Run autoprefixer following [37476]
Adds prefixes to box-shadow and transition properties.

See #34893



git-svn-id: https://develop.svn.wordpress.org/trunk@37582 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 05:14:25 +00:00
Gary Pendergast c7f8735698 Setup: Sanity check for invalid table prefixes.
There are some table prefixes (for example, `7e1_`), which MySQL will try and parse as values when they're note quoted in backticks. Because not everything remembers to quote their table names, it's best if we just discourage their use during setup.

Fixes #36422.



git-svn-id: https://develop.svn.wordpress.org/trunk@37581 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-27 01:53:09 +00:00
Dominik Schilling (ocean90) ea970f17ad Plugins: Fix order of arguments for the `strpos()` function added in [37562].
See #36706.

git-svn-id: https://develop.svn.wordpress.org/trunk@37580 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 23:14:52 +00:00
Boone Gorges 2c7f879188 Add tests for `get_weekstartend()`.
Props pbearne, tloureiro.
Fixes #36415.

git-svn-id: https://develop.svn.wordpress.org/trunk@37579 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 15:47:52 +00:00
Drew Jaynes f4a4bb77f5 Docs: Remove unnecessary backtick-escaping around two function references in the DocBlock for `get_object_term_cache()`.
Known classes, methods, and functions are now auto-linked and formatted in the Code Reference. :-)

See [37573]. See #36814.


git-svn-id: https://develop.svn.wordpress.org/trunk@37578 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 15:21:45 +00:00
Drew Jaynes 08e8157d25 Docs: Link up a reference to the `get_terms_args` filter in the hook doc for `get_terms_defaults`.
See #35381. See #36921.


git-svn-id: https://develop.svn.wordpress.org/trunk@37577 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 15:16:26 +00:00
Boone Gorges e613d97234 Pass the proper values to `get_terms` action.
* `$term_query` should be passed.
* Second and third params should come from the `$term_query->query_vars` array, so that they're fully parsed.

These changes were missed in [37572].

Props flixos90, sebastian.pisula.
See #35381.
Fixes #36951.

git-svn-id: https://develop.svn.wordpress.org/trunk@37576 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 14:55:38 +00:00
Dominik Schilling (ocean90) 8119c1b473 Version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@37575 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 10:05:21 +00:00
Gary Pendergast a51a68fb75 Database: Add support for `SPATIAL` keys to `dbDelta()`.
`dbDelta()` already supported spatial fields (by virtue of not checking field types), so it's nice to round that out with spatial key support, too.

Fixes #36948.



git-svn-id: https://develop.svn.wordpress.org/trunk@37574 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:58:13 +00:00
Boone Gorges 96b71d7d89 Store only term IDs in object term relationships caches.
Previously, objects containing all data about a term were stored in each
object's term cache. Besides being wasteful, this approach caused invalidation
issues, as when a modified term count required a flush for all objects
belonging to the term.

Backward compatibility is maintained for plugins that continue to put object
data directly into the `{$taxonomy}_relationships` cache bucket.

Fixes #36814.

git-svn-id: https://develop.svn.wordpress.org/trunk@37573 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:49:10 +00:00
Boone Gorges 8b9bdaccd2 Introduce `WP_Term_Query` and use in `get_terms()`.
`WP_Term_Query` is modeled on existing query classes, such as those used
for comments and users. It provides a more consistent structure for generating
term queries, and should make it easier to add new functionality in the future.

Props flixos90, boonebgorges.
See #35381.

git-svn-id: https://develop.svn.wordpress.org/trunk@37572 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-26 04:32:30 +00:00
Drew Jaynes 0b56d3fd1b Docs: Reorder argument descriptions in the DocBlock for `wp_list_categories()` to match the default arguments list and improve reading at a glance.
Props birgire for the initial patch.
Fixes #36693.


git-svn-id: https://develop.svn.wordpress.org/trunk@37571 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:39:32 +00:00
Dominik Schilling (ocean90) 7878f8f9ea Upgrade: Allow update checks on `upgrader_process_complete` to be run during Ajax requests.
Fixes missing translation updates during shiny updates.

Fixes #36914.

git-svn-id: https://develop.svn.wordpress.org/trunk@37570 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:35:07 +00:00
Drew Jaynes 2b9ea8de78 Docs: Add missing documentation for the `style` argument in the DocBlock for `wp_list_categories()`.
Props birgire for the initial patch.
See #36693.


git-svn-id: https://develop.svn.wordpress.org/trunk@37569 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:34:41 +00:00
Drew Jaynes add75910c9 Docs: Add missing `@access` tags to methods in `WP_oEmbed_Controller`.
See [34903].

Props ramiy.
Fixes #36297.


git-svn-id: https://develop.svn.wordpress.org/trunk@37568 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 19:21:11 +00:00
Boone Gorges a378749df6 Fix termmeta pre-fetching in `wp_get_object_terms()`.
[34529] introduced logic intended to prime the termmeta cache for certain
values of the `fields` parameter. There were a few bugs:

* The `all_with_object_id` param was misspelled.
* `term_id` was used instead of `ids`.
* The values being passed to `update_termmeta_cache()` in the case where `fields=ids` was not correct.

All of these would result in a failure to pre-fetch termmeta in some cases.

Props dlh.
Fixes #36932.

git-svn-id: https://develop.svn.wordpress.org/trunk@37567 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:44:00 +00:00
Drew Jaynes c013727ebe Posts: Add test coverage for `get_preview_post_link()`.
Props swissspidy.
Fixes #35915.


git-svn-id: https://develop.svn.wordpress.org/trunk@37566 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:30:57 +00:00
Boone Gorges 1d3511ba8c In `get_bookmarks()`, don't cache if 'orderby=rand'.
Props lukecavanagh, prettyboymp, c3mdigital, MikeHansenMe.
Fixes #18356.

git-svn-id: https://develop.svn.wordpress.org/trunk@37565 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:29:01 +00:00
Drew Jaynes a27b379144 Docs: Update the return description for `get_preview_post_link()` to note that it can also return null.
Props chris_dev, swissspidy.
See #35915.


git-svn-id: https://develop.svn.wordpress.org/trunk@37564 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:24:33 +00:00
Boone Gorges ec53bf5bf6 Add tests for `get_bookmarks()` cache.
This changeset adds a unit test factory so that bookmark/link fixtures can be
created during tests.

Why are we writing tests for functionality that has been deprecated for years?
Because it's the Right Thing to Do.

See #18356.

git-svn-id: https://develop.svn.wordpress.org/trunk@37563 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 18:20:24 +00:00
Dominik Schilling (ocean90) a34e38513f Plugins: In `get_plugin_data()` use the plugin slug for the text domain when no text domain is defined in the header.
Fixes #36706.

git-svn-id: https://develop.svn.wordpress.org/trunk@37562 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:53:38 +00:00
Drew Jaynes ba9e51c4a5 Docs: Correct DocBlock descriptions for the `$before`, `$after`, `$link_before`, and `$link_after` arguments for `wp_nav_menu()`.
* `$before` falls before the link markup starts
* `$after` falls after the link markup ends
* `$link_before` falls before the link text
* `$link_after` falls after the link text

Props wp_smith for the initial patch.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@37561 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:16:45 +00:00
Drew Jaynes 32418ef8ed Docs: Standardize DocBlock summaries for hooks that serve to "print" something to use third-person singular verbs.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37560 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 16:04:37 +00:00
Ella Iseulde Van Dorpe 73e91b1ad3 TinyMCE: fix inline toolbar positioning
Introduced in [37000].
See 2fb8aa48e9.
See 5734a8d880.

Fixes #36876.



git-svn-id: https://develop.svn.wordpress.org/trunk@37559 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-25 15:12:28 +00:00