Automator_Taxonomies::add_custom_columns( $columns )


Parameters Parameters

$columns

(Required)


Top ↑

Return Return

(mixed)


Source Source

File: src/core/automator-post-types/uo-taxonomies/class-automator-taxonomies.php

	public function add_custom_columns( $columns ) {

		$term_args = array(
			'taxonomy'   => 'recipe_category',
			'hide_empty' => false,
			'fields'     => 'all',
			'count'      => true,
			'number'     => 1,
		);
		$cats      = new \WP_Term_Query( $term_args );

		if ( ! empty( $cats->terms ) ) {
			$columns['recipe_category'] = esc_attr__( 'Categories', 'uncanny-automator' );
		}

		$term_args = array(
			'taxonomy'   => 'recipe_tag',
			'hide_empty' => false,
			'fields'     => 'all',
			'count'      => true,
			'number'     => 1,
		);
		$tags      = new \WP_Term_Query( $term_args );

		if ( ! empty( $tags->terms ) ) {
			$columns['recipe_tag'] = esc_attr__( 'Tags', 'uncanny-automator' );
		}

		return $columns;
	}