https://github.com/themeplate/column
https://github.com/themeplate/column
custom-columns wordpress
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/themeplate/column
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2020-01-25T07:04:42.000Z (almost 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-03-02T15:55:55.000Z (10 months ago)
- Last Synced: 2025-03-02T16:35:11.707Z (10 months ago)
- Topics: custom-columns, wordpress
- Language: PHP
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
```