Linux 软件免费装
Banner图

YAML Custom Fields

开发者 starbist
更新时间 2026年9月28日 20:33
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

content custom fields fields schema yaml

下载

1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0.0

详情介绍:

YAML Custom Fields adds boxes to fill in on pages, like "Headline", "Team photo" or "Event date". Writers fill them in. The website shows them in the right place. You list the fields of each page template in a short text, called a schema. Each field takes a few lines. What it does Field types How it works
  1. Go to YAML CF and switch on Custom fields for a template.
  2. Click Create schema and list the fields:
`fields: <h1><?php echo esc_html( ycf_get_field( 'headline' ) ); ?></h1> The Documentation page in the plugin explains every step in plain words.

安装:

  1. In the WordPress admin, go to Plugins → Add New.
  2. Search for "YAML Custom Fields".
  3. Click Install Now, then Activate.
  4. Go to YAML CF in the menu on the left.
For a ZIP file, use Plugins → Add New → Upload Plugin. Requirements Everything else is included.

屏幕截图:

  • The schema editor for a template.
  • The schema editor for a site part, like the header.
  • The content of a site part.
  • The Documentation page, written in plain words.

升级注意事项:

2.0.0 Back up first. Needs WordPress 6.4+. The shared value tick now wins in ycf_get_fields(), and a page value beats a site detail with the same name. Schemas with mistakes are refused. The database is tidied once, by itself. 1.2.6 Important fix for code fields. HTML/JavaScript/CSS code is now properly preserved using base64 encoding. Re-save any code fields that previously had content stripped. 1.2.5 Bug fix for code field sanitization. Code fields now preserve raw content correctly without premature HTML entity encoding. 1.2.4 Asset folder reorganization for better WordPress.org compliance. All functionality remains unchanged. 1.2.3 Bug fix for dynamic block fields. Taxonomy, post type, and data object fields now render correctly when adding blocks dynamically. 1.2.2 Important security update with nonce verification fixes. Updated to PHP 8.1+ requirement with Symfony 6.4 compatibility. 1.2.1 Fixes for export/import functionality and template global field handling. Recommended update for better data portability. 1.2.0 Major feature update introducing Template Global Fields for shared default values across posts using the same template. 1.1.0 Code quality improvements, consolidated Export/Import page, and enhanced security. All functionality remains backwards compatible. 1.0.0 Initial release of YAML Custom Fields.

常见问题:

What is a schema?

A short list of the fields a page gets. Each field has a name, a label and a type. It's written in YAML, a simple text format with one setting per line.

Do I need to code?

Writers don't. They only fill in fields. To show fields on the website, the theme needs one line per field. The Copy code button next to each field copies that line for you.

Does it work with any theme?

Yes, classic and block themes. A child theme is scanned together with its parent, so the parent's templates are listed too. Block themes have no template files to edit. Use the [ycf field="name"] shortcode in a Shortcode block.

Does it work with the block editor?

Yes. The fields are in a "Custom fields" box below the content. You don't need the Classic Editor plugin.

Is there an API?

Yes, the WordPress REST API. Every page and post has a yaml_cf object. There are also routes for site details and collections. The Documentation page has the details.

Which content types are supported?

Posts, pages and other public content types, like an "Events" type from a theme or plugin.

Who can change the setup?

Only administrators change schemas and settings. Writers fill in fields on posts they may edit.

What happens when I turn the plugin off?

Nothing is lost. The content stays.

What happens when I delete the plugin?

All its data is removed: schemas, site details, collections and page content. To keep the content, tick Keep the content if the plugin is deleted under YAML CF → Settings first.

How do I move content to another site?

Use YAML CF → Export & Import to save it to a file. Images and files aren't in that file, so copy the media library too. Then Content Check finds anything missing.

Where do I report problems?

On GitHub. Please say what you did, what you expected and what happened.

更新日志:

2.0.0 Changed New Better Fixed Security Removed Updated 1.2.9 1.2.8 1.2.7 1.2.6 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.0 1.0.0