This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Edit filters in the dropdowns

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Edit filters in the dropdowns

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31072
    pbpyrojust18pbpyrojust18
    Participant

    Is it possible to edit the filters in the dropdowns for each taxonomy? I need to change some names that already attached to posts and I don’t want to go through manually and update each one. Is it possible to edit the name of a current one. Also, how do I remove one? https://resources-marqeta-ms.pantheonsite.io/resources/

    #31080
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Try it via the filters API.

    Something like:

    add_filter('asp_pre_get_front_filters', 'asp_change_a_tax_filter', 10, 2);
    function asp_change_a_tax_filter($filters, $type) {
      foreach ($filters as $k => &$filter) {
    	if ( $filter->type() != 'taxonomy' )
    		continue;
    	// taxonomy term id, field, value
    	$filter->attr(123, 'label', 'New Label');
      }
      return $filters;
    }
    #31102
    pbpyrojust18pbpyrojust18
    Participant

    Okay great. I will give that shot and let you know how it goes. Now how to a remove a term?

    #31115
    Ernest MarcinkoErnest Marcinko
    Keymaster

    $filter->remove(123);

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.