前言介紹
- 這款 WordPress 外掛「Admin Columns for ACF Fields」是 2019-10-08 上架。
- 目前有 7000 個安裝啟用數。
- 上一次更新是 2025-01-17,距離現在已有 105 天。
- 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6.2 以上。
- 有 20 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
flei |
外掛標籤
acf | admin columns | advanced custom fields |
內容簡介
使用此外掛在 WordPress 後端的「所有文章」表格視圖中顯示 ACF 欄位。
只需在任何常規字段的 ACF 字段設置中啟用新選項「管理列」(請參見以下例外),就會顯示爲該字段的額外列在任何文章、頁面、分類或自定義文章類型或分類(例如「所有頁面」)的概述中。
您可以使用過濾器(參見以下)來更精確地控制插件的行爲。
適用於任何常規 ACF 字段(請參見以下例外)。
與 Advanced Custom Fields 5.x 兼容
Github: https://github.com/fleiflei/acf-admin-columns
使用方式:
安裝 ACF 和此外掛(請參見以下)
在 ACF 中打開 / 創建您的“字段群組”,並注意該字段群組適用於哪個文章類型(在底部)。
編輯任何字段(請參見以下例外)。
在字段設置中啟用“管理列”選項。
啟用要顯示該列的文章類型和 / 或分類。
保存字段群組,並轉到您上面注意到的帖子類型或分類的概述頁面(例如“帖子>所有帖子”或“頁面>所有頁面”),並注意新添加的字段列。
高級用法
排除 ACF 字段
由於它們的性質,不會在 ACF 中爲以下字段顯示“管理列”選項:
手風琴
克隆
靈活的內容
谷歌地圖
組
信息
重複子表單
選項卡
過濾器
“acf/admin_columns/admin_columns”
允許您更改在當前管理屏幕上顯示哪些列。
參數
$fields - 所有要顯示在當前屏幕上的 ACF 字段的數組。
範例:
function my_admin_columns($fields) {
$fields['my_field'] = 'my_field';
}
add_filter('acf/admin_columns/admin_columns','my_admin_columns');
“acf/admin_columns/sortable_columns”
更改哪些列應該是可排序的。默認情況下,每一個列都是可排序的。
參數
$columns - 所有要顯示在當前屏幕上的 ACF 字段的數組。
“acf/admin_columns/column/$field”
允許您修改每個行中的所有帖子表格中某個 $field 的輸出。
參數
$field_value - 字段值
原文外掛簡介
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:
Install ACF and this plugin (see below)
In ACF open/create a “field group” and open any field for editing (see exceptions below).
Enable the “Admin Column” option in the field settings.
Specify the desired column position (optional).
Specify the desired column width (optional).
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
$acf_columns - Array of all ACF fields to be shown in current screen. Note that the column key is always prefixed with 'acf_'.
$field_groups - Array of all ACF field groups to be shown in current screen.
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_’.
function my_admin_columns($acf_columns, $field_groups) {
$screen = get_current_screen();
if (!empty($screen) && $screen->post_type == 'my_custom_post_type' && isset($acf_columns['acf_my_field'])) {
unset($acf_columns['acf_my_field']); // the key is always prefixed with 'acf_'
}
return $acf_columns;
}
add_filter('acf/admin_columns/admin_columns','my_admin_columns', 10, 2);
“acf/admin_columns/sortable_columns”
Change which columns should be sortable. By default, every column is sortable.
Parameters
$columns - Array of all ACF fields to be shown in current screen.
“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
$sort_order_type - The sort order type (either 'meta_value' or 'meta_value_num')
$field_properties - the ACF field properties
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).
function my_sort_order_type($sort_order_type, $field_properties) {
if ($field_properties['name'] == 'my_field') {
return 'meta_value_num';
}
return $sort_order_type;
}
add_filter('acf/admin_columns/sort_order_type','my_sort_order_type', 10, 2);
“acf/admin_columns/render_output”
Allows you to modify the output of a certain $field in every row of a posts table.
Parameters
$render_output - The field value after it was prepared for output
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Output then length of text field ‘my_text_field’ instead of its contents.
function my_column_value($rendered_output, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'my_text_field') {
return strlen($field_value);
}
return $rendered_output;
}
add_filter('acf/admin_columns/render_output','my_column_value', 10, 4);
“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
$render_raw - boolean, set to true to render raw field value
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Output the raw image url for image field ‘my_image_field’ for post ID 123.
function my_render_raw($render_raw, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'my_image_field' && $post_id == 123) {
return true;
}
return $render_raw;
}
add_filter('acf/admin_columns/render_raw','my_render_raw', 10, 4);
“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
$default_value - The default value
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Change the default value for field ‘my_field’ to ‘my default value’ if it is empty.
function my_default_value($default_value, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'my_field' && empty($field_value)) {
return 'my default value';
}
return $default_value;
}
add_filter('acf/admin_columns/default_value','my_default_value', 10, 4);
“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
$field_value - the original raw field value
$field_properties - the ACF field properties
$post_id - the post id
“acf/admin_columns/preview_image_size”
Change the preview image size for image or gallery fields. Default value is “thumbnail”.
Parameters
$preview_image_size - string with image size name
$field_properties - the ACF field properties
$post_id - the post id
Example
Change preview image size to “medium”
function my_preview_image_size($preview_image_size, $field_properties, $post_id) {
return 'medium';
}
add_filter('acf/admin_columns/preview_image_size','my_preview_image_size', 10, 3);
“acf/admin_columns/preview_image_url”
Allows for manipulation of the url of the preview image for image or gallery fields.
Parameters
$preview_image_url - string with image url
$field_properties - the ACF field properties
$post_id - the post id
Example
Replace preview image of field ‘my_image_field’ for post ID 123 to a random 100x100px image from https://picsum.photos.
function my_preview_image_url($preview_image_url, $field_properties, $post_id) {
if ($field_properties['name'] == 'my_image_field' && $post_id == 123) {
return 'https://picsum.photos/100/100';
}
return $preview_image_url;
}
add_filter('acf/admin_columns/preview_image_url','my_preview_image_url', 10, 3);
“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
$link_wrap_url - boolean, set to true to wrap url in link
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Wrap url in link for text field ‘my_link_text_field’.
function my_link_wrap_url($link_wrap_url, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'my_link_text_field') {
return true;
}
return $link_wrap_url;
}
add_filter('acf/admin_columns/link_wrap_url','my_link_wrap_url', 10, 4);
“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
$array_render_separator - string with separator, default = ", "
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Output every array item on a new line, using the
tag.
function my_array_render_separator($array_render_separator, $field_properties, $field_value, $post_id) {
return "
";
}
add_filter('acf/admin_columns/array_render_separator','my_array_render_separator', 10, 4);
“acf/admin_columns/no_value_placeholder”
Change the placeholder for empty values. Default value is “-“.
Parameters
$no_value_placeholder - string with placeholder, default = "-"
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Output “n/a” for empty values.
function my_no_value_placeholder($no_value_placeholder, $field_properties, $field_value, $post_id) {
return "n/a";
}
add_filter('acf/admin_columns/no_value_placeholder','my_no_value_placeholder', 10, 4);
“acf/admin_columns/highlight_search_term_preg_replace_pattern”
Change the preg_replace pattern for highlighting the search term in the column output.
Parameters
$highlight_search_term_preg_replace_pattern - string with preg_replace pattern, default is '\\0' (yellow background, black font color)
$field_properties - the ACF field properties
$field_value - the original raw field value
$post_id - the post id
Example:
Highlight search terms with red background and white font color.
function my_highlight_search_term_preg_replace_pattern($highlight_search_term_preg_replace_pattern, $field_properties, $field_value, $post_id) {
return '\\0';
}
add_filter('acf/admin_columns/highlight_search_term_preg_replace_pattern','my_highlight_search_term_preg_replace_pattern', 10, 4);
“acf/admin_columns/exclude_field_types”
Change which field types should not have the admin column option in the field settings.
Parameters
$excluded_field_types - array of excluded_field_types
Example: disallow the admin column option for TEXT fields
function my_exclude_field_types($excluded_field_types) {
$excluded_field_types[] = 'text';
return $excluded_field_types;
}
add_filter('acf/admin_columns/exclude_field_types','my_exclude_field_types');
“acf/admin_columns/column_position”
Change the column position for a certain field.
Parameters
$column_position - integer with column position
$field_name - the ACF field name
$field_properties - the ACF field properties
Example:
Change the column position for field ‘my_field’ to 2.
function my_column_position($column_position, $field_name, $field_properties) {
if ($field_name == 'my_field') {
return 2;
}
return $column_position;
}
add_filter('acf/admin_columns/column_position','my_column_position', 10, 3);
“acf/admin_columns/column_styles”
Change the column styles for a column.
Parameters
$column_styles - string with column styles
$field_name - the ACF field name
$field_properties - the ACF field properties
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.
function my_column_styles($column_styles, $field_name, $field_properties) {
if ($field_name == 'my_field') {
return 'width: 20%; max-width: 200px;';
}
return $column_styles;
}
add_filter('acf/admin_columns/column_styles','my_column_styles', 10, 3);
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Admin Columns for ACF Fields」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.1 | 0.1.1 | 0.1.2 | 0.2.0 | 0.2.1 | 0.2.2 | 0.3.0 | 0.3.1 | 0.3.2 | trunk |
延伸相關外掛(你可能也想知道)
Advanced Custom Fields (ACF®) 》Advanced Custom Fields 可以讓 WordPress 網站成為一個完整的內容管理系統,提供您所有工具以更好管理您的數據。, 使用 Advanced Custom Fields 外掛,完全...。
Advanced Custom Fields: Font Awesome Field 》在 Advanced Custom Fields 中添加一個Font Awesome 圖標字段類型。, , 指定要使用哪些 Font Awesome...。
ACF Content Analysis for Yoast SEO 》此外掛確保 Yoast SEO 分析包括所有 ACF 內容,包括彈性內容和重複器。, Yoast SEO for WordPress 內容和 SEO 分析不會考慮一篇文章的Advanced Custom Fields...。
Advanced Custom Fields: Extended 》🚀 全方位增強套件,可改進WordPress和Advanced Custom Fields。此外掛旨在提供一個強大的管理框架,涵蓋了眾多改進和優化。, 此外掛需要至少 ACF Pro 5.8。,...。
ACF Photo Gallery Field 》t; 'Status', , 'name' => 'status', , 'choices' => array(, 'public' => 'Public', , 'private' => ...。
Table Field Add-on for ACF and SCF 》表格欄位外掛程式增強了Advanced Custom Fields外掛程式的功能,讓表格編輯更易於使用。, 此外掛程式需要Advanced Custom Fields外掛程式或專業版!, 表格欄...。
Really Simple CSV Importer 》替代 CSV 導入外掛程式。簡單而強大,最適合於技術狂熱者。, , 類別支援, 標籤支援, 自訂欄位支援, Smart Custom Fields 支援, Custom Field Suite 支援, Adv...。
ACF to REST API 》此 WordPress 外掛在WordPress REST API中提供了Advanced Custom Fields的端點, 詳細資訊請參閱GitHub:https://github.com/airesvsg/acf-to-rest-api/。
ACF Quick Edit Fields 》這個 WordPress 外掛為 Advanced Custom Fields Plugin(Pro 和 Free 5+)增加了快速編輯功能。, 特色, , 在清單檢視中顯示 ACF 欄位值, 支援的 ACF 欄位類型...。
Advanced Custom Fields: Gravity Forms Add-on 》提供進階自訂欄位 (Advanced Custom Field),讓 WordPress 編輯使用者或管理員可以在欄位群組配置中選擇 Gravity Form。, 可以在 外掛的 GitHub 存儲庫 中找...。
Advanced Custom Fields: Image Aspect Ratio Crop Field 》這是一個進階自訂欄位 (Advanced Custom Fields) 的外掛,會在使用者上傳圖片後強制執行特定的長寬比例或像素大小裁剪。使用長寬比例對於回應式圖片的使用情...。
Advanced Custom Fields: Nav Menu Field 》使用 Nav Menu Field 外掛將導覽選單加入Advanced Custom Fields (ACF)。此外掛會在 ACF(版本 5 和 4)加入 Nav Menu 欄位類型,讓您從 WordPress 管理後台...。
ACF Theme Code for Advanced Custom Fields 》ACF Theme Code 外掛可以自動生成在主題中實現 Advanced Custom Fields 所需的程式碼。以下是該外掛的功能特色:, , - 縮短網站開發時間。, - 當您發布、編輯...。
ACF qTranslate 》此外掛提供 qTranslate-X 相容的 ACF4 和 ACF5PRO 欄位類型,包括文字、文字區域、所見即所得編輯器、影像和檔案。新增欄位至群組時,這些新的欄位類型將在欄...。
ACF Options For Polylang 》您使用了高級自訂欄位來建立選項頁面,並且安裝了 Polylang 外掛以獲得令人驚嘆的多語言網站嗎?, 可惜的是,Polylang 並不處理 ACF 的選項頁面。這意味著您...。