gppa_should_get_term_by_id

  1. Description
  2. Usage
  3. Parameters

Description

Filter whether terms should be looked up by ID when filtering posts by taxonomy.

This is useful when filtering taxonomies with numeric slugs by a numeric value (i.e. zip codes). By default, Populate Anything will assume numeric values are term IDs and search by ID with the given value. Use this to indicate that your numeric values are slugs and not IDs.

Usage

add_filter( 'gppa_should_get_term_by_id', '__return_false' );

Parameters

  • should_get_term_by_id bool

    Indicate if terms should be fetched by ID. Defaults to true.

  • args array

    An array of arguments applicable to the current filtering request.

  • query_builder_args array

    An array of arguments that will be used to build the query for this filter.