Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 765 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 765 Bytes

ThemePlate Column

Usage

use ThemePlate\Column\PostTypeColumn;
use ThemePlate\Column\TaxonomyColumn;
use ThemePlate\Column\UsersColumn;

function pretty_print( $object_id ) {
	echo '&hearts;&nbsp;<b>' . $object_id . '</b> &mdash;&rsaquo;';
};

( new PostTypeColumn( 'Post ID', 'pretty_print' ) )->init();
( new TaxonomyColumn( 'Term ID', 'pretty_print' ) )->init();
( new UsersColumn( 'User ID', 'pretty_print' ) )->init();

Available config

// Before init
$column->position( 0 )->args( array() )->class( '' );

Specific location

( new PostTypeColumn( 'Model', $my_callback ) )->location( 'custom_post_type' )->init();
( new TaxonomyColumn( 'Value', $my_callback ) )->location( 'tax_1' )->location( 'tax_2' )->init();