Skip to content

ThemePlate/Column

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();