Class: AC\Column\CustomFieldContext

The AC\Column\CustomFieldContext  class contains the properties, options, and methods of a custom field column. The class extends both the AC\Column\Context  class and inherits all its methods.

The main scenario where you might want to use AC\Column\CustomFieldContext is when you have been using a filter or action to hook into Admin Columns and one of the callback values is a Custom Field column object.

Please read over the extended comments found above each function to learn more.

/admin-columns/classes/Column/CustomFieldContext.php  on github.

/admin-columns/classes/Column/Context.php  on github.


Method and properties

get_type(): string

Returns column-meta . The column type identifier.


get_meta_key(): string

Returns the selected meta key of the custom field column.


get_meta_type(): string

Returns the custom field meta type. e.g. post, user, comment and term.


get_post_type(): string

Returns the custom field meta type. e.g. post, page, product, custom-post-type etc.


get_field_type(): string

Returns the field type of the custom fied column. e.g. excerpt, color, date, numeric, image, link, checkmark, library_id, title_by_id, user_by_id.


Field Types

The custom field type mapping is as follows:

Field Type Key
Default ''
Color color
Date date
Image image
Number numeric
Text excerpt
Select select
URL link
HTML html
Has Content has_content
True / False checkmark
Media library_id
User user_by_id
Multiple Values (serialised) array
Number of Fields count

Example Usage

In these examples we change the column value of the `Custom Field` column with the use of the ac/column/render  filter: View examples.

Still need help? Contact Us Contact Us