This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/column/value', 'myplugin_column_value', 10, 4 ); // All columns for all content types | |
| function myplugin_column_value( $value, $object_id, $column, $storage_type ) { | |
| // Possibly modify $value | |
| return $value; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/column/value/user', 'myplugin_users_column_value', 10, 4 ); // Columns on the user overview page | |
| add_filter( 'cac/column/value/page', 'myplugin_posttype_page_column_value', 10, 4 ); // Columns on the page overview | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/column/value', 'myplugin_cac_column_featured_image_value', 10, 4 ); | |
| function myplugin_cac_column_featured_image_value( $value, $postid, $column, $post_type ) { | |
| if ( $column->properties->type == 'column-featured_image' ) { | |
| if ( ! $value ) { | |
| $value = '<em>' . __( 'No featured image', 'myplugin' ) . '</em>'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/column/meta/value', 'myplugin_cac_column_format_numbers', 10, 3 ); | |
| function myplugin_cac_column_format_numbers( $value, $postid, $column, $post_type ) { | |
| $numval = floatval( $value ); | |
| if ( $value == $numval ) { | |
| $value = number_format_i18n( $numval, 2 ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/column/meta/value', 'myplugin_column_meta_value', 10, 4 ); // Meta (custom field) columns for all content types | |
| function myplugin_column_meta_value( $value, $object_id, $column, $storage_type ) { | |
| // Possibly modify $value | |
| return $value; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/settings/tabs', 'myplugin_cac_settings_tabs' ); | |
| function myplugin_cac_settings_tabs( $tabs ) { | |
| // Possibly modify $tabs | |
| return $tabs; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/settings/tabs', 'myplugin_cac_settings_tabs' ); | |
| /** | |
| * Add the tab | |
| */ | |
| function myplugin_cac_settings_tabs( $tabs ) { | |
| // Add a tab to the list of Admin Columns settings tabs | |
| $tabs['myplugin-information'] = __( 'Am I a wizard?', 'myplugin_textdomain' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/settings/tab_contents/tab=[tabid]', 'myplugin_cac_tab_contents_mytab' ); // Only the [tabid] tab | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'cac/settings/tab_contents', 'myplugin_cac_tab_contents', 10, 2 ); // All tabs | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: My Plugin | |
| */ | |
| /** | |
| * Main plugin class | |
| */ | |
| class MyPlugin { | |