Commit Graph

32362 Commits

Author SHA1 Message Date
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
Sergey Biryukov 90f3849d62 Add `$id` parameter to `the_permalink()`, for consistency with `get_permalink()`.
Props johnjamesjacoby, chriscct7.
Fixes #23882.

git-svn-id: https://develop.svn.wordpress.org/trunk@34982 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 04:33:16 +00:00
Dion Hulse 5700c3e060 Use PHP7's `random_int()` CSPRNG functionality in `wp_rand()` with a fallback to the `random_compat` library for PHP 5.x.
`random_compat` offers a set of compatible functions for older versions of PHP, filling in the gap by using other PHP extensions when available.
We still include our existing `wp_rand()` functionality as a fallback for when no proper CSPRNG exists on the system.

Take Two, this was previously committed in [34922] but had an issue on PHP 5.2 which sarciszewski has now resolved.

Props sarciszewski
See #28633


git-svn-id: https://develop.svn.wordpress.org/trunk@34981 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 04:27:41 +00:00
Sergey Biryukov fc966fd45d Dashboard: Display year in Activity widget if the post date year is not the same as the current one.
Props GaryJ, chriscct7.
Fixes #26502.

git-svn-id: https://develop.svn.wordpress.org/trunk@34980 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 04:25:23 +00:00
Sergey Biryukov b39b5b8758 My Sites: Make "Create a New Site" link consistent with other "Add New" links.
Props JeffMatson.
Fixes #34179.

git-svn-id: https://develop.svn.wordpress.org/trunk@34979 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 03:49:24 +00:00
Sergey Biryukov fb6d5f4aba After [34529], if a compatible `termmeta` table is found on database upgrade, convert it to `utf8mb4` collation.
Props dboulet.
Fixes #34224.

git-svn-id: https://develop.svn.wordpress.org/trunk@34978 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 02:06:15 +00:00
Andrew Ozz 5a55add794 JS: in event callbacks replace the very outdated `return false` with `preventDefault()`.
Props adamsilverstein.
Fixes #18590.

git-svn-id: https://develop.svn.wordpress.org/trunk@34977 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 01:26:46 +00:00
Helen Hou-Sandi c010db6ae4 Revisions: Update slider handle styling.
This brings them in line with updated buttons as done in [34948] for #31459. It also gives it secondary action styling as opposed to primary, as restoring is considered the primary action.

props hugobaeta.
fixes #34220.


git-svn-id: https://develop.svn.wordpress.org/trunk@34976 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-09 00:24:36 +00:00
Drew Jaynes 654b633cb3 Docs: Add a missing `@since` version to the hook doc for the `the_excerpt_embed` filter, introduced in [34903].
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34975 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 23:24:28 +00:00
Drew Jaynes 85d0dfc45c Embeds: Rename the `$return` parameter in `wp_filter_oembed_result()` to `$result` to provide better context on what is being filtered.
See #32522.


git-svn-id: https://develop.svn.wordpress.org/trunk@34974 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 23:21:49 +00:00
John Blackbourn 8a7f8602b3 Remove HTML escaping for the plugin name and author fields that are displayed when deleting a plugin.
While it might seem counter-intuitive to remove HTML escaping, these fields are already safe (they originate in `_get_plugin_data_markup_translate()` which handles sanitization and escaping), and the AuthorName field actually allows some HTML. This change prevents escaped HTML from appearing here.

Fixes #25422


git-svn-id: https://develop.svn.wordpress.org/trunk@34973 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 23:13:00 +00:00
Drew Jaynes f2444857eb Embeds: Combine the `oembed_minwidth` and `oembed_maxwidth` filters into one, similar to how the existing `oembed_defaults` works for width and height.
See #32522. See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34972 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 23:08:40 +00:00
Drew Jaynes 7c300ef221 Docs: Add missing `@since` versions for the `oembed_minwidth` and `oembed_maxwidth` filters, introduced in [34903].
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34971 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:54:14 +00:00
Drew Jaynes 2585c20b35 Docs: Adjust third-person singular verbs in DocBlock summaries for oEmbed functions introduced in [34903].
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34970 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:49:27 +00:00
Drew Jaynes c959cb8b9b Embeds: Fix syntax on instantiating a new `WP_oEmbed_Controller` instance and cross-reference in the DocBlock for `wp_oembed_parse_query()`.
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34969 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:39:52 +00:00
Drew Jaynes bceea32c67 Docs: Adjust the summary for the `oembed_discovery_links` hook doc to mention that the filter is for HTML output.
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34968 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:38:10 +00:00
Drew Jaynes 43431fd8b3 Docs: Clarify the file header summary for wp-includes/embed-functions.php, and add missing parameter information for `wp_oembed_parse_query()`, introduced in [34903].
See #34227.


git-svn-id: https://develop.svn.wordpress.org/trunk@34967 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:37:03 +00:00
Drew Jaynes 39ff95f883 Embeds: If we're adding a boatload of new items to default-filters.php, might as well make them readable.
See #32522.


git-svn-id: https://develop.svn.wordpress.org/trunk@34966 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:30:51 +00:00
John Blackbourn bc043c51e8 Introduce the ability to filter the Users admin listing screen by users with no role, if such users exist.
Fixes #22993
Props spmlucas, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@34965 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:06:46 +00:00
Drew Jaynes 6fe7598cff Docs: Add a couple of strategically-placed spaces in `WP_Rewrite`.
Fixes #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34964 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 22:06:42 +00:00
John Blackbourn b02c884370 On the Users list table, show all the roles of a user in a comma-separated list if they have more than one role. This prevents role obfuscation in situations where a user has had more than one role programmatically assigned to them.
Fixes #22959
Props scribu, JustinSainton, DrewAPicture, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@34963 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:58:34 +00:00
Drew Jaynes e05fb68289 Docs: Mark the optional parameters for `WP_Rewrite::generate_rewrite_rules()` as such, and improve overall formatting.
Also brings in the list of acceptable constants for the `$ep_mask` parameter.

See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34962 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:48:25 +00:00
Jeremy Felt 0b9a437317 Make `$blog_id` explicitly global.
`$blog_id` is used in both single and multisite configurations as a global variable, though has never been explicitly marked as such in the global scope. This can cause confusion depending on how core is loaded.

Fixes #34217.


git-svn-id: https://develop.svn.wordpress.org/trunk@34961 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:44:11 +00:00
Drew Jaynes 61c3b3121f Docs: Convert the description for the optional `$args` parameter in `WP_Rewrite::add_permastruct()` into a hash notation.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34960 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:34:56 +00:00
Boone Gorges fa1e061dac `WP_User_Query` role improvement redux.
It's back, and it's better than ever: an overhaul of role-related arguments
in `WP_User_Query`. This updated version of the previously-reverted [34875]
includes support for the use of `$blog_id` without specifying a `$role`, for
a 99.7% reduced chance of breaking wordpress.org and other large sites.

Props boonebgorges, swissspidy.
Fixes #22212.

git-svn-id: https://develop.svn.wordpress.org/trunk@34959 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:27:04 +00:00
Drew Jaynes bf12d6abfb Docs: Improve more formatting and syntax for inline comments in `WP_Rewrite`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34958 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:23:31 +00:00
Drew Jaynes 694a56bc14 Docs: Add saner formatting and make readability improvements to a variety of inline comments in `WP_Rewrite` and `WP_Rewrite::generate_rewrite_rules()`.
See #34218.


git-svn-id: https://develop.svn.wordpress.org/trunk@34957 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:17:14 +00:00
Boone Gorges 3cc827ef5a Store SQL query string as a property on `WP_User_Query`.
In addition to better parity with other WP query classes, this also allows
testing of SQL strings, should anyone want to do something so foolish.

See #22212.

git-svn-id: https://develop.svn.wordpress.org/trunk@34956 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 21:05:50 +00:00
Sergey Biryukov b69797e8e8 Docs: Fix typo in [34944].
See #34218.

git-svn-id: https://develop.svn.wordpress.org/trunk@34955 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 20:59:46 +00:00
Scott Taylor 26aeb0f9bc After [34953], unbreak WordPress.
See [34930], #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34954 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 19:28:14 +00:00
Scott Taylor 7a6f53d917 HTTP/REST API: move `WP_HTTP_Response` to `wp-includes/` with the rest (ha!) of the HTTP classes. This is PHP 5.2, so this class is global, and as per @rmccue, unrelated to REST specifically.
See [34930], #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34953 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 19:26:44 +00:00
Drew Jaynes e215ca23f4 Docs: Normalize documentation spacing in the DocBlocks for `add_meta_box()` and `remove_meta_box()` following [34951].
Fixes #15000.


git-svn-id: https://develop.svn.wordpress.org/trunk@34952 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 19:12:25 +00:00
Drew Jaynes a6e9d49467 Administration: Add the ability to pass an array of screen IDs to `add_meta_box()` and `remove_meta_box()`.
The `$screen` parameter in both functions can now accept a single screen ID, `WP_Screen` object, or an array of screen IDs.

Adds tests.

Props coffee2code, iamfriendly, madalinungureanu, mordauk, igmoweb, meloniq, DrewAPicture.
See #15000.


git-svn-id: https://develop.svn.wordpress.org/trunk@34951 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 19:06:32 +00:00
Konstantin Obenland 7e923cc0fe Template: Add fallback for empty containers.
Since [14031] the container can be omitted in `wp_nav_menu()`. It can not
however in `wp_page_menu()`, which creates a conflict if it is set as
the fallback, Let's make sure there is always a valid container tag.

Fixes #33974.



git-svn-id: https://develop.svn.wordpress.org/trunk@34950 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 18:26:13 +00:00
Sergey Biryukov ab296be565 REST API: Add some missing documentation.
Props swissspidy.
Fixes #34215.

git-svn-id: https://develop.svn.wordpress.org/trunk@34949 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-08 18:00:45 +00:00