ac/column/custom_field/meta_keys

The filter ac/column/custom_field/meta_keys allows you to filter the list of custom field keys found for the current overview page.

Usage

/**
 * Filters the list of distinct keys of Custom Fields found for the current list screen
 * 
 * @param array $keys
 * @param AC_Settings_Column_CustomField $setting
 */
function my_acp_custom_field_meta_keys( $keys, $setting ) {
	// optional check for specific post type of list screen
	// alter keys in array

	return $keys;
}

add_filter( 'ac/column/custom_field/meta_keys', 'my_acp_custom_field_meta_keys', 10, 2 );

Example

/**
 * Removes all hidden (prefixed with underscore) custom fields for the default post type
 *
 * @param array                          $keys
 * @param AC_Settings_Column_CustomField $setting
 */
function my_acp_custom_field_meta_keys_example( $keys, $setting ) {
	$column = $setting->get_column();

	if ( 'post' == $column->get_post_type() ) {

		foreach ( $keys as $index => $key ) {
			if ( 0 === strpos( $key, '_' ) ) {
				unset( $keys[ $index ] );
			}
		}
	}

	return $keys;
}

add_filter( 'ac/column/custom_field/meta_keys', 'my_acp_custom_field_meta_keys_example', 10, 2 );

Legacy

The old filter cac/storage_model/meta_keys is replaced by ac/column/custom_field/meta_keys since Admin Columns 4.0.