Inventory_Presser_Blocks::add_category( array $categories, WP_Post $post )

add_category


Description Description

Adds a block category to hold all our blocks


Top ↑

Parameters Parameters

$categories

(array) (Required)

$post

(WP_Post) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-blocks.php

	function add_category( $categories, $post )
	{
		//is the post a vehicle?
		if( empty( $post ) || empty( $post->post_type )
			|| $post->post_type != INVP::POST_TYPE )
		{
			return $categories;
		}

		return array_merge(
			$categories,
			array(
				array(
					'slug'  => 'inventory-presser',
					'title' => __( 'Inventory Presser', 'inventory-presser' ),
					'icon'  => 'dashicons-admin-network', //it's a key
				),
			)
		);
	}