An open API service indexing awesome lists of open source software.

https://github.com/themeplate/column


https://github.com/themeplate/column

custom-columns wordpress

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# ThemePlate Column

## Usage

```php
use ThemePlate\Column\PostTypeColumn;
use ThemePlate\Column\TaxonomyColumn;
use ThemePlate\Column\UsersColumn;

function pretty_print( $object_id ) {
echo '♥ ' . $object_id . ' —›';
};

( new PostTypeColumn( 'Post ID', 'pretty_print' ) )->init();
( new TaxonomyColumn( 'Term ID', 'pretty_print' ) )->init();
( new UsersColumn( 'User ID', 'pretty_print' ) )->init();
```

### Available config
```php
// Before init
$column->position( 0 )->args( array() )->class( '' );
```

### Specific location
```php
( new PostTypeColumn( 'Model', $my_callback ) )->location( 'custom_post_type' )->init();
( new TaxonomyColumn( 'Value', $my_callback ) )->location( 'tax_1' )->location( 'tax_2' )->init();
```