ac/column_types

The action ac/column_types allows you to register your own columns for Admin Columns.

Usage

/**
 * Register your own column
 *
 * @param AC_ListScreen $list_screen
 */
function my_ac_register_a_column( $list_screen ){

	// (optional) Check for a specific list screen type
	if ( 'post' !== $list_screen->get_meta_type() ) {
		return;
	}

	// Register the column with the list screen
	$list_screen->register_column_type( new AC_Column_Personal() );
}
add_action( 'ac/column_types', 'my_ac_register_a_column' );

Example

This example shows how you can register your own created column.

function my_ac_register_custom_column_for_the_post_table( AC_ListScreen $list_screen ) {

	// check for specific List Screen, such as  'AC_ListScreen_Post', 'AC_ListScreen_User', 'AC_ListScreen_Comment' or 'AC_ListScreen_Media'.
	if ( $list_screen instanceof AC_ListScreen_Post ) {

		// Require the file that contains your custom column class
		require_once plugin_dir_path( __FILE__ ) . 'ac-column-COLUMN_NAME.php';

		$list_screen->register_column_type( new AC_Column_COLUMN_NAME );
	}
}

add_action( 'ac/column_types', 'my_ac_register_custom_column_for_the_post_table' );