Inventory_Presser_Plugin::edit_attachment_post_type( array $args,  $type )

edit_attachment_post_type


Description Description

Changes the attachment post type args just before the type is registered. Changes hierarchical to true so that <code>parent</code> is exposed in the REST API.


Top ↑

Parameters Parameters

$args

(array) (Required) Array of arguments for registering a post type. See the register_post_type() function for accepted arguments.

$post_type

(string) (Required) Post type key.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: inventory-presser.php

	public function edit_attachment_post_type( $args, $type )
	{
		if( 'attachment' != $type )
		{
			return $args;
		}
		$args['hierarchical'] = true;
		return $args;
	}