Plugin Directory

Advanced Custom Fields (ACF) – 高级自定义字段

Advanced Custom Fields (ACF) – 高级自定义字段

描述

高级自定义字段 (ACF) 为您提供所有工具来对您的数据进行更多处理,从而将 WordPress 网站转变为成熟的内容管理系统。

使用 ACF 插件完全控制您的 WordPress 编辑屏幕、自定义字段数据等。

按需添加字段。
ACF 字段生成器使您只需单击几个按钮即可快速轻松地将字段添加到 WP 编辑屏幕!无论是简单的事情(例如向书评文章添加“作者”字段),还是更复杂的事情(例如电子商务网站或市场的结构化数据需求),ACF 都可以轻松地将字段添加到内容模型中。

将它们添加到任何地方。
可以在整个 WordPress 中添加字段,包括帖子、页面、用户、分类术语、媒体、评论甚至自定义选项页面!为 WordPress 内容创建体验带来结构再简单不过了。

到处展示它们。
使用我们无忧、开发人员友好的功能在任何主题模板文件中加载并显示您的自定义字段值!无论您需要显示单个值还是基于更复杂的查询生成内容,ACF 的开箱即用功能都使模板成为各种经验水平的开发人员的梦想。

任何内容,快速。
将 WordPress 转变为真正的内容管理系统不仅仅是自定义字段。创建新的自定义帖子类型和分类法是构建自定义 WordPress 网站的重要组成部分。现在可以在 ACF UI 中注册帖子类型和分类法,从而加快内容建模工作流程,而无需触摸代码或使用其他插件。

简单美丽且有意为之。
对于内容创建者和负责数据输入的人员来说,现场用户体验非常直观,同时又完美地融入了本机 WordPress 体验。定期审查和应用无障碍标准,确保 ACF 能够为尽可能接近的任何人提供帮助。

文档和开发人员指南。
十多年充满活力的社区贡献以及对清晰文档的持续承诺意味着您将能够找到构建您想要的内容所需的指导。

插件特色

  • 使用方式简单直觉
  • 功能强大
  • 超过 30 种自定义字段类型
  • 完整的在线说明文档
  • 超过百万的爱用者

相关链接

付费 PRO 版

高级自定义字段插件还提供专业版本,其中包括更多字段、更多功能和更大灵活性。 ACF PRO 插件特点:

升级到 ACF PRO

屏幕截图

  • 简单直观

  • 专为开发者打造

  • 关于字段的所有信息

  • 注册自定义文章类型

  • 注册分类法

安装

从 WordPress 网站管理后台进行安装

  1. 访问 [插件] > [安装插件] 页面。
  2. 搜索「Advanced Custom Fields」或者 “ACF”。
  3. 在 [插件] 页面中安装并启用 Advanced Custom Fields。
  4. 点击新菜单项“ACF”并创建您的第一个自定义字段组,或注册自定义文章类型或分类法。
  5. 阅读开始使用

常见问题

插件开发者能为用户提供的技术支持有哪些?

支持论坛我们的ACF社区论坛提供了一个很好的资源,用于搜索和查找以前回答和询问的支持问题。你可以在这些论坛上创建一个新的帖子,但不能保证你会收到我们支持团队的回复。对于ACF开发人员来说,这更多的是一个相互交流、发布想法、插件并提供基本帮助的领域查看支持论坛

评价

2024 年 6 月 4 日
ACF v4 with add-ons was installed on my site by a developer ten years ago, and I ran into issues attempting to update. The technician (Alvin Muthui) patiently answered all questions, tested updates on my staging site, corrected db issues and even located a small, key PHP problem. The v6 plugin now runs perfectly. I’m amazed and immensely thankful for the time, kindness and skill offered by the ACF team – along with providing an essential plug-in, they’re uncommonly committed to helping users at all levels. Definitely five stars….
2024 年 5 月 24 日
I use the plugin to create custom fields and am very satisfied with it
2024 年 5 月 18 日 1 回复
I’ve been using ACF free and PRO for years. It’s even replaced Custom Post Type UI in my installs since ACF added custom post type creation and management (with the only difference I’ve needed is that if you need to change the post type’s slug and migrate posts from the old one to the new, ACF does not handle that yet while CPTUI has been for years). I’ve found it to be incredibly user friendly for my content editors in WordPress backoffice and developer friendly for me! I’ve not had any issue figuring out their documentation either. My only critique, and it doesn’t even hurt the star rating because it’s not something I’d expect their plugin to handle, is that it can easily bloat your postmeta and termmeta data tables if you have a lot of fields and a lot of posts with data in those fields. Having a lot of rows can slow your queries and ultimately affect the site’s overall performance so one of my current projects is finding a way to move the ACF data into their own tables in the database without losing functionality.
2024 年 5 月 13 日
I have just started using ACF. It is a useful and well-designed tool with all the functionality necessary to satisfy the needs of most website developers and owners. The documentation is great, and customer support is top-notch. Even though I am using the Free version, I received a quick response from the ACF team. My special appreciation and thanks to Chris (Christopher Mucheke), who responded to my queries. He patiently explained things that were not clear to me. The documentation he sent was relevant and to the point. Thanks to Chris and the ACF team for cultivating a culture of customer care.
阅读所有1,217条评价

贡献者及开发者

“Advanced Custom Fields (ACF) – 高级自定义字段” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

「Advanced Custom Fields (ACF) – 高级自定义字段」插件已被翻译至 30 种本地化语言。 感谢所有译者为本插件所做的贡献。

将“Advanced Custom Fields (ACF) – 高级自定义字段”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

6.3.4

Release Date 18th July 2024

  • Security Fix – The ACF shortcode now prevents access to fields from different private posts by default. View the release notes for more information
  • Fix – Users without the edit_posts capability but with custom capabilities for a editing a custom post type, can now correctly load field groups loaded via conditional location rules
  • Fix – Block validation no longer validates a field’s sub fields on page load, only on edit. This resolves inconsistent validation errors on page load or when first adding a block
  • Fix – Deactivating an ACF PRO license will now remove the license key even if the server call fails
  • Fix – Field types returning objects no longer cause PHP warnings and errors when output via the_field, the_sub_field or the ACF shortcode, or when retrieved by a get_ function with the escape html parameter set
  • Fix – Server side errors during block rendering now gracefully displays an error to the editor

6.3.3

Release Date 27th June 2024

  • Enhancement – All dashicons are now available to the icon picker field type
  • Fix – The True/False field now correctly shows it’s description message beside the switch when using the Stylized UI setting
  • Fix – Conditional logic values now correctly load options when loaded over AJAX
  • Fix – ACF PRO will no longer trigger license validation calls when loading a front-end page
  • i18n – Fixed an untranslatable string on Option Page previews

6.3.2.1

Release Date 24th June 2024
PRO Only Release

  • Fix – ACF Blocks no longer trigger a JavaScript error when fetched via AJAX

6.3.2

Release Date 24th June 2024

  • Security Fix – ACF now generates different nonces for each AJAX-enabled field, preventing subscribers or front-end form users from querying other field results
  • Security Fix – ACF now correctly verifies permissions for certain editor only actions, preventing subscribers performing those actions
  • Security Fix – Deprecated a legacy private internal field type (output) to prevent it being able to output unsafe HTML
  • Security Fix – Improved handling of some SQL filters and other internal functions to ensure output is always correctly escaped
  • Security Fix – ACF now includes blank index.php files in all folders to prevent directory listing of ACF plugin folders for incorrectly configured web servers

6.3.1.2

Release Date 6th June 2024
PRO Only Release

  • Fix – ACF Blocks in widget areas no longer cause a fatal error when no context is available
  • Fix – ACF Blocks with no fields assigned no longer show a gap in the sidebar where the form would render

6.3.1.1

Release Date 6th June 2024
PRO Only Release

  • Fix – Repeater and Flexible Content fields no longer error when duplicating or removing rows containing Icon Picker subfields
  • Fix – ACF Blocks containing Flexible Content fields now correctly load their edit form
  • Fix – ACF Blocks no longer have a race condition where the data store is not initialized when read
  • Fix – ACF Blocks no longer trigger a JS error for blocks without fields and with an empty no-fields message
  • Fix – ACF Block preloading now works correctly for fields consuming custom block context
  • Fix – ACF Block JavaScript debug messages now correctly appear when SCRIPT_DEBUG is true

6.3.1

Release Date 4th June 2024

  • Enhancement – Options Pages registered in the UI can now be duplicated
  • Fix – ACF Block validation now correctly validates Repeater, Group, and Flexible Content fields
  • Fix – ACF Block validation now correctly validates when a field is using a non-default return type
  • Fix – Fields moved between field groups now correctly updates both JSON files
  • Fix – Icon Picker fields now render correctly when using left-aligned labels
  • Fix – Icon Picker fields no longer renders tabs if only one tab is selected for display
  • Fix – Icon Picker fields no longer crash the post editor if no icon picker tabs are selected for displayed
  • Fix – True/False field now better handles longer On/Off labels
  • Fix – Select2 results loaded by AJAX for multi-select Taxonomy fields no longer double encode HTML entities

6.3.0.1

Release Date 22nd May 2024

  • Fix – A possible fatal error no longer occurs in the new site health functionality for ACF PRO users
  • Fix – A possible undefined index error no longer occurs in ACF Blocks for ACF PRO users

6.3.0

Release Date 22nd May 2024

  • New – ACF now requires WordPress version 6.0 or newer, and PHP 7.4 or newer.
  • New – ACF Blocks now support validation rules for fields. View the release notes for more information
  • New – ACF Blocks now supports storing field data in the postmeta table rather than in the post content
  • New – Conditional logic rules for fields now support selecting specific values for post objects, page links, taxonomies, relationships and users rather than having to enter the ID
  • New – New Icon Picker field type for ACF and ACF PRO
  • New – Icon selection for a custom post type menu icon
  • New – Icon selection for an options page menu icon
  • New – ACF now surfaces debug and status information in the WordPress Site Health area
  • New – The escaped html notice can now be permanently dismissed
  • Enhancement – Tab field now supports a selected attribute to specify which should be selected by default, and support class attributes
  • Fix – Block Preloading now works reliably in WordPress 6.5 or newer
  • Fix – Select2 results loaded by AJAX for post object fields no longer double encode HTML entities
  • Fix – Custom post types registered with ACF will now have custom field support enabled by default to better support revisions
  • Fix – The first preview after publishing a post in the classic editor now displays ACF fields correctly
  • Fix – ACF fields and Flexible Content layouts are now correctly positioned while dragging
  • Fix – Copying the title of a field inside a Flexible Content layout no longer adds whitespace to the copied value
  • Fix – Flexible Content layout names are no longer converted to lowercase when edited
  • Fix – ACF Blocks with attributes without a default now correctly register
  • Fix – User fields no longer trigger a 404 when loading results if the nonce generated only contains numbers
  • Fix – Description fields for ACF items now support being solely numeric characters
  • Fix – The field group header no longer appears above the WordPress admin menu on small screens
  • Fix – The acf/json/save_file_name filter now correctly applies when deleting JSON files
  • i18n – All errors raised during ACF PRO license or update checks are now translatable
  • Other – The ACF Shortcode is now disabled by default for new installations of ACF as discussed in the ACF 6.2.7 release notes

6.2.10

Release Date 15th May 2024

  • Security Fix – ACF Blocks no longer allow render templates, or render or asset callbacks to be overridden in the block’s attributes. For full information, please read the release blog post

6.2.9

Release Date 8th April 2024

  • Enhancement – The Select2 escapeMarkup function can now be overridden when initializing a custom Select2
  • Fix – “Hide on Screen” settings are now correctly applied when using conditionally loaded field groups
  • Fix – Field names are no longer converted to lowercase when editing the name
  • Fix – Field group titles will no longer convert HTML entities into their encoded form

6.2.8

Release Date 2nd April 2024

  • New – Support for the Block Bindings API in WordPress 6.5 with a new acf/field source. For more information on how to use this, please read the release blog post
  • New – Support for performance improvements for translations in WordPress 6.5
  • Enhancement – A new JS filter, select2_escape_markup now allows fields to customize select2’s HTML escaping behavior
  • Fix – Options pages can no longer set to have a parent of themselves
  • Fix – ACF PRO license activations on multisite subsite installs will now use the correct site URL
  • Fix – ACF PRO installed on multisite installs will no longer try to check for updates resulting in 404 errors when the updates page is not visible
  • Fix – ACF JSON no longer produces warnings on Windows servers when no ACF JSON folder is found
  • Fix – Field and layout names can now contain valid non-ASCII characters
  • Other – ACF PRO now requires a valid license to be activated in order to use PRO features. Learn more

6.2.7

发布日期 2024 年 2 月 27 日

  • Security Fix – the_field now escapes potentially unsafe HTML as notified since ACF 6.2.5. For full information, please read the release blog post
  • Security Fix – Field and Layout names are now enforced to alphanumeric characters, resolving a potential XSS issue
  • Security Fix – The default render template for select2 fields no longer allows HTML to be rendered resolving a potential XSS issue
  • Security Enhancement – A acf/shortcode/prevent_access filter is now available to limit what data the ACF shortcode is allowed to access
  • Security Enhancement – i18n translated strings are now escaped on output
  • 增强功能 – ACF 现在普遍使用 WordPress 文件系统函数而���是本机 PHP 函数

6.2.6.1

发布日期:2024年2月7日

  • Fix – Fatal JS error no longer occurs when editing fields in the classic editor when Yoast or other plugins which load block editor components are installed
  • Fix – Using $escape_html on get functions for array returning field types no longer produces an Array to string conversion error

6.2.6

发布日期 – 2024年2月6日

  • Enhancement – The get_field() and other get_ functions now support an escape_html parameter which return an HTML safe field value
  • Enhancement – The URL field will be now escaped with esc_url rather than wp_kses_post when returning an HTML safe value
  • Fix – ACF fields will now correctly save into the WordPress created revision resolving issues with previews of drafts on WordPress 6.4 or newer
  • Fix – Multisite subsites will now correctly be activated by the main site where the ACF PRO license allows, hiding the updates page on those subsites
  • Fix – Field types in which the required property would have no effect (such as the tab, or accordion) will no longer show the option
  • Fix – Duplicating a field group now maintains the current page of field groups being displayed
  • Fix – Fields in ACF Blocks in edit mode in hybrid themes will now use ACF’s styling, rather than some attributes being overridden by the theme
  • Fix – Text in some admin notices will no longer overlap the dismiss button
  • Fix – The word link is now prohibited from being used as a CPT name to avoid a WordPress core conflict
  • Fix – Flexible content layouts can no longer be duplicated over their maximum count limit
  • Fix – All ACF notifications shown outside of ACF’s admin screens are now prefixed with the plugin name
  • Fix – ACF no longer checks if a polyfill is needed for <PHP7 and the polyfill has been removed

6.2.5

发布日期 2024 年 1 月 16 日

  • Security Fix – The ACF shortcode will now run all output through wp_kses, escaping unsafe HTML. This may be a breaking change to your site but is required for security, a message will be shown in WordPress admin if you are affected. Please see the blog post for this release for more information. Thanks to Francesco Carlucci via Wordfence for the responsible disclosure
  • Security – ACF now warns via an admin message, when upcoming changes to the_field and the_sub_field may require theme changes to your site to avoid stripping unsafe HTML. Please see the blog post for this release for more information
  • Security – Users may opt in to automatically escaping unsafe HTML via a new filter acf/the_field/escape_html_optin when using the_field and the_sub_field before this becomes default in an upcoming ACF release.

6.2.4

<em>发布日期:2023年11月28日</em>

  • Fix – Custom Post Types labels now match the WordPress 6.4 behavior for “Add New” labels
  • Fix – When exporting both post types and taxonomies as PHP, taxonomies will now appear before post types, matching the order ACF registers them. This resolves issues where taxonomy slugs will not work in post type permalinks
  • Fix – Advanced Settings for Taxonomies, Post Types or Options Pages now display with the correct top padding when toggled on
  • Fix – When a parent option page is set to “Redirect to Child Page”, the child page will now correctly show it’s parent setting
  • Fix – When activated as a must-use plugin, the ACF PRO “Updates” page is now visible. Use the existing show_updates setting to hide
  • Fix – When activated as a must-use plugin, ACF PRO licenses defined in code will now correctly activate sites
  • Fix – When show_updates is set or filtered to false, ACF PRO will now automatically still activate defined licenses
  • i18n – Maintenance and internal upstream messages from the ACF PRO activation server are now translatable

6.2.3

Release Date 15th November 2023

  • View Release Post
  • New – An ACF Blocks specific JSON schema for block.json is now available on GitHub
  • New – Flexible Content fields now show the layout name in the layout’s header bar and supports click-to-copy
  • New – Duplicating Flexible Content layouts now appends “Copy” to their name and label, matching the behavior of field group duplication
  • Enhancement – ACF PRO will now automatically attempt license reactivation when the site URL changes, e.g. after a site migration. This resolves issues where updates may fail
  • Enhancement – Presentation setting for “High” placement of the Field Group made clear that it’s not supported in the block editor
  • Fix – acf_format_date now ensures the date parameter is valid to prevent fatal errors if other data types are passed in
  • Fix – CPTs with a custom icon URL now display the posts icon in the location column of the field groups screen
  • Fix – The ACF JSON import form will now disable on first submit resolving an issue where you could submit the form twice
  • Fix – The “Add Row” button in the Flexible Content field now displays correctly when using nested layouts
  • Fix – Warning and Error notices no longer flicker on ACF admin pages load
  • i18n – ACF PRO license activation success and error messages are now translatable

6.2.2

Release Date 25th October 2023

  • Enhancement – ACF Blocks which have not been initialized by the editor will now render correctly
  • Enhancement – Added a new acf/filesize filter to allow third party media plugins to bypass ACF calling filesize() on attachments with uncached file sizes, which may result in a remote download if offloaded
  • Enhancement – ACF PRO license status and subscription expiry dates are now displayed on the “Updates” page
  • Fix – Product pages for WooCommerce version 8.2 or newer now correctly support field group location rules
  • Fix – Relationship field items can now be removed on mobile devices
  • Fix – Color picker fields no longer autocomplete immediately after typing 3 valid hex characters
  • Fix – Field settings no longer appear misaligned when the viewport is something other than 100%
  • Fix – Select fields without an aria-label no longer throw a warning
  • Fix – CPTs and Taxonomies with a custom text domain now export correctly when using PHP export

6.2.1.1

Release Date 8th September 2023

  • Fix – Editing a field group no longer generates an error when UI options pages are disabled

6.2.1

Release Date 7th September 2023

  • New – Options Pages created in the admin UI can now be assigned as child pages for any top-level menu item
  • New – Added a “Title Placeholder” setting to ACF Post Types which filters the “Add title” text when editing posts
  • Enhancement – ACF PRO will now warn when it can’t update due to PHP version incompatibilities
  • Enhancement – ACF PRO will now work correctly with WordPress automatic updates
  • Enhancement – The internal ACF Blocks template attribute parser function parseNodeAttr can now be shortcut with the new acf_blocks_parse_node_attr filter.
  • Enhancement – Removed legacy code for supporting WordPress versions under 5.8
  • Fix – The “Menu Position” setting is no longer hidden for child options pages
  • Fix – The tabs for the “Advanced” settings in Post Types and Taxonomies are now rendered inside a wrapper div
  • Fix – Options pages will no longer display as a child page in the list view when set to a top level page after previously being a child
  • Fix – Conflict with Elementor CSS breaking the ACF PRO banner
  • Fix – Errors generated during the block editor’s savePost function will no longer be caught and ignored by ACF

6.2.0

Release Date 9th August 2023

  • View Release Post
  • New – ACF now requires WordPress version 5.8 or newer, and PHP 7.0 or newer. View the release post for more information
  • New – Bidirectional Relationships now supported for Relationship, Post Object, User and Taxonomy fields. View the release post for more information
  • New – Options Pages can now be registered and managed by the admin UI in ACF PRO
  • New – Link to the product feedback board added to the plugin footer
  • Enhancement – ACF JSON now supports multiple save locations (props Freddy Leitner)
  • Enhancement – ACF Post Types and Taxonomies can now be duplicated
  • Enhancement – The filename for JSON files can now be customized with the acf/json/save_file_name filter
  • Fix – REST updates of fields with choices containing integer or mixed keys now behave correctly
  • Fix – Using the block_type_metadata_settings PHP filter to add usesContext values no longer breaks ACF blocks
  • Fix – Notice to import post types/taxonomies from CPTUI no longer flashes on page load
  • Fix – Various buttons for fields in blocks now display correctly
  • Fix – The settings for the DateTime field are no longer cut off when nested in several fields in the field group editor
  • Fix – The newline added to the end of JSON files will now use PHP_EOL to detect the correct newline character with a filter acf/json/eof_newline to alter it.
  • i18n – Updated French and Portuguese translations (Thanks to pedro-mendonca and maximebj)

View the full changelog