Inventory_Presser_Taxonomies::change_taxonomy_show_ui_attributes( array $taxonomy_data )

When the user flips the “Show All Taxonomies” setting switch, this method changes the taxonomy registration so they are shown.


Parameters

$taxonomy_data

(array) (Required)


Return

(array)


Source

File: includes/class-taxonomies.php

	public function change_taxonomy_show_ui_attributes( $taxonomy_data ) {
		$options = INVP::settings();
		if ( empty( $options['show_all_taxonomies'] ) ) {
			return $taxonomy_data;
		}
		$count = count( $taxonomy_data );
		for ( $i = 0; $i < $count; $i++ ) {
			if ( ! isset( $taxonomy_data[ $i ]['args']['show_in_menu'] ) ) {
				continue;
			}

			$taxonomy_data[ $i ]['args']['show_in_menu'] = true;
			$taxonomy_data[ $i ]['args']['show_ui']      = true;
		}
		return $taxonomy_data;
	}