The CPAC_Column object contains the properties, options and methods of a column.

There are two main scenarios you might want to use CPAC_Column.
If you have been using a filter or action to hook into Admin Columns and one of the callback values is a column object. Another scenario is when you have created a new column type  yourself and have extended on CPAC_Column.

Available Methods

Note: some methods are only available since verion 3.3.4

  • get_options() : Returns the stored column options
  • get_option( $name ) : Returns a single column option by name
  • get_name() : Returns the name of the column
  • get_type() : Returns the type of the column
  • is_type( $type ) : Checks if the given type matches the type of the column
  • get_post_type() : Returns the post_type of the column ( only applies to Post columns )
  • get_taxonomy() : Returns the taxonomy of the column ( only applies to Taxonomy columns )
  • code]get_label()[/code] : Get column label
  • get_value( $id ) : Returns the column value for displaying
  • get_raw_value( $id ) : Returns the raw column value (used for sorting and inline edit mostly )
  • get_storage_model() : Returns the CPAC_Storage_Model object which the column belongs to
  • get_storage_model_type() : Returns CPAC_Storage_Model type such as a post, user, comment, media or taxonomy
  • get_storage_model_meta_type() : Returns CPAC_Storage_Model meta_type such as a post, user, comment, or taxonomy

The CPAC_Column class is located in /codepress-admin-columns/classes/column.php. Please read over the extended comments found above each function in to learn more, this file is available on github.

 

Methods and Properties

get_type()

Get the column type, this can be anything from title, date or column-meta. The exact type can be found by hover over the Type label inside the column settings.

get_name()

Get the column name, this is a unique identifier for the column. If you have multiple column of the same type, this could look like column-metacolumn-meta-1. The exact name can be found by hover over the Type label inside the column settings.

hover_type