Commit Graph

32296 Commits

Author SHA1 Message Date
Boone Gorges ed4eee668e Don't cache `WP_Term` objects in `wp_get_object_cache()`.
The data stored in the cache should be raw database query results, not
`WP_Term` objects (which may be modified by plugins, and may contain additional
properties that shouldn't be cached).

If term relationships caches were handled in `wp_get_object_terms()` - where
a database query takes place - it would be straightforward to cache raw data.
See #34239. Since, in fact, `get_the_terms()` caches the value it gets from
`wp_get_object_terms()`, we need a technique that allows us to get raw data
from a `WP_Term` object. Mirroring `WP_User`, we introduce a `data` property
on term objects, which `get_the_terms()` uses to fetch cacheable term info.

Fixes #34262.

git-svn-id: https://develop.svn.wordpress.org/trunk@35032 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 15:12:29 +00:00
Boone Gorges be5065a3ad Be stricter about sanitizing values coming out of `WP_Term`.
Data passed into `get_instance()` should be run through `sanitize_term()`
before being used.

See #34262.

git-svn-id: https://develop.svn.wordpress.org/trunk@35031 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 15:12:22 +00:00
Boone Gorges e8b0d11989 Fix incorrect setup in 'tag' query var test.
The test, introduced in [33724], was intended to demonstrate the behavior of
`example.com?tag=foo` routing. But an error in the test setup meant that a
URL-encoded tag object was being set as the value of 'tag'. Due to a quirk in
the way that `parse_request()` parses query vars, an object value for 'tag'
would inadvertently produce correct results in certain cases. But it's not a
usage we actively support, and it's not what was meant to be tested.

See #33532, #34262.

git-svn-id: https://develop.svn.wordpress.org/trunk@35030 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 15:03:43 +00:00
Boone Gorges d632e2c4c1 After [35028], normalize `get_term_field()` doc formatting.
Fixes #34245.

git-svn-id: https://develop.svn.wordpress.org/trunk@35029 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 04:13:31 +00:00
Boone Gorges 8847a58443 Don't require a `$taxonomy` to be specified in `get_term_field()`.
After [34997], the `$taxonomy` parameter of `get_term()` is optional. This
changeset brings `get_term_field()` in line with the new usage.

Adds unit tests for `get_term_field()`.

Props DrewAPicture.
See #34245.

git-svn-id: https://develop.svn.wordpress.org/trunk@35028 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 04:13:25 +00:00
Drew Jaynes ff65d77908 Docs: Wrap a couple of hook name references in inline `@see` tags in the hook docs for `custom_menu_order` and `menu_order`.
Inline `@see` tags in the context of hooks are parsed as links to hook pages in the Code Reference.

See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@35027 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 03:38:11 +00:00
Jeremy Felt c8019610c8 MS: Reflect falsy values for `upload_space_check_disabled` in UI.
If the network option for `upload_space_check_disabled` is missing or an empty string, we should reflect how it will be treated elsewhere in the UI.

Props stephenharris.
Fixes #33986.


git-svn-id: https://develop.svn.wordpress.org/trunk@35026 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 00:00:28 +00:00
Jeremy Felt 3ee40d6652 MS: Reject truthy, non-numeric network ids in `_network_option()`.
A valid `$network_id` or `null`/`false` is expected as the first parameter for `_network_option()`. If something other than that is passed, we immediately return `false` rather than attempting to guess what network was intended.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@35025 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 23:29:55 +00:00
Jeremy Felt 55122c1538 MS: Adjust `_network_option()` parameter order, `$network_id` is first.
This better aligns with expectations and matches the structure used by `_blog_option()`. The `_site_option()` functions remain as an appropriate method for working with the current network.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@35024 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 22:43:59 +00:00
Drew Jaynes 16f56f4114 Media: Remove logic for unnecessarily overloading the `$content_width` global when passing default dimensions used to display the post thumbnail image in the 'Featured Image' meta box.
Updates documentation for the `$size` parameter in `admin_post_thumbnail_size` filter doc.

See #28512.


git-svn-id: https://develop.svn.wordpress.org/trunk@35023 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 17:09:33 +00:00
Drew Jaynes 4d98b99cc3 Media: Introduce the `admin_post_thumbnail_size` filter, which enables manipulation of the image size used to display the post thumbnail in the 'Featured Image' meta box.
This filter has no effect on the image size used to display post thumbnails on the front-end.

Props dboulet, DrewAPicture.
Fixes #28512.


git-svn-id: https://develop.svn.wordpress.org/trunk@35022 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 16:53:35 +00:00
Drew Jaynes bf0fa3a570 Docs: Fix some syntactical issues in property DocBlocks for `WP_List_Table`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@35021 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 03:33:50 +00:00
Andrew Ozz 9d8c320a38 Fix inconsistency in src/wp-includes/js/media/views/uploader/editor.js.
See #34251.


git-svn-id: https://develop.svn.wordpress.org/trunk@35020 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-11 00:08:48 +00:00
Andrew Ozz 0d6ea366c5 Plupload: update to 2.1.8. Changelog: https://github.com/moxiecode/plupload/releases.
Hide the editor uploader overlay on all drop events in the window, not only when dropping on the editor uploader element.


Fixes #34251, #22403.

git-svn-id: https://develop.svn.wordpress.org/trunk@35019 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 23:49:44 +00:00
Sergey Biryukov ddec8a1c2b Customizer: `WP_Customize_Cropped_Image_Control` should extend `WP_Customize_Image_Control`, since Site Icon can only an image.
Props paulwilde.
Fixes #34250.

git-svn-id: https://develop.svn.wordpress.org/trunk@35018 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 23:24:46 +00:00
Jeremy Felt d5e572f992 MS: Handle the possibility of 0 when checking a user's upload quota.
Upload space of 0 is now more possible via r35016 and should be respected rather than modified to a default of 10MB.

Fixes #34037.


git-svn-id: https://develop.svn.wordpress.org/trunk@35017 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 23:17:01 +00:00
Jeremy Felt d9edf86faf MS: Allow for a `blog_upload_space` setting of 0 to restrict uploads.
Previously, an value matching `empty()` would have been bypassed in favor of the default setting for 100MB.

Related #19538, r19639, r19652, where we saw the bug, fixed the bug, and then unfixed the bug so that it was not a surprise in a point release.

See #34037.


git-svn-id: https://develop.svn.wordpress.org/trunk@35016 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 23:14:11 +00:00
Andrea Fercia 52c2492afb Accessibility: bump headings one level up on the Appearance > Widgets screen for a better headings hierarchy.
Props mrahmadawais, afercia.
Fixes #33659.

git-svn-id: https://develop.svn.wordpress.org/trunk@35015 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 16:33:33 +00:00
Scott Taylor 5e85a8b55a Admin JS: after [34977], avoid variable names conflicts with `e`.
Props afercia.
Fixes #18590.


git-svn-id: https://develop.svn.wordpress.org/trunk@35014 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:49:56 +00:00
Scott Taylor c123726ba0 Docs: some `@global object` vernaculars should be converted to the actual object type.
See #33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@35013 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:44:16 +00:00
Scott Taylor 5200642cc5 Users List Table: after [35011], just use `wp_roles()`, no global import. #winning
See #22959.


git-svn-id: https://develop.svn.wordpress.org/trunk@35012 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:35:26 +00:00
Scott Taylor aa9b423cf4 Users List Table: after [34963], remove unused code/add doc for global import.
See #22959.


git-svn-id: https://develop.svn.wordpress.org/trunk@35011 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:25:08 +00:00
Scott Taylor b98303ae58 WP Screen: after [34991], avoid unnecessary nesting levels and remove unused global import.
See #33646.


git-svn-id: https://develop.svn.wordpress.org/trunk@35010 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:19:54 +00:00
Andrea Fercia e69aca18dc Accessibility: bump headings one level up on the Add Plugins screen for a better headings hierarchy.
Fixes #33818.

git-svn-id: https://develop.svn.wordpress.org/trunk@35009 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:16:04 +00:00
Sergey Biryukov 437bbeead5 Users: Remove redundant error message when password is only entered once.
"Please enter the same password in both password fields" should cover all the scenarios.

Props MikeHansenMe, jmayhak, desrosj, gounder.
Fixes #33101.

git-svn-id: https://develop.svn.wordpress.org/trunk@35008 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 13:21:30 +00:00
Weston Ruter e158ff27de Customizer: Fix scalability performance problem for previewing multidimensional settings.
As the number of multidimensional settings (serialized options and theme mods) increase for a given ID base (e.g. a widget of a certain type), the number of calls to the `multidimensional` methods on `WP_Customize_Setting` increase exponentially, and the time for the preview to refresh grows in time exponentially as well.

To improve performance, this change reduces the number of filters needed to preview the settings off of a multidimensional root from N to 1. This improves performance from `O(n^2)` to `O(n)`, but the linear increase is so low that the performance is essentially `O(1)` in comparison. This is achieved by introducing the concept of an "aggregated multidimensional" setting, where the root value of the multidimensional serialized setting value gets cached in a static array variable shared across all settings.

Also improves performance by only adding preview filters if there is actually a need to do so: there is no need to add a filter if there is an initial value and if there is no posted value for a given setting (if it is not dirty).

Fixes #32103.


git-svn-id: https://develop.svn.wordpress.org/trunk@35007 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 09:05:04 +00:00
Sergey Biryukov 975c16f4b2 Use `wp_star_rating()` on Add Themes screen:
* It works correctly for RTL
* Requires less CSS styling
* Is visually consistent with plugin ratings
* Is more accessible

Fixes #34080.

git-svn-id: https://develop.svn.wordpress.org/trunk@35006 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 06:50:35 +00:00
Sergey Biryukov 9487469f80 Add `echo` parameter for `wp_star_rating()`.
See #34080.

git-svn-id: https://develop.svn.wordpress.org/trunk@35005 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 06:42:19 +00:00
Drew Jaynes aacde02ed4 Docs: Fix some minor formatting in the `$query_args` parameter description for the `` filter doc.
See #8243. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@35004 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 06:38:24 +00:00
Drew Jaynes a521a4e7f6 Dashboard: Introduce the `dashboard_recent_drafts_query_args` filter, making it possible to manipulate the post query arguments used in the 'Recent Drafts' dashboard widget.
Props iamfriendly.
Fixes #8243.


git-svn-id: https://develop.svn.wordpress.org/trunk@35003 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 06:32:51 +00:00
Drew Jaynes 48ceecafc7 Template: Pass the `$post` parameter to the `the_permalink` filter.
Props chriscct7.
Fixes #34234. See #23882.


git-svn-id: https://develop.svn.wordpress.org/trunk@35002 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 05:45:27 +00:00
Drew Jaynes ed4b0aee3f Template: Rename the `$id` parameters in `the_permalink()`, `get_the_permalink()`, and `get_permalink()` to `$post`.
In all three cases, the functions can accept a post ID, a `WP_Post` object, or a falsey value, which defaults to the value of the global `$post`. Switching to `$post` in this context allows the parameters to better self-document and removes ambiguity in the code they are subsequently used in.

Props chriscct7 for the initial patch.
See #34234.


git-svn-id: https://develop.svn.wordpress.org/trunk@35001 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 05:40:14 +00:00
Sergey Biryukov fc9f0b229e Merge two database update strings for consistency.
Props pavelevap.
Fixes #33514.

git-svn-id: https://develop.svn.wordpress.org/trunk@35000 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 05:13:57 +00:00
Boone Gorges d6748bd2cb Return `WP_Post` objects from `wp_get_object_terms()`.
A side effect of this change is that terms stored in the cache no longer have
an `object_id` associated with them. Previously, `object_id` had always been
cached when the term cache was populated via `wp_get_object_terms()`, a
strategy that was mostly harmless but still incorrect.

See #14162.

git-svn-id: https://develop.svn.wordpress.org/trunk@34999 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 03:38:41 +00:00
Boone Gorges 797ddb60ba Return `WP_Term` objects from `get_terms()`.
Props boonebgorges, flixos90, DrewAPicture.
See #14162.

git-svn-id: https://develop.svn.wordpress.org/trunk@34998 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 02:12:40 +00:00
Boone Gorges 134a7af0fc Introduce `WP_Term`.
`get_term()` now returns a `WP_Term` object, instead of a `stdClass` object.
Cache support and sanitization filters for individual terms are now more
centralized. For example, `get_term_by()` is able to cast results of its query
to a `WP_Term` object by passing it through `get_term()`.

The `$taxonomy` parameter for `get_term()` is now optional, as terms ought to
be unique to a taxonomy (ie, shared terms no longer exist). In cases where
`get_term()` detects that the term matching the specified term_id is from the
wrong taxonomy, it checks to see if you've requested a shared term, and if so,
it splits the term. This is used only for fallback purposes.

The elimination of shared terms allows the caching strategy for terms to be
simplified. Individual terms are now cached in a single 'terms' bucket.

Props flixos90, boonebgorges, scribu, dipesh.kakadiya.
See #14162.

git-svn-id: https://develop.svn.wordpress.org/trunk@34997 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 01:58:37 +00:00
Jeremy Felt ecb75a16be MS: Show an error if a new site slug conflicts with an existing username.
Props utkarshpatel, dipesh.kakadiya.
Fixes #33804.


git-svn-id: https://develop.svn.wordpress.org/trunk@34996 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 01:41:43 +00:00
Drew Jaynes 1758d36a88 Template: Make it possible to both ''add'' and ''remove'' items from the page templates list using the `theme_page_templates` filter.
The `theme_page_templates` hook was originally added in [27297] as `page_templates`, and later renamed in [27470]. Previously, it was only possible to remove or rename page templates via this hook.

Fixes #13265. Fixes #25879.


git-svn-id: https://develop.svn.wordpress.org/trunk@34995 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 21:50:05 +00:00
Sergey Biryukov b374a081a9 Remove stray closing tag in `wp-admin/themes.php`.
Props tfrommen.
Fixes #34237.

git-svn-id: https://develop.svn.wordpress.org/trunk@34994 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 21:16:46 +00:00
Drew Jaynes f26526264a Docs: Fix wrapping and syntax for a multi-comment in `Walker_Comment::display_element()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34993 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 21:02:43 +00:00
Drew Jaynes 0d444dc6f9 Docs: Indent an example comment tree in the DocBlock for `Walker_Comment::display_element()` so it can be properly parsed in Markdown for the Code Reference.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34992 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 20:59:57 +00:00
Andrea Fercia 4b5f84295a Administration: Convert H5 usage in Screen Options to use fieldsets and legends.
These H5 (heading level 5) don't allow for a good headings hierarchy and shouldn't be headings in the first place. Each group of options has now its own fieldset and legend.
In `render_screen_options()`, introduce two new "render" methods: `render_meta_boxes_preferences()` and `render_list_table_columns_preferences()` for consistency with already existing render methods and cleaner code.

Props joedolson, afercia.
Fixes #33646.

git-svn-id: https://develop.svn.wordpress.org/trunk@34991 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 18:04:18 +00:00
Helen Hou-Sandi bb31c1ada8 Notices: Update one more instance of white-on-white.
Because the media modal can be used on the front-end, the CSS needs to be added here rather than using the notice classes.

props paulwilde.
fixes #32244.


git-svn-id: https://develop.svn.wordpress.org/trunk@34990 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 17:46:24 +00:00
Boone Gorges dc2b7c634d Ensure that `WP_Date_Query` accepts a value of `0` for 'hour'.
Props jim912.
Fixes #34228.

git-svn-id: https://develop.svn.wordpress.org/trunk@34989 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 16:32:59 +00:00
Sergey Biryukov eeea5d753a Fix typo in `get_avatar()` and `get_avatar_data()` docs.
Props johnjamesjacoby.
Fixes #34232.

git-svn-id: https://develop.svn.wordpress.org/trunk@34988 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 15:51:37 +00:00
Drew Jaynes ccfda7703c Install: Match existing tonal style in setup-config.php by converting strings containing 'do not' and 'does not' to instead use contractions.
The 'do not' is converted to "don't" because "you" is third-person plural, and 'does not' is converted to "doesn't" because `localhost` is third-person singular. While both are "negative" contractions, we often write this way in WordPress to provide a friendlier tone. That's your English grammar lesson for the day.

Props ankit-k-gupta, iamfriendly.
Fixes #30317.


git-svn-id: https://develop.svn.wordpress.org/trunk@34987 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 15:42:33 +00:00
Sergey Biryukov 873dacf4a4 Fix typo in `wp_rand()` docs.
See #28633.

git-svn-id: https://develop.svn.wordpress.org/trunk@34986 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 05:19:31 +00:00
Sergey Biryukov 724b83ab0e In `do_robots()`, allow crawling for `admin-ajax.php`, since it's often used on front-end.
Props dmchale, joostdevalk.
Fixes #33156.

git-svn-id: https://develop.svn.wordpress.org/trunk@34985 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 05:15:01 +00:00
Sergey Biryukov d58bcae1ad Media: Return early from `media_sideload_image()` if `$file` didn't match the pattern for images.
Props MikeHansenMe, serpent7776.
Fixes #32755.

git-svn-id: https://develop.svn.wordpress.org/trunk@34984 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 04:46:00 +00:00
Drew Jaynes 6350d90339 Tests: Add basic DocBlocks for four helper methods in general/template.php used to assist testing the Site Icon feature.
All four helpers were introduced in the feature merge for 4.3.

See #33968.


git-svn-id: https://develop.svn.wordpress.org/trunk@34983 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 04:34:29 +00:00