Closed mmjaeger closed 4 years ago
got it to work like - hope that's the right way to do it `$cats = new Taxonomy( 'category' ); $cats->posttype( 'post' );
$cats->columns()->add( array(
'pid' => __( 'ID' ),
) );
$cats->columns()->populate( 'pid', function ( $content, $column, $term_id ) {
echo $term_id;
} );
$cats->columns()->order( array(
'pid' => 1
) );
$cats->register(); // register category for posttype 'gear'`
what's not working though is adding a column to the post_type "attachment" like this:`
$atts = new PostType( 'attachment' );
$atts->columns()->add( array(
'pid' => __( 'ID' ),
) );
$atts->columns()->populate( 'pid', function ( $column, $post_id ) {
echo $post_id;
} );
$atts->columns()->order( array(
'pid' => 1
) );
$atts->register();`
am I missing something??
@mmjaeger The attachment post type has a slightly different actions and filters to other post types.
This has been raised in another issue (#5) and will be looking into a fix.
Closing this issue out in favour of #5
Hello How could I add an ID column to the posts -> categories edit screen?