Commit Graph

319 Commits

Author SHA1 Message Date
Pascal Birchler
25ca04b95f Docs: Improve readability of the default arguments of wp_list_categories().
Adds missing documentation for the `separator` argument introduced in [35140].

Props birgire for initial patch.
Fixes #34751.
Built from https://develop.svn.wordpress.org/trunk@36135


git-svn-id: http://core.svn.wordpress.org/trunk@36101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-31 11:30:27 +00:00
Drew Jaynes
05e0d7c3c3 Docs: Add missing parameter and return descriptions to the DocBlocks for _wp_object_name_sort_cb() and _wp_object_count_sort_cb(), both uasort() callbacks.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@36013


git-svn-id: http://core.svn.wordpress.org/trunk@35978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-18 23:38:26 +00:00
Boone Gorges
b2f4f73633 Ensure that wp_list_categories() supports comma-separated lists for 'exclude' and 'exclude_tree'.
[34696] introduced a regression whereby comma-separated values for 'exclude'
and 'exclude_tree' would be handled improperly when merging the two parameters,
resulting in category IDs being incorrectly dropped from the combined array.

Props gblsm, hnle.
Fixes #35156.
Built from https://develop.svn.wordpress.org/trunk@36005


git-svn-id: http://core.svn.wordpress.org/trunk@35970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-18 18:12:25 +00:00
Boone Gorges
20651de171 Introduce 'tag-link-position-x' class to tag cloud links.
The new class describes the cardinal position of a link in the cloud, allowing
more fine-grained CSS and JS targeting.

Props Mte90, chmac.
Fixes #5172.
Built from https://develop.svn.wordpress.org/trunk@35984


git-svn-id: http://core.svn.wordpress.org/trunk@35949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 16:27:28 +00:00
Boone Gorges
812060f940 Improve handling for WP_Error objects in get_the_terms().
`wp_get_object_terms()` can return a `WP_Error` object. As such, the
`get_the_terms()` cache wrapper should handle them properly. To wit:

* Don't try to map an error object to `get_term()`. Introduced in [35032].
* Don't cache an error object as taxonomy relationships. Introduced in at least [16487], maybe earlier.

Props stephenharris.
Fixes #34723.
Built from https://develop.svn.wordpress.org/trunk@35850


git-svn-id: http://core.svn.wordpress.org/trunk@35814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-10 03:35:27 +00:00
Sergey Biryukov
b8e250927f In wp_list_categories(), rewrite a long condition for clarity.
See #34363.
Built from https://develop.svn.wordpress.org/trunk@35293


git-svn-id: http://core.svn.wordpress.org/trunk@35259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 16:13:26 +00:00
Boone Gorges
b285b3002a Correct inline comment in wp_list_categories().
The fallback link for the 'All' option is 'page_for_posts', not
'page_on_front'. Introduced in [32292].

Props sudar, SergeyBiryukov.
Fixes #34363.
Built from https://develop.svn.wordpress.org/trunk@35291


git-svn-id: http://core.svn.wordpress.org/trunk@35257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 12:55:27 +00:00
Drew Jaynes
2e11f8cc16 Taxonomy: Improve deprecated argument strings for the 'link' type in get_categories() and wp_dropdown_categories().
Props swissspidy, gagan0123.
Fixes #34318.

Built from https://develop.svn.wordpress.org/trunk@35264


git-svn-id: http://core.svn.wordpress.org/trunk@35230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-18 15:35:24 +00:00
Scott Taylor
296671abcc Taxonomy: in wp_list_categories(), add an arg: separator, to allow the overriding of <br/>.
Props wojtek.szkutnik.
Fixes #9025.

Built from https://develop.svn.wordpress.org/trunk@35140


git-svn-id: http://core.svn.wordpress.org/trunk@35105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 17:02:25 +00:00
Boone Gorges
499d1b74ba 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.
Built from https://develop.svn.wordpress.org/trunk@35032


git-svn-id: http://core.svn.wordpress.org/trunk@34997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 15:13:48 +00:00
Boone Gorges
5b32e27a00 Fix 'exclude_tree' in wp_list_categories().
The 'exclude_tree' parameter must be compatible with 'hierarchical';
previously, 'hierarchical' canceled it out. This changeset also makes it so
that 'exclude_tree' is compatible with 'exclude'. When both are passed, and
'hierarchical' is true, the descendant trees of terms in both parameters will
be excluded from matched terms.

Props tott, webord, MikeHansenMe.
Fixes #12981.
Built from https://develop.svn.wordpress.org/trunk@34696


git-svn-id: http://core.svn.wordpress.org/trunk@34660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 19:12:27 +00:00
Boone Gorges
c243d7070e Introduce 'the_category_list' filter.
Used to filter categories as structured data, before building markup in
`get_the_category_list()`.

We use this filter in addition to upstream filters (such as
'get_the_categories'`) because those upstream filters are used in numerous
contexts, while `'the_category_list'` is always used for generating markup
for display.

Props KevinB, ericlewis, SergeyBiryukov, DrewAPicture.
Fixes #9227.
Built from https://develop.svn.wordpress.org/trunk@34625


git-svn-id: http://core.svn.wordpress.org/trunk@34589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-27 02:22:24 +00:00
Boone Gorges
1ae565455b Pass the post ID to the get_the_categories filter.
Props SergeyBiryukov.
See #9227.
Built from https://develop.svn.wordpress.org/trunk@34624


git-svn-id: http://core.svn.wordpress.org/trunk@34588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-27 02:17:25 +00:00
Drew Jaynes
6e350ff16e Docs: Clarify the file header summary and version for wp-includes/category-template.php.
See #33413. See #33701.

Built from https://develop.svn.wordpress.org/trunk@34420


git-svn-id: http://core.svn.wordpress.org/trunk@34384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 14:23:24 +00:00
Scott Taylor
172e37b007 Move Walker_Category and Walker_CategoryDropdown into their own files via svn cp. Remove them from category-template.php. Load them in category.php. svn cp category.php over to category-functions.php, which also loads now in category.php.
See #33413.

Built from https://develop.svn.wordpress.org/trunk@34110


git-svn-id: http://core.svn.wordpress.org/trunk@34078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 03:10:24 +00:00
Boone Gorges
7f5a8e6680 In wp_list_categories(), 'current_category' should accept an array of values.
This allows the 'current-cat' or 'current-cat-parent' classes to be applied
to more than one item in the list.

Props vilkatis.
Fixes #33565.
Built from https://develop.svn.wordpress.org/trunk@33804


git-svn-id: http://core.svn.wordpress.org/trunk@33772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-29 19:46:23 +00:00
Boone Gorges
8670349f70 Rename param added to wp_list_categories() in [33764] to 'hide_title_if_empty'.
Props vilkatis, DrewAPicture.
Fixes #33565.
Built from https://develop.svn.wordpress.org/trunk@33767


git-svn-id: http://core.svn.wordpress.org/trunk@33735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-27 02:09:21 +00:00
Boone Gorges
0db421e69b After [33764], fix docblock formatting for wp_list_categories().
See #33460.
Built from https://develop.svn.wordpress.org/trunk@33765


git-svn-id: http://core.svn.wordpress.org/trunk@33733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 19:43:24 +00:00
Boone Gorges
ccb9c641f4 Introduce hide_title_if_no_cats parameter to wp_list_categories().
When generating a `<ul>` using `wp_list_categories()`, a title `<li>` element
is put at the top of the term list. Current behavior is that this title `<li>`
appears even when no terms are found. The new `hide_title_if_no_cats` param
allows developers to specify that the title should be hidden when the term list
is empty.

Props vilkatis.
Fixes #33460.
Built from https://develop.svn.wordpress.org/trunk@33764


git-svn-id: http://core.svn.wordpress.org/trunk@33732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 19:42:21 +00:00
Boone Gorges
d031a79a3e Use proper array documentation formatting for wp_list_categories().
This changeset also corrects a few parameter descriptions, and adds a few that
were previously missing.

Fixes #33556.
Built from https://develop.svn.wordpress.org/trunk@33763


git-svn-id: http://core.svn.wordpress.org/trunk@33731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 15:30:21 +00:00
Boone Gorges
8b15f8be3d In Walker_CategoryDropdown::start_el(), cast values to strings before deciding whether to append 'selected' attribute.
As of [32484], `wp_dropdown_categories()` uses the `$value_field` value to
decide whether a given `<option>` should be 'selected'. However, `$value_field`
can refer to a value that is a string, such as a category's slug. This causes
problems when doing a loose comparison (`==`) with the value of the `'selected'`
parameter, which defaults to `0`, because when doing a loose comparison
between an integer and a string, PHP will cast the string to an integer. This
creates false matches, resulting in `<option>` elements getting a 'selected'
attribute incorrectly.

We address the issue by casting the comparison values to strings, and then
using the strict comparison operator `===`.

Fixes #33452 for trunk.
Built from https://develop.svn.wordpress.org/trunk@33681


git-svn-id: http://core.svn.wordpress.org/trunk@33648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-21 01:11:26 +00:00
Drew Jaynes
0729c70e03 Update the description for get_the_category() with helpful information for the proper function to use for custom taxonomies.
Also adds a missing return description.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@33318


git-svn-id: http://core.svn.wordpress.org/trunk@33290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-17 22:58:25 +00:00
Boone Gorges
a3d9af584c Introduce 'wp_generate_tag_cloud_data' filter.
This filter allows developers to modify the data that is used to create tag
clouds, without having to manipulate the tag cloud markup directly.

As part of the refactor, this changeset also adds a few unit tests for the way
`wp_generate_tag_cloud()` generates the 'title' attribute, as well as
improvements to output escaping.

Props flixos90, ysalame.
Fixes #24656.
Built from https://develop.svn.wordpress.org/trunk@32996


git-svn-id: http://core.svn.wordpress.org/trunk@32967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-29 14:16:26 +00:00
Scott Taylor
bd8fafea54 Use void instead of null where appropriate when pipe-delimiting @return types. If a @return only contains void, remove it.
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32568


git-svn-id: http://core.svn.wordpress.org/trunk@32538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-24 05:40:25 +00:00
Scott Taylor
082bfab426 Clean up @global doc blocks/imports for class-wp-customizer-*.php and friends.
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32542


git-svn-id: http://core.svn.wordpress.org/trunk@32512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 05:06:25 +00:00
Scott Taylor
27522d1c00 In category-template.php:
* Clarify/add some `return` docs.
* In `walk_category_tree()` and `walk_category_dropdown_tree()`, make behavior consistent and don't pass `$walker` by-reference - it is no longer necessary to do that with object instances.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32531


git-svn-id: http://core.svn.wordpress.org/trunk@32501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-21 21:05:24 +00:00
Boone Gorges
7314a0f3df In category dropdown, 'selected' should match against 'value_field'.
Props tlexcellent.
Fixes #32330.
Built from https://develop.svn.wordpress.org/trunk@32484


git-svn-id: http://core.svn.wordpress.org/trunk@32454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-11 13:11:31 +00:00
Boone Gorges
2699d8d989 In wp_list_categories(), 'All' link should point to post type archive if taxonomy is not registered for 'post' or 'page'.
Instead, we point to the post type archive of the first registered
object_type that supports archives.

Props stevegrunwell, hrishiv90, boonebgorges.
Fixes #21881.
Built from https://develop.svn.wordpress.org/trunk@32292


git-svn-id: http://core.svn.wordpress.org/trunk@32263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-24 14:57:28 +00:00
Drew Jaynes
1a2b9e6d15 Fix description alignment for the category_css_class filter docs.
See [31027]. See #31888.

Built from https://develop.svn.wordpress.org/trunk@32026


git-svn-id: http://core.svn.wordpress.org/trunk@32005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-05 14:49:27 +00:00
Boone Gorges
a7341b7c3f Use backticks when describing the value_field parameter, er, argument.
See [32020].
Built from https://develop.svn.wordpress.org/trunk@32021


git-svn-id: http://core.svn.wordpress.org/trunk@32000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 22:57:26 +00:00
Drew Jaynes
1d3bd0e8fe The value_field argument is an argument per core vernacular, not a parameter.
See [31006]. See #31888.

Built from https://develop.svn.wordpress.org/trunk@32020


git-svn-id: http://core.svn.wordpress.org/trunk@31999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 22:42:29 +00:00
Drew Jaynes
e5a5992e2c Update the DocBlock for wp_dropdown_categories() to reflect that the entire $args parameter array is optional instead of individual arugments.
See #30306.

Built from https://develop.svn.wordpress.org/trunk@31357


git-svn-id: http://core.svn.wordpress.org/trunk@31338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-06 09:04:22 +00:00
Scott Taylor
fe6b5983df In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.

To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.

`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.

Props markoheijnen, wonderboymusic.
Fixes #25672.

Built from https://develop.svn.wordpress.org/trunk@31188


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Boone Gorges
a374f9f092 Introduce 'category_css_classes' filter.
Paralleling the 'page_css_classes' filter, this allows developers to modify
the list of CSS classes used when creating category list markup via
`Walker_Category`.

Props sivel.
Fixes #16497.
Built from https://develop.svn.wordpress.org/trunk@31027


git-svn-id: http://core.svn.wordpress.org/trunk@31008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-03 02:31:22 +00:00
Boone Gorges
a0d1faa383 In Walker_Category, don't generate list elements for empty cat names.
This change allows the 'list_cats' filter to be used to suppress certain
items in category lists, without creating invalid or superfluous markup.

Props samo9789.
Fixes #16792.
Built from https://develop.svn.wordpress.org/trunk@31025


git-svn-id: http://core.svn.wordpress.org/trunk@31006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-03 02:05:22 +00:00
Boone Gorges
1b63ada83d Introduce 'name' parameter for get_terms().
This enhancement requires a modification in the way that `wp_dropdown_categories()`
prepares its arguments for `get_terms()`, so that its unrelated 'name' param is
not mistaken for the new 'name' argument in `get_terms()`.

Props danielbachhuber.
Fixes #30611.
Built from https://develop.svn.wordpress.org/trunk@31024


git-svn-id: http://core.svn.wordpress.org/trunk@31005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-02 21:34:23 +00:00
Boone Gorges
e99c00492b In wp_dropdown_categories(), allow the term field used to populate option valuesto be specified.
The new 'value_field' parameter makes it possible to set term slugs (or some
other term property) as the 'value' attribute of the option elements generated
by `wp_dropdown_categories()`. This additional flexibility reduces the effort
required to translate term_id to other term fields when processing form
submissions that include values from taxonomy dropdowns. See #30865 for a
use case.

Props collinsinternet.
Fixes #30306.
Built from https://develop.svn.wordpress.org/trunk@31006


git-svn-id: http://core.svn.wordpress.org/trunk@30987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-30 21:31:23 +00:00
Boone Gorges
4825bbcf31 Use proper hash notation for wp_dropdown_categories() docblock.
See #30306.
Built from https://develop.svn.wordpress.org/trunk@31005


git-svn-id: http://core.svn.wordpress.org/trunk@30986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-30 20:49:21 +00:00
Scott Taylor
5eb5afac34 For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@30982


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 22:47:22 +00:00
Scott Taylor
e619abda6e Improve various @param docs for src/wp-includes/*.
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30681


git-svn-id: http://core.svn.wordpress.org/trunk@30671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 01:34:24 +00:00
Drew Jaynes
bffe95d34c Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`

See #30552.

Built from https://develop.svn.wordpress.org/trunk@30656


git-svn-id: http://core.svn.wordpress.org/trunk@30646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 12:10:23 +00:00
Drew Jaynes
f8657d5890 Remove redundant and erroneous @uses tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

Built from https://develop.svn.wordpress.org/trunk@30105


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Sergey Biryukov
ecc0ba7fb4 Additional @return clarifications for get_the_terms(), get_the_tag_list(), and get_the_term_list().
see #29183.
Built from https://develop.svn.wordpress.org/trunk@29475


git-svn-id: http://core.svn.wordpress.org/trunk@29253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-12 23:48:16 +00:00
John Blackbourn
93c80ac896 Docblock corrections for get_the_terms() function and corresponding filter, and registered_taxonomy action. Fixes #29183.
Built from https://develop.svn.wordpress.org/trunk@29467


git-svn-id: http://core.svn.wordpress.org/trunk@29245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-11 21:17:17 +00:00
Scott Taylor
af860fbe84 Cleanup for switch statements:
* Move `default` to the bottom in `WP_Theme_Install_List_Table`
* `switch/endswitch` syntax is not supported in Hack. Switch to `switch (...) {  .... }` syntax. (A few template-type instances linger).

Fixes #28409.
See #27881.


Built from https://develop.svn.wordpress.org/trunk@28633


git-svn-id: http://core.svn.wordpress.org/trunk@28452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-30 17:58:15 +00:00
Sergey Biryukov
4782165279 Fix inversed logic in Walker_Category::start_el(). see [28359].
Correct 'use_desc_for_title' parameter description.

see #26557.
Built from https://develop.svn.wordpress.org/trunk@28572


git-svn-id: http://core.svn.wordpress.org/trunk@28397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-24 13:42:15 +00:00
Drew Jaynes
3e0521c2cf Add inline documentation for the option_none_value argument added to wp_dropdown_users|categories() in [28564].
Fixes #16625.

Built from https://develop.svn.wordpress.org/trunk@28570


git-svn-id: http://core.svn.wordpress.org/trunk@28395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-24 05:39:15 +00:00
Scott Taylor
53ea68e838 wp_dropdown_pages() allows option_none_value to be passed. Add that arg to the $defaults for wp_dropdown_users() and wp_dropdown_categories() as well.
Props solarissmoke. 
Fixes #16625.

Built from https://develop.svn.wordpress.org/trunk@28564


git-svn-id: http://core.svn.wordpress.org/trunk@28390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-23 20:47:15 +00:00
Scott Taylor
ddfb1e20d2 Add access modifiers to methods/members in Walker_Category and Walker_CategoryDropdown.
See #27881, #22234.

Built from https://develop.svn.wordpress.org/trunk@28504


git-svn-id: http://core.svn.wordpress.org/trunk@28330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 05:23:14 +00:00
Scott Taylor
72fd658cde In Walker_Category::start_el(), $title might not be set when $args are passed multiple levels into walk_category_tree().
See #22400.


Built from https://develop.svn.wordpress.org/trunk@28438


git-svn-id: http://core.svn.wordpress.org/trunk@28265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 19:14:14 +00:00
Scott Taylor
2b125a881b Eliminate use of extract() in Walker_Category::start_el().
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28436


git-svn-id: http://core.svn.wordpress.org/trunk@28263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 17:58:13 +00:00
Scott Taylor
9b210df2b9 Eliminate use of extract() in wp_generate_tag_cloud().
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28435


git-svn-id: http://core.svn.wordpress.org/trunk@28262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 17:48:15 +00:00
Scott Taylor
9c8becc1f7 Eliminate use of extract() in wp_list_categories().
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28434


git-svn-id: http://core.svn.wordpress.org/trunk@28261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 17:28:14 +00:00
Scott Taylor
b788832722 Eliminate use of extract() in wp_dropdown_categories().
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28432


git-svn-id: http://core.svn.wordpress.org/trunk@28259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 15:48:14 +00:00
Scott Taylor
9daf458ff0 Remove the title attribute from markup generated in wp-includes/category-template.php:
* `get_category_parents()`
* `get_the_category_list()`
* `wp_generate_tag_cloud()`
* `Walker_Category::start_el()`	

Props joedolson.
Fixes #26557.	


Built from https://develop.svn.wordpress.org/trunk@28359


git-svn-id: http://core.svn.wordpress.org/trunk@28187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-10 23:57:16 +00:00
Scott Taylor
c38cf4f912 Popular tags' edit links should respect the current post type. Adds unit test.
Props mordauk, fahmiadib.
Fixes #25566.


Built from https://develop.svn.wordpress.org/trunk@27720


git-svn-id: http://core.svn.wordpress.org/trunk@27558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 18:40:15 +00:00
Andrew Nacin
134ab31b5d Gracefully fail in wp_generate_tag_cloud() when emptiness is returned from the tag_cloud_sort filter.
props SergeyBiryukov.
fixes #27413.

Built from https://develop.svn.wordpress.org/trunk@27709


git-svn-id: http://core.svn.wordpress.org/trunk@27548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 13:00:15 +00:00
Andrew Nacin
bc6f50d09a Clarify the return value of wp_generate_tag_cloud().
props SergeyBiryukov, DrewAPicture.
fixes #27487.

Built from https://develop.svn.wordpress.org/trunk@27708


git-svn-id: http://core.svn.wordpress.org/trunk@27547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 12:56:14 +00:00
Drew Jaynes
3f494e00a3 Inline documentation for hooks in wp-includes/category-template.php.
Props kpdesign for the cleanup.
Fixes #27432.

Built from https://develop.svn.wordpress.org/trunk@27666


git-svn-id: http://core.svn.wordpress.org/trunk@27509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-24 01:35:15 +00:00
Scott Taylor
cd2e279d65 Avoid a notice in get_the_category_by_ID() when is_wp_error( $term ) is false but $term->name is not set. Clarify the @return value of get_category() and get_tag() which return the same possible types as get_term(), which they wrap.
Props ericmann, SergeyBiryukov.
Fixes #25429.


Built from https://develop.svn.wordpress.org/trunk@27521


git-svn-id: http://core.svn.wordpress.org/trunk@27364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-13 04:04:15 +00:00
Andrew Nacin
cfc20a5f64 Accept nooped plurals in wp_generate_tag_cloud() / wp_tag_cloud().
Renders topic_count_text_callback more or less obsolete. It can still be used, but passing a plural is easier.

fixes #27262. see #7989, #14424.

Built from https://develop.svn.wordpress.org/trunk@27376


git-svn-id: http://core.svn.wordpress.org/trunk@27225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 17:29:15 +00:00
Mark Jaquith
fb56a9942b Eliminate some of our last remaining create_function() instances
* Moved some into private function callbacks
* Eliminated some that weren't necessary anymore

props obenland, markjaquith, nacin. fixes #14424
Built from https://develop.svn.wordpress.org/trunk@27373


git-svn-id: http://core.svn.wordpress.org/trunk@27222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 16:21:16 +00:00
John Blackbourn
412ea898c0 Add some missing number i18n in Walker_Category and Walker_CategoryDropdown. Fixes #22745.
Built from https://develop.svn.wordpress.org/trunk@27329


git-svn-id: http://core.svn.wordpress.org/trunk@27181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-28 21:48:13 +00:00
Andrew Nacin
08a1d44ba5 Add arguments to the wp_dropdown_cats filter, and docs.
props olivM.
fixes #24103.

Built from https://develop.svn.wordpress.org/trunk@27065


git-svn-id: http://core.svn.wordpress.org/trunk@26938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-02 05:33:13 +00:00
Drew Jaynes
cd8cedc40d First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin.
Props JustinSainton, SergeyBiryukov, DrewAPicture.
Fixes #26713.

Built from https://develop.svn.wordpress.org/trunk@26868


git-svn-id: http://core.svn.wordpress.org/trunk@26754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-24 18:57:12 +00:00
Andrew Nacin
974625d962 wp_list_categories(): Add cat-item-none and cat-item-all classes to the none/all options.
props SergeyBiryukov.
fixes #24428.

Built from https://develop.svn.wordpress.org/trunk@26588


git-svn-id: http://core.svn.wordpress.org/trunk@26478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-03 20:51:19 +00:00
Andrew Nacin
73ee71a239 3.7 regression from [25119]: Have in_category() return false when the first argument is empty.
Adds unit tests.

props ericlewis.
fixes #25706 for trunk.

Built from https://develop.svn.wordpress.org/trunk@25923


git-svn-id: http://core.svn.wordpress.org/trunk@25882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-26 02:54:10 +00:00
Scott Taylor
6a5d2f8fb0 Rather than adding a taxonomy arg to get_category(), convert all uses of get_category() in core to get_term(). By doing so, we negate the need to call _make_cat_compat() in a few places that are only looking for a single property.
Fixes #8722.


Built from https://develop.svn.wordpress.org/trunk@25662


git-svn-id: http://core.svn.wordpress.org/trunk@25578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 19:59:10 +00:00
Drew Jaynes
c2111b33bf Inline documentation improvements for Walker_Category and Walker_CategoryDropdown.
Also covers previously undocumented parameters.

See #23406, #19249.

Built from https://develop.svn.wordpress.org/trunk@25641


git-svn-id: http://core.svn.wordpress.org/trunk@25558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-28 18:02:10 +00:00
Scott Taylor
d24a3940de Make sure the queried object is non-null before accessing its properties.
Props markoheijnen, ryan.
Fixes #21394.


Built from https://develop.svn.wordpress.org/trunk@25310


git-svn-id: http://core.svn.wordpress.org/trunk@25272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-10 02:28:11 +00:00
Sergey Biryukov
503f867e1d Make in_category() an alias of has_category(). fixes #16718.
Built from https://develop.svn.wordpress.org/trunk@25119


git-svn-id: http://core.svn.wordpress.org/trunk@25099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-24 22:54:10 +00:00
Sergey Biryukov
58c364947f PHPDoc fixes and additions. fixes #24616.
git-svn-id: http://core.svn.wordpress.org/trunk@24490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-21 12:45:11 +00:00
Sergey Biryukov
4b13a1ffa4 Fix E_STRICT notices in walkers. props dvarga. see #24356.
git-svn-id: http://core.svn.wordpress.org/trunk@24377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-28 03:29:15 +00:00
Andrew Nacin
18b07129c9 Pass the tag object instead of just the tag ID to topic_count_text_callback. see [23741]. see #21198.
git-svn-id: http://core.svn.wordpress.org/trunk@23888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-03 03:55:05 +00:00
Ryan Boren
1638f8f59e Pass tag ID and args array to topic_count_text_callback from wp_generate_tag_cloud().
Props najamelan, toscho
fixes #21198


git-svn-id: http://core.svn.wordpress.org/trunk@23741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-18 17:17:55 +00:00
Ryan Boren
a2edda4b6a Don't bail from get_the_terms() if the post type is not registed for the taxonomy. This can break back compat when add_post_type_support( 'page', 'post-formats' ) is called but register_taxonomy_for_object_type( 'postr_-format', 'page' ) is not.
Props SergeyBiryukov
fixes #22473


git-svn-id: http://core.svn.wordpress.org/trunk@22722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 18:31:06 +00:00
Andrew Nacin
3a8a6471e3 Check for WP_Error in get_the_category(). props batmoo. fixes #21155.
git-svn-id: http://core.svn.wordpress.org/trunk@22412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-06 23:47:14 +00:00
Ryan Boren
1f9d02abc6 Avoid 'Only variables should be assigned by reference' warning. Props wonderboymusic. see #21865
git-svn-id: http://core.svn.wordpress.org/trunk@22117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 18:37:43 +00:00
Ryan Boren
70edf4111b Fetch full terms for the post_category and tags_input queries and then wp_list_pluck() the desired fields. Fetching full terms primes the cache and reduces overall queries. Add cache invalidation to wp_set_post_terms(). Props scribu. see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-24 20:35:56 +00:00
Ryan Boren
cfb35a9d85 Use get_post() instead of global $post.
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.

Props nacin
see #21309


git-svn-id: http://core.svn.wordpress.org/trunk@21735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-04 16:29:28 +00:00
nacin
886ee992be Replace commas with periods when converting ratings float values to strings, to avoid issues with localized decimal points.
In these cases, we want a period because it is going to be used by CSS.

props SergeyBiryukov.
fixes #19593.



git-svn-id: http://core.svn.wordpress.org/trunk@20675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-01 22:09:55 +00:00
ryan
d744cbfb0c Escape term links output in category-template.php functions. Props SergeyBiryukov, solarissmoke, alex-ye. fixes #20106
git-svn-id: http://svn.automattic.com/wordpress/trunk@20656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-30 21:36:43 +00:00
nacin
dd8b4816fb Don't call get_the_category() in get_the_category_list() unless the post type supports categories. props niallkennedy. fixes #19671.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-27 19:23:57 +00:00
duck_
6d13f920fd Add $id parameter to get_the_tag_list() for consistency with get_the_(category|term)_list(). Props kawauso. Fixes #20072.
Also remove 'default' value of 0 for $id parameter in generic taxonomy functions
as it is a required parameter, and fix a notice when get_the_terms() is called
when $id = 0 and the $post global is not an object.


git-svn-id: http://svn.automattic.com/wordpress/trunk@20549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-20 10:06:05 +00:00
duck_
a395e06896 Reduce references to the $wp_rewrite global because it's no longer used or a wrapper function can be used instead. Fixes #14546.#14546.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-28 20:29:33 +00:00
duck_
0f26dd5fa8 Remove old show_last_update/include_last_update_time/show_date code from category template functions. Props solarissmoke. Fixes #19953.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-15 16:46:01 +00:00
ryan
e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
duck_
65b840b565 Fix mistakes in parameter documentation and add some missing param docs. See #19756.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-06 18:31:43 +00:00
ryan
616c35e71c One newline is enough.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:10:39 +00:00
ryan
fd1393ab7a Clear strict notices for the walkers. fixes #19249
git-svn-id: http://svn.automattic.com/wordpress/trunk@19679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-04 23:03:46 +00:00
ryan
bcc6275b3a Link show_option_all in wp_list_categories() to the posts page if one is set. Props solarissmoke. fixes #18610
git-svn-id: http://svn.automattic.com/wordpress/trunk@19273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-14 17:24:14 +00:00
nacin
008beac918 Make the sort-by-object-property functions generic. see #14424.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 17:20:34 +00:00
ryan
476b3d9a65 Use _wp_tag_cloud_count_sort_cb instead of an anonymous function. Props ocean90. see #14424
git-svn-id: http://svn.automattic.com/wordpress/trunk@18814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 17:09:04 +00:00
ryan
6665f90911 Fix notice in wp_tag_cloud. Props greuben. fixes #17213
git-svn-id: http://svn.automattic.com/wordpress/trunk@18326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-22 19:37:05 +00:00
nacin
2571545ec0 @since s/3.2/3.2.0/
git-svn-id: http://svn.automattic.com/wordpress/trunk@18268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-11 04:40:18 +00:00
ryan
4c1c3af0d6 Remove misleading phpdoc. Props mfields. fixes #17558
git-svn-id: http://svn.automattic.com/wordpress/trunk@18081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-31 15:54:48 +00:00
ryan
55c2425b3b Don't allow passing slugs to get_tag_link() and get_category_link(); they are too ambiguous. Restore WP_Error return to get_term_link(). fixes #16521 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-10 21:48:40 +00:00
ryan
6a8ff66305 Return empty strings instead of WP_Errro from get_category_link(), get_term_link(), and get_tag_link() when passed an invalid term. Clarify phpdoc. Props nacin. fixes #16521 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-10 20:17:54 +00:00
ryan
587ea006b5 Translations in title attributes require esc_attr().
git-svn-id: http://svn.automattic.com/wordpress/trunk@17102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-21 17:17:58 +00:00
ryan
3949ce12d0 Pink trailing whites.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-13 21:21:50 +00:00