Commit Graph

193 Commits

Author SHA1 Message Date
Andrew Nacin ba7fb93e4e Check for WP_Error in get_the_category(). props batmoo. fixes #21155.
git-svn-id: https://develop.svn.wordpress.org/trunk@22412 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-06 23:47:14 +00:00
Ryan Boren 9d85e6b9d0 Avoid 'Only variables should be assigned by reference' warning. Props wonderboymusic. see #21865
git-svn-id: https://develop.svn.wordpress.org/trunk@22117 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-04 18:37:43 +00:00
Ryan Boren d9b4325db3 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: https://develop.svn.wordpress.org/trunk@21981 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-24 20:35:56 +00:00
Ryan Boren 31ec698423 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: https://develop.svn.wordpress.org/trunk@21735 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-04 16:29:28 +00:00
Andrew Nacin 869f8217ff 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: https://develop.svn.wordpress.org/trunk@20675 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-01 22:09:55 +00:00
Ryan Boren 267871e166 Escape term links output in category-template.php functions. Props SergeyBiryukov, solarissmoke, alex-ye. fixes #20106
git-svn-id: https://develop.svn.wordpress.org/trunk@20656 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-30 21:36:43 +00:00
Andrew Nacin a49867ae66 Don't call get_the_category() in get_the_category_list() unless the post type supports categories. props niallkennedy. fixes #19671.
git-svn-id: https://develop.svn.wordpress.org/trunk@20622 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-27 19:23:57 +00:00
Jon Cave e5e2528313 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: https://develop.svn.wordpress.org/trunk@20549 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-20 10:06:05 +00:00
Jon Cave cafa8dab24 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: https://develop.svn.wordpress.org/trunk@20023 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 20:29:33 +00:00
Jon Cave 3f8ae63a88 Remove old show_last_update/include_last_update_time/show_date code from category template functions. Props solarissmoke. Fixes #19953.
git-svn-id: https://develop.svn.wordpress.org/trunk@19927 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-15 16:46:01 +00:00
Ryan Boren 2b186b0c45 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: https://develop.svn.wordpress.org/trunk@19712 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-08 17:01:11 +00:00
Jon Cave 760471a9a8 Fix mistakes in parameter documentation and add some missing param docs. See #19756.
git-svn-id: https://develop.svn.wordpress.org/trunk@19702 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-06 18:31:43 +00:00
Ryan Boren 5e76729992 One newline is enough.
git-svn-id: https://develop.svn.wordpress.org/trunk@19684 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 20:10:39 +00:00
Ryan Boren c855c642ea Clear strict notices for the walkers. fixes #19249
git-svn-id: https://develop.svn.wordpress.org/trunk@19679 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-04 23:03:46 +00:00
Ryan Boren 2fae1d05ee Link show_option_all in wp_list_categories() to the posts page if one is set. Props solarissmoke. fixes #18610
git-svn-id: https://develop.svn.wordpress.org/trunk@19273 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-14 17:24:14 +00:00
Andrew Nacin d9b37f77c8 Make the sort-by-object-property functions generic. see #14424.
git-svn-id: https://develop.svn.wordpress.org/trunk@18815 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-29 17:20:34 +00:00
Ryan Boren 9ad9ff1282 Use _wp_tag_cloud_count_sort_cb instead of an anonymous function. Props ocean90. see #14424
git-svn-id: https://develop.svn.wordpress.org/trunk@18814 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-29 17:09:04 +00:00
Ryan Boren 6ca6c82d2b Fix notice in wp_tag_cloud. Props greuben. fixes #17213
git-svn-id: https://develop.svn.wordpress.org/trunk@18326 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-22 19:37:05 +00:00
Andrew Nacin a657a1986c @since s/3.2/3.2.0/
git-svn-id: https://develop.svn.wordpress.org/trunk@18268 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-11 04:40:18 +00:00
Ryan Boren 189a71cda7 Remove misleading phpdoc. Props mfields. fixes #17558
git-svn-id: https://develop.svn.wordpress.org/trunk@18081 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-31 15:54:48 +00:00
Ryan Boren a57952b5c9 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: https://develop.svn.wordpress.org/trunk@17443 602fd350-edb4-49c9-b593-d223f7449a82
2011-02-10 21:48:40 +00:00
Ryan Boren 81a1787248 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: https://develop.svn.wordpress.org/trunk@17437 602fd350-edb4-49c9-b593-d223f7449a82
2011-02-10 20:17:54 +00:00
Ryan Boren 34ef8c8df9 Translations in title attributes require esc_attr().
git-svn-id: https://develop.svn.wordpress.org/trunk@17102 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-21 17:17:58 +00:00
Ryan Boren 6dc2d07bc4 Pink trailing whites.
git-svn-id: https://develop.svn.wordpress.org/trunk@16900 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-13 21:21:50 +00:00
scribu b514837458 Re-index categories in get_the_category(). Props greuben. Fixes #15442
git-svn-id: https://develop.svn.wordpress.org/trunk@16888 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-12 20:32:29 +00:00
Ryan Boren 8ff8013fe7 Populate post term relationship cache in get_the_terms(). Restores caching lost when we moved away from get_the_category(). see #15407
git-svn-id: https://develop.svn.wordpress.org/trunk@16487 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-19 17:09:21 +00:00
Ryan Boren 0d0edecd79 Return false if empty cat passed. Restores old behavior.
git-svn-id: https://develop.svn.wordpress.org/trunk@16478 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-19 05:06:48 +00:00
Andrew Nacin ccea27cbe7 More param fixes, props duck_. see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@16469 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-18 19:12:48 +00:00
Andrew Nacin b9b0431d29 get_tag_link and get_category_link can also return WP_Error. fixes #15449.
git-svn-id: https://develop.svn.wordpress.org/trunk@16430 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 17:10:50 +00:00
Andrew Nacin 55f599d330 Properly force variable to an array. props Viper007Bond, fixes #15407.
git-svn-id: https://develop.svn.wordpress.org/trunk@16395 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-16 00:19:51 +00:00
Andrew Nacin 7f4e354bd1 Move cast to within array_keys to prevent warning when get_the_terms returns false. see #15407.
git-svn-id: https://develop.svn.wordpress.org/trunk@16343 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 15:32:20 +00:00
scribu a2dfe18dfd Add 'get_the_terms' filter. Props filosofo. Fixes #15410
git-svn-id: https://develop.svn.wordpress.org/trunk@16342 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 14:08:27 +00:00
Andrew Nacin 958d135e11 Escape the class arg in wp_list_categories. props hakre, fixes #11514.
git-svn-id: https://develop.svn.wordpress.org/trunk@16341 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 11:06:26 +00:00
Peter Westwood b08df21c26 Revert most of [16332] - renaming and deprecating a commonly used function is silly. Improving it is good. Fixes #15407.
git-svn-id: https://develop.svn.wordpress.org/trunk@16334 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 21:53:15 +00:00
scribu 11f20d737c Replace get_the_category() with get_the_categories(). Props filosofo. Fixes #15407
git-svn-id: https://develop.svn.wordpress.org/trunk@16332 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 20:05:37 +00:00
scribu 9f86bb7104 Don't use deprecated category properties. Props filosofo. Fixes #15408
git-svn-id: https://develop.svn.wordpress.org/trunk@16331 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 18:40:51 +00:00
Andrew Nacin f3a332a13c Typo fix. see #14424.
git-svn-id: https://develop.svn.wordpress.org/trunk@16317 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 07:04:34 +00:00
Andrew Nacin d8c91db1f4 Remove more create_function calls. props huichen, see #14424.
git-svn-id: https://develop.svn.wordpress.org/trunk@16313 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-11 22:50:36 +00:00
Ryan Boren 06513139e7 phpdoc fixes. Props hakre. fixes #12526
git-svn-id: https://develop.svn.wordpress.org/trunk@16307 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-11 17:02:14 +00:00
Andrew Nacin 07522b17d1 Confirm that the queried term object is of the requested taxonomy in wp_list_categories. fixes #15347.
git-svn-id: https://develop.svn.wordpress.org/trunk@16250 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-09 01:20:38 +00:00
scribu ef025261e7 Allow tag cloud using multiple taxonomies. Props sorich87. Fixes #15313
git-svn-id: https://develop.svn.wordpress.org/trunk@16180 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-04 10:45:14 +00:00
scribu b4988b968b use get_queried_object() wrappers throughout. See #14015
git-svn-id: https://develop.svn.wordpress.org/trunk@16114 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-31 11:02:17 +00:00
Andrew Nacin f9c7ac66ec Move Walker_Page* to post-template, Walker_Category* to category-template, and rm classes.php. see #10287.
git-svn-id: https://develop.svn.wordpress.org/trunk@16100 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-30 14:06:08 +00:00
scribu 5242abafb1 Make $id arg optional in the_terms(). Fixes #15160
git-svn-id: https://develop.svn.wordpress.org/trunk@15855 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 22:46:26 +00:00
scribu 3b3a5e8461 Correct dockblock for the_terms()
git-svn-id: https://develop.svn.wordpress.org/trunk@15854 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 22:41:34 +00:00
Andrew Nacin fb4e38b0e7 Pinking shears.
git-svn-id: https://develop.svn.wordpress.org/trunk@15843 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 07:48:22 +00:00
Dion Hulse d7b230ca26 Merge Category/Tag URL creation/rewriting into general Taxonomy system. Removes the legacy handling for these url's. See #12659
git-svn-id: https://develop.svn.wordpress.org/trunk@15825 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-17 05:41:22 +00:00
Ryan Boren 0cfb13ac25 has_term(). Props ptahdunbar. fixes #12526
git-svn-id: https://develop.svn.wordpress.org/trunk@15677 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-01 17:44:53 +00:00
Andrew Nacin 9494e4ce7e Phpdoc argument/@param cleanups. props duck_, see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@15590 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-07 11:21:11 +00:00
Dion Hulse 7efc4efdaa Alot more tabs. Props jacobsantos & Viper007bond. See #14147
git-svn-id: https://develop.svn.wordpress.org/trunk@15355 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-30 00:05:18 +00:00