https://github.com/wpbp/cpt_columns
Improve the CPT list in the backend for your CPTs
https://github.com/wpbp/cpt_columns
wordpress wordpress-php-library
Last synced: 10 months ago
JSON representation
Improve the CPT list in the backend for your CPTs
- Host: GitHub
- URL: https://github.com/wpbp/cpt_columns
- Owner: WPBP
- License: gpl-3.0
- Created: 2016-07-01T22:37:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T12:40:49.000Z (over 2 years ago)
- Last Synced: 2024-10-30T00:54:58.509Z (about 1 year ago)
- Topics: wordpress, wordpress-php-library
- Language: PHP
- Size: 22.5 KB
- Stars: 20
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPT Columns
[](http://www.gnu.org/licenses/gpl-3.0)

Improve the CPT list in the backend for your CPTs
## Install
`composer require wpbp/cpt_columns:dev-master`
[composer-php52](https://github.com/composer-php52/composer-php52) supported.
## Example
```php
$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' => '',
'suffix' => '',
'def' => 'Not defined', // Default value in case post meta not found
'order' => '-1' // This is the last column
)
);
```