WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 8 months ago

#16125 closed enhancement

Tag cloud widget: hide dropdown when there's only one taxonomy — at Version 18

Reported by: GautamGupta Owned by: GautamGupta
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.1
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description (last modified by scribu)

We should use get_taxonomies() instead of get_object_taxonomies(). Attaching a patch. [20285]

When there's only one taxonomy to select from, we shouldn't show the dropdown at all.

Change History (21)

#1 @GautamGupta
5 years ago

  • Cc gautam.2011@… added
  • Status changed from new to accepted

#2 @nacin
5 years ago

  • Keywords tested removed
  • Type changed from defect (bug) to enhancement

Related: #11612. This is an additional enhancement past that.

I would love to hide the dropdown (make it input:hidden so it still saves) when there is only one taxonomy that supports a tag cloud. Less UI for the win.

#3 @mdawaffe
5 years ago

  • Milestone changed from Awaiting Review to Future Release

#4 @kcssm
5 years ago

This ticket is 3 months old and its way before wordpress-3.1 was released, still this issue is not addressed in this new version. Hope this gets addressed in the next update to come.

#5 @GautamGupta
5 years ago

  • Keywords bbpress added

#6 @nacin
5 years ago

I would love to hide the dropdown (make it input:hidden so it still saves) when there is only one taxonomy that supports a tag cloud. Less UI for the win.

Would like a patch to implement this.

#7 @GautamGupta
5 years ago

Attached another patch based on nacin's recommendations.

Should we return 'post_tag' in _get_current_taxonomy() if no taxonomy was found saved in the options?

#8 @johnjamesjacoby
5 years ago

  • Keywords needs-testing added

Would be helpful for bbPress 2.0 to inherit this instead of including it's own duplicate widget.

Added the needs testing keyword as it's been 6 months since it's had attention.

#9 @SergeyBiryukov
5 years ago

  • Milestone changed from Future Release to 3.3

#10 @westi
5 years ago

  • Keywords needs-refresh added

I kicked the tires on this patch and here is some feedback:

  • Works nicely as I remove taxonomies till none are available.
  • The text displayed in the widget when none are available could do with some copy editing to improve it.
  • The whole patch could do with some work to match coding standards for things like spacing inside of function calls, around !, the whole switch statement.
  • (Personal Taste) I'm not a big fan of the way the switch statement ends up laid out with all the switching back and forth between php and html. I wonder if it might read easier to use echo's instead.

Adding 'needs-refresh' to get the patch updated.

@gautamgupta
5 years ago

Based on westi's recommendations

#11 @gautamgupta
5 years ago

I've attached a new patch based on westi's recommendations. I've also removed the fallback to the post tag taxonomy if no taxonomies are found as if it was hid due to some reason from the tag cloud, we should be acknowledging that.

#12 @SergeyBiryukov
5 years ago

  • Keywords needs-refresh removed

#13 @jane
5 years ago

  • Keywords dev-feedback added

If this is making it into 3.3, it needs to be committed now, as we have passed freeze. If it's not ready to be committed, punt to next cycle.

#14 @navjotjsingh
5 years ago

  • Cc navjotjsingh@… added

#15 @ryan
5 years ago

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3.

#16 @nacin
4 years ago

In [20285]:

Use get_taxonomies() instead of get_object_taxonomies() in the tag cloud widget. props GautamGupta, scribu. see #20238, see #16125.

#17 @nacin
4 years ago

I unintentionally derailed this ticket in comment 2. Hence [20285].

#18 @scribu
4 years ago

  • Description modified (diff)
  • Summary changed from Tag cloud widget should allow any taxonomy (with show_tagcloud arg) to be shown to Tag cloud widget: hide dropdown when there's only one taxonomy

Trying to salvage this ticket somehow.

Note: See TracTickets for help on using tickets.