WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 6 weeks ago

#16125 accepted enhancement

Tag cloud widget: hide dropdown when there's only one taxonomy

Reported by: GautamGupta Owned by: GautamGupta
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Widgets Keywords: needs-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.

Attachments (3)

widget-tagcloud.diff (902 bytes) - added by GautamGupta 5 years ago.
tag_cloud.diff (3.6 KB) - added by GautamGupta 4 years ago.
tagcloud.v3.diff (5.2 KB) - added by gautamgupta 4 years ago.
Based on westi's recommendations

Download all attachments as: .zip

Change History (24)

comment:1 @GautamGupta5 years ago

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

comment:2 @nacin5 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.

comment:3 @mdawaffe5 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:4 @kcssm4 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.

comment:5 @GautamGupta4 years ago

  • Keywords bbpress added

comment:6 @nacin4 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.

@GautamGupta4 years ago

comment:7 @GautamGupta4 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?

comment:8 @johnjamesjacoby4 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.

comment:9 @SergeyBiryukov4 years ago

  • Milestone changed from Future Release to 3.3

comment:10 @westi4 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.

@gautamgupta4 years ago

Based on westi's recommendations

comment:11 @gautamgupta4 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.

comment:12 @SergeyBiryukov4 years ago

  • Keywords needs-refresh removed

comment:13 @jane4 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.

comment:14 @navjotjsingh4 years ago

  • Cc navjotjsingh@… added

comment:15 @ryan4 years ago

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3.

comment:16 @nacin3 years ago

In [20285]:

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

comment:17 @nacin3 years ago

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

comment:18 @scribu3 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.

comment:19 follow-up: @wlindley3 years ago

Grammatical error in tagcloud.v3.diff --currently:

'The tag cloud would not be displayed since their are no taxonomies...

should be 'there':

'The tag cloud would not be displayed since there are no taxonomies...

Any chance of getting at least the one-line patch from [20285] into 3.4? Without that, taxonomies cannot even use the standard Tag Cloud widget.

comment:20 in reply to: ↑ 19 @SergeyBiryukov3 years ago

Replying to wlindley:

Any chance of getting at least the one-line patch from [20285] into 3.4?

Yes, it's already committed.

comment:21 @wonderboymusic6 weeks ago

  • Keywords needs-patch added; has-patch bbpress needs-testing dev-feedback removed
Note: See TracTickets for help on using tickets.