Inventory_Presser_Taxonomies::delete_term_data()

delete_term_data


Description Description

Removes all terms in all our taxonomies. Used when uninstalling the plugin.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-taxonomies.php

	function delete_term_data()
	{
		//remove the terms in taxonomies
		$taxonomy_data = self::taxonomy_data();
		for( $i=0; $i<sizeof( $taxonomy_data ); $i++ )
		{
			$tax = $taxonomy_data[$i]['args']['label'];
			$terms = get_terms( $tax, array(
				'fields'     => 'ids',
				'hide_empty' => false
			) );
			foreach ( $terms as $value )
			{
				wp_delete_term( $value, $tax );
			}
		}
	}