Admin Columns for ACF Fields

This plugin requires the plugin “Advanced Custom Fields” (ACF) to work.

Use this plugin to show ACF fields in the “All Posts”, Taxonomy or User table view in the WordPress admin backend.

Simply enable the new option “Admin Column” in your ACF field settings for any regular field (see exceptions below), and optionally set the columns position and width. Now there will be an extra column for your field shown in any overview of built-in or custom posts, pages, taxonomies (e.g. “All Pages”), and users.

You can use filters (see below) to control the plugins behaviour even more precisely.

Works on any regular ACF field (see exceptions below).

Compatible with Advanced Custom Fields 5.x and 6.x.

Github: https://github.com/fleiflei/acf-admin-columns

If you like this plugin please kindly leave your review and feedback here: https://wordpress.org/plugins/admin-columns-for-acf-fields/#reviews

Usage:

  1. Install ACF and this plugin (see below)
  2. In ACF open/create a “field group” and open any field for editing (see exceptions below).
  3. Enable the “Admin Column” option in the field settings.
  4. Specify the desired column position (optional).
  5. Specify the desired column width (optional).
  6. Save the field group and go to the “All posts” view of the post type or taxonomy (e.g. “Posts > All Posts”, or “Pages > All Pages”) and notice the newly added column for your field.

Excluded ACF Fields

Due to their nature the option “Admin Column” is not shown in ACF for these fields:

  • Accordion
  • Clone
  • Flexible Content
  • Google Map
  • Group
  • Message
  • Repeater
  • Tab

Filters

“acf/admin_columns/admin_columns”

Allows you to change which columns are displayed on the current admin screen.

Parameters

Example:

Remove ‘my_field’ from the columns of the post type ‘my_custom_post_type’, even if it is set to be shown in the field settings. Note that the column key is always prefixed with ‘acf_’.

“acf/admin_columns/sortable_columns”

Change which columns should be sortable. By default, every column is sortable.

Parameters

“acf/admin_columns/sort_order_type”

Change the sort order type for a certain field. By default, most fields are sorted by string comparison. Number fields are ordered by numeric comparison.

Parameters

Example:

Change the sort order type for the field ‘my_field’ to ‘meta_value_num’ (see https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).

“acf/admin_columns/render_output”

Allows you to modify the output of a certain $field in every row of a posts table.

Parameters

Example:

Output then length of text field ‘my_text_field’ instead of its contents.

“acf/admin_columns/render_raw”

Output a field value without any formatting. This is useful e.g. for image fields, where you might want to output the raw image url instead of a rendered image tag.

Parameters

Example:

Output the raw image url for image field ‘my_image_field’ for post ID 123.

“acf/admin_columns/default_value”

Allows you to override the default value for a certain field if it is empty. This only applies, if the field has a default value set in the field settings.

Parameters

Example:

Change the default value for field ‘my_field’ to ‘my default value’ if it is empty.

“acf/admin_columns/before_render_output”

Allows you to modify the field value of a certain $field before it is prepared for rendering. This filter is applied before ‘acf/admin_columns/render_output’.

Parameters

“acf/admin_columns/preview_image_size”

Change the preview image size for image or gallery fields. Default value is “thumbnail”.

Parameters

Example

Change preview image size to “medium”

“acf/admin_columns/preview_image_url”

Allows for manipulation of the url of the preview image for image or gallery fields.

Parameters

Example

Replace preview image of field ‘my_image_field’ for post ID 123 to a random 100x100px image from https://picsum.photos.

“acf/admin_columns/link_wrap_url”

Automatically wrap url in link to that url. This is useful e.g. for text fields that contain a url, where you might want to output a link to the url instead of the url itself.

Parameters

Example:

Wrap url in link for text field ‘my_link_text_field’.

“acf/admin_columns/array_render_separator”

Allows you to change the separator for array fields (e.g. repeater, flexible content, gallery). Default value is “, “.

Parameters

Example:

Output every array item on a new line, using the <br> tag.

“acf/admin_columns/no_value_placeholder”

Change the placeholder for empty values. Default value is “-“.

Parameters

Example:

Output “n/a” for empty values.

“acf/admin_columns/highlight_search_term_preg_replace_pattern”

Change the preg_replace pattern for highlighting the search term in the column output.

Parameters

Example:

Highlight search terms with red background and white font color.

“acf/admin_columns/exclude_field_types”

Change which field types should not have the admin column option in the field settings.

Parameters

Example: disallow the admin column option for TEXT fields

“acf/admin_columns/column_position”

Change the column position for a certain field.

Parameters

Example:

Change the column position for field ‘my_field’ to 2.

“acf/admin_columns/column_styles”

Change the column styles for a column.

Parameters

Example:

Change the column width for field ‘my_field’ to 20% of the screen width and set the max-width of the column to 200px.

0

评论0

 
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
显示验证码
没有账号?注册  忘记密码?

社交账号快速登录