WordPress.org

Plugin Directory

jetpack

Opened 4 years ago

Closed 4 years ago

#1975 closed enhancement (duplicate)

Widget Visibility: add custom taxonomy and CPT support

Reported by: jeherve Owned by: tmoorewp
Priority: normal Severity: normal
Plugin: jetpack Keywords: widget-visibility taxonomy cpt
Cc: jeherve, richard@…

Description

Custom taxonomies aren't available in the Widget Visibility dropdown lists. It would be great to automatically detect them, or to add a filter to widget_conditions_options_echo so people can easily add support for their custom taxonomies.

Suggested here:

Attachments (1)

widget-conditions.php.patch (3.7 KB) - added by dcrabill 4 years ago.
Added custom taxonomy support

Download all attachments as: .zip

Change History (5)

comment:1 @jeherve4 years ago

  • Keywords cpt added
  • Summary changed from Widget Visibility: add custom taxonomy support to Widget Visibility: add custom taxonomy and CPT support

comment:2 @richardmtl4 years ago

  • Cc richard@… added

@dcrabill4 years ago

Added custom taxonomy support

comment:3 @dcrabill4 years ago

I've gotten this working on my site. You may need to look over the code and see if the decisions I made about how it functions are what you want for Jetpack.

Basically there are three levels that the user can choose:
"All taxonomy pages": Displays widget on all tax archive pages, but not on individual posts
"All {taxonomy} pages": Displays widget on all posts that are assigned a term in {taxonomy}, plus displays on archive pages for terms in {taxonomy}
"{term}": Displays widget on all posts that are assigned {term}, plus displays on {term} archive page

comment:4 @kraftbj4 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

dcrabill: Thanks for the patch!

We're in the progress of migrating everything from plugins.trac to GitHub, so I ported this ticket over to https://github.com/Automattic/jetpack/issues/223

I'll check out your patch and add it as a PR on GitHub, unless you beat me to it ;-).

Marking this as a duplicate so we can continue the conversation on the GH issue.

Note: See TracTickets for help on using tickets.