wpbp/cpt_columns

Improve the CPT list in the backend for your CPTs

1.0.3 2023-08-21 12:39 UTC

This package is auto-updated.

Last update: 2024-04-21 14:04:40 UTC


README

License Downloads

Improve the CPT list in the backend for your CPTs

Install

composer require wpbp/cpt_columns:dev-master

composer-php52 supported.

Example

$post_columns = new CPT_columns( 'demo' );
$post_columns->add_column( 'cmb2_field', array(
    'label' => __( 'CMB2 Field' ),
    'type' => 'post_meta', //text, thumbnail, post_meta, author, custom_tax, custom_value
    'meta_key' => '_demo_meta_text',
    'orderby' => 'meta_value', // For WP-Query
    'sortable' => true,
    'prefix' => '<b>',
    'suffix' => '</b>',
    'def' => 'Not defined', // Default value in case post meta not found
    'order' => '-1' // This is the last column
	)
);