1. Home
  2. Knowledge Base
  3. Easy Post Types & Fields
  4. Developer Documentation

Actions and Filters

Actions

ept_post_type_{$post_type}_after_metabox

Fires after the content of the metabox is output

The variable portion of the hook is the slug of the current post type. Custom post types are always prefixed with `ept_` while built-in and third-party post types use their original slug.

Example

add_action( 'ept_post_type_{$post_type}_after_metabox', 'my_ept_post_type_post_type_after_metabox' );
function my_ept_post_type_post_type_after_metabox() {
	// your code here...
}

ept_post_type_{$post_type}_after_metabox_field

Fires before a field input is output in the metabox

The variable portion of the hook is the slug of the current post type. Custom post types are always prefixed with `ept_` while built-in and third-party post types use their original slug.

Arguments

  • $meta_key (string): The key of the current custom field
  • $meta_value (string): The value of the current custom field

Example

add_action( 'ept_post_type_{$post_type}_after_metabox_field', 'my_ept_post_type_post_type_after_metabox_field', 10, 2 );
function my_ept_post_type_post_type_after_metabox_field( $meta_key, $meta_value ) {
	// your code here...
}

ept_post_type_{$post_type}_before_metabox

Fires before the content of the metabox is output

The variable portion of the hook is the slug of the current post type. Custom post types are always prefixed with `ept_` while built-in and third-party post types use their original slug.

Example

add_action( 'ept_post_type_{$post_type}_before_metabox', 'my_ept_post_type_post_type_before_metabox' );
function my_ept_post_type_post_type_before_metabox() {
	// your code here...
}

ept_post_type_{$post_type}_before_metabox_field

Fires before a field input is output in the metabox

The variable portion of the hook is the slug of the current post type. Custom post types are always prefixed with `ept_` while built-in and third-party post types use their original slug.

Arguments

  • $meta_key (string): The key of the current custom field
  • $meta_value (string): The value of the current custom field

Example

add_action( 'ept_post_type_{$post_type}_before_metabox_field', 'my_ept_post_type_post_type_before_metabox_field', 10, 2 );
function my_ept_post_type_post_type_before_metabox_field( $meta_key, $meta_value ) {
	// your code here...
}

Filters

edit_ept_fields_per_page

Filter the number of items per page for the custom field list table

Arguments

  • $items_per_page (int): The number of items per page

Example

add_filter( 'edit_ept_fields_per_page', 'my_edit_ept_fields_per_page' );
function my_edit_ept_fields_per_page( $items_per_page ) {
	// your code to alter $items_per_page here...

	return $items_per_page;
}

edit_ept_post_types_per_page

Filter the number of items per page for the post type list table

Arguments

  • $items_per_page (int): The number of items per page

Example

add_filter( 'edit_ept_post_types_per_page', 'my_edit_ept_post_types_per_page' );
function my_edit_ept_post_types_per_page( $items_per_page ) {
	// your code to alter $items_per_page here...

	return $items_per_page;
}

edit_ept_taxonomies_per_page

Filter the number of items per page for the taxonomy list table

Arguments

  • $items_per_page (int): The number of items per page

Example

add_filter( 'edit_ept_taxonomies_per_page', 'my_edit_ept_taxonomies_per_page' );
function my_edit_ept_taxonomies_per_page( $items_per_page ) {
	// your code to alter $items_per_page here...

	return $items_per_page;
}

ept_field_{$this_key}_args

Filter the arguments to register a custom field

The variable part of the hook is the slug of the field (which is prefixed with `$post_type`). For example, the full slug of a `link` field registered to an `article` custom post type will be `ept_article_link`. When adding a custom field to a post type registered by WordPress or by a third-party plugin, the prefix is simply the slug of the post type. For example, the full slug of a custom 'link' field registered to the 'post' post type would be `post_link`.

Arguments

  • $args (array): The list of argumets to register this custom field

Example

add_filter( 'ept_field_{$this_key}_args', 'my_ept_field_this_key_args' );
function my_ept_field_this_key_args( $args ) {
	// your code to alter $args here...

	return $args;
}

ept_post_type_{$this_slug}_args

Filter the arguments to register a custom post type

The variable part of the hook name is the slug of the post type.

Arguments

  • $args (array): The arguments that define the custom post type

Example

add_filter( 'ept_post_type_{$this_slug}_args', 'my_ept_post_type_this_slug_args' );
function my_ept_post_type_this_slug_args( $args ) {
	// your code to alter $args here...

	return $args;
}

ept_post_type_{$this_slug}_labels

Filter the labels used to register the custom post type.

The variable part of the hook name is the slug of the post type.

Arguments

  • $default_labels (array): An associative array of labels

Example

add_filter( 'ept_post_type_{$this_slug}_labels', 'my_ept_post_type_this_slug_labels' );
function my_ept_post_type_this_slug_labels( $default_labels ) {
	// your code to alter $default_labels here...

	return $default_labels;
}

ept_taxonomy_{$this_taxonomy}_args

Filter the arguments to register a custom taxonomy

The variable part of the hook is the slug of the taxonomy (which is prefixed with `$post_type`). For example, the full slug of a `category` taxonomy registered to an `article` custom post type will be `ept_article_category`.

Arguments

  • $args (array): The list of argumets to register this taxonomy

Example

add_filter( 'ept_taxonomy_{$this_taxonomy}_args', 'my_ept_taxonomy_this_taxonomy_args' );
function my_ept_taxonomy_this_taxonomy_args( $args ) {
	// your code to alter $args here...

	return $args;
}

ept_taxonomy_{$this_taxonomy}_labels

Filter the default labels of a custom taxonomy

The variable part of the hook is the slug of the taxonomy (which is prefixed with `$post_type`). For example, the full slug of a `category` taxonomy registered to an `article` custom post type will be `ept_article_category`.

Arguments

  • $default_labels (array): The list of default labels for this taxonomy

Example

add_filter( 'ept_taxonomy_{$this_taxonomy}_labels', 'my_ept_taxonomy_this_taxonomy_labels' );
function my_ept_taxonomy_this_taxonomy_labels( $default_labels ) {
	// your code to alter $default_labels here...

	return $default_labels;
}

ept_{$post_type}_field_editor_args

Filter the arguments passed to the `wp_editor` function
that output the WYSIWYG editor in the custom field meta box.

The variable part of the hook is the slug of the post_type the current custom field is registered to.

Arguments

  • $args (array): An associative array of arguments passed to wp_editor
  • $field (string): The slug of the current field
  • $post_type (string): The slug of the current post type

Example

add_filter( 'ept_{$post_type}_field_editor_args', 'my_ept_post_type_field_editor_args', 10, 3 );
function my_ept_post_type_field_editor_args( $args, $field, $post_type ) {
	// your code to alter $args here...

	return $args;
}

ept_{$post_type}_field_text_input_attributes

Filter the attributes added to the text input element in the custom field metabox

The variable part of the hook is the slug of the post_type the current custom field is registered to. The attributes are defined as an associative array where the keys are the name of the attributes and the values are the values of the attributes.

Arguments

  • $args (array): The array of attributes
  • $field (string): The slug of the current field
  • $post_type (string): The slug of the current post type

Example

add_filter( 'ept_{$post_type}_field_text_input_attributes', 'my_ept_post_type_field_text_input_attributes', 10, 3 );
function my_ept_post_type_field_text_input_attributes( $args, $field, $post_type ) {
	// your code to alter $args here...

	return $args;
}

manage_ept_fields_columns

Filter the heading of each column in the custom field list table

The array passed to the filter callback is an associative array where the keys are the name of the columns and the values are the headings. The columns in the array are presented in the same order they have in the table.

Arguments

  • $columns (array): The columns of the list table

Example

add_filter( 'manage_ept_fields_columns', 'my_manage_ept_fields_columns' );
function my_manage_ept_fields_columns( $columns ) {
	// your code to alter $columns here...

	return $columns;
}

manage_ept_post_types_columns

Filter the heading of each column in the post type list table

The array passed to the filter callback is an associative array where the keys are the name of the columns and the values are the headings. The columns in the array are presented in the same order they have in the table.

Arguments

  • $columns (array): The list of columns

Example

add_filter( 'manage_ept_post_types_columns', 'my_manage_ept_post_types_columns' );
function my_manage_ept_post_types_columns( $columns ) {
	// your code to alter $columns here...

	return $columns;
}

manage_ept_taxonomies_columns

Filter the heading of each column in the taxonomy list table

The array passed to the filter callback is an associative array where the keys are the name of the columns and the values are the headings. The columns in the array are presented in the same order they have in the table.

Arguments

  • $columns (array): The list of columns

Example

add_filter( 'manage_ept_taxonomies_columns', 'my_manage_ept_taxonomies_columns' );
function my_manage_ept_taxonomies_columns( $columns ) {
	// your code to alter $columns here...

	return $columns;
}

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.