Inventory_Presser_Taxonomy_Overlapper::hooks_add()

hooks_add


Description Description

Adds hooks to catch updates to meta values and term relationships.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-taxonomy-overlapper.php

	function hooks_add()
	{
		/**
		 * When certain post meta fields like make & model are updated, also 
		 * maintain terms in taxonomies to make filtering vehicles easy.
		 */
		add_action( 'updated_postmeta', array( $this, 'maintain_taxonomy_terms_during_meta_updates' ), 10, 4 );
		add_action( 'added_post_meta', array( $this, 'maintain_taxonomy_terms_during_meta_updates' ), 10, 4 );
		add_action( 'deleted_post_meta', array( $this, 'maintain_taxonomy_terms_during_meta_updates' ), 10, 4 );

		//Do the same when taxonomy term relationships are changed
		add_action( 'set_object_terms', array( $this, 'term_relationship_updated' ), 10, 6 );
		add_action( 'deleted_term_relationships', array( $this, 'term_relationship_deleted' ), 10, 3 );
	}