Edit filters in the dropdowns

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

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31072
    pbpyrojust18
    pbpyrojust18
    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/

    Attachments:
    You must be logged in to view attached files.
    #31080
    Ernest Marcinko
    Ernest 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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #31102
    pbpyrojust18
    pbpyrojust18
    Participant

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

    #31115
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    $filter->remove(123);

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.