Jetpack: Search: If filter has no name, don't show heading

Created on 17 Jan 2018  路  2Comments  路  Source: Automattic/jetpack

Currently, if a filter doesn't have an actual name, we set it to a key that we used to generate the ES aggs. Let's not do that.

screen shot 2018-01-17 at 2 54 46 pm

Search [Type] Bug

All 2 comments

Rather than not displaying it, why not pull it from the registration?

$taxonomy = get_taxonomy( $tax_slug );
echo esc_html( $taxonomy->labels->name );

ahh, Ahh, I dig that. So, for:

  • "post_type" filters, we'd just use __( 'Post Type', 'jetpack' )
  • "date_histogram", we'd use something like "Posts by month", "Post by year", etc.
  • "taxonomy", we'd use the taxonomy name
Was this page helpful?
0 / 5 - 0 ratings