WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#43002 new defect (bug)

Can't order tag cloud by tag_cloud_sort filter

Reported by: yuetyeelo2855 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Taxonomy Keywords: reporter-feedback
Focuses: Cc:

Description

I can't re-order tags by tag_cloud_sort filter, because the order is same with id order.

Change History (2)

#1 follow-up: @birgire
6 months ago

  • Keywords reporter-feedback added

@yuetyeelo2855 Welcome to WordPress trac.

Can you please extend the bug report,

e.g. with an example so it can easily be reproduced and verified.

Thanks.

#2 in reply to: ↑ 1 @yuetyeelo2855
6 months ago

Replying to birgire:

@yuetyeelo2855 Welcome to WordPress trac.

Can you please extend the bug report,

e.g. with an example so it can easily be reproduced and verified.

Thanks.

It is no common case, If the user create tag like

tag1[id=1], tag2[id=2], tag3[id=3]

want the tage order like

tag1[id=1, post_count=5], tag2[id=2, post_count=20], tag3[id=3, post_count=10]

so using WordPress filter tag_cloud_sort to order by extra column tag_order

tag1[id=1, tag_order=1], tag2[id=2, tag_order=2], tag3[id=3, tag_order=3]

but the order will not work. it will follow the post count.

ASC: tag1[id=1, post_count=5], tag3[id=3, post_count=10], tag2[id=2, post_count=20]

DESC: tag2[id=2, post_count=20], tag1[id=1, post_count=5], tag3[id=3, post_count=10]

Can we re-order the order of logic, make the default order go first, than exec the filter tag_cloud_sort.

the position wp-includes/category-template.php line no. 821-844

Note: See TracTickets for help on using tickets.