themeplate / column
ThemePlate custom admin columns
v2.1.0
2023-03-05 11:40 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- themeplate/tester: ^2.0
README
Usage
use ThemePlate\Column\PostTypeColumn; use ThemePlate\Column\TaxonomyColumn; use ThemePlate\Column\UsersColumn; function pretty_print( $object_id ) { echo '♥ <b>' . $object_id . '</b> —›'; }; ( 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();