Support

Account

Home Forums Feedback Taxonomy labels and create/save tax modal Reply To: Taxonomy labels and create/save tax modal

  • As far as the popup goes, I can’t really help you. The modal foe adding a term is the modal built into WP. I have never found any information on how to change this.

    You could, in a round-a-bout way, alter the tooltip.

    1. Create a render field filter for the field that runs before the field is rendered
    2. In the render field filter above get the global $wp_taxonomies and alter $wp_taxonomies[$taxonomy]->labels->add_new_item to what you want it to say
    3. Create another render field filter that runs after the field is rendered to change the label back to what it should be.

    That being said, if I needed to build something like this for a client I would not be using a single taxonomy for make and model. Please bare with me because this is only where I would start and the details of getting it done would need to be figured out.

    First I would use two taxonomies, one for make and one for model. There would be a taxonomy field for the model term that allowed selecting the make term.

    I would filter the values shown in the model field based on the selection made in the make field. This may actually require not using taxonomy fields, but I don’t know this for sure. I would need to look at the ACF JS API documentation to see if the AJAX request on this field could be altered to include the value selected in make. The exact details of this research would make the decision on how to proceed.

    I would create my an acf/save_post action that would create the association between the model term and the make term when a new model term is added (basically look to see if the association already exists and if it does not then create it. Basically creating a parent/child association between these to taxonomies. Spitting the make and model taxonomies would also make it much easier to filter by these two fields and in the case of a model that is shared between 2 makes would mean that duplicate model entries would not be created.

    Assuming that the client also wanted urls like /product/make/$make/model/$model/ I would also add custom rewrite rules to accomplish this.