| 开发者 | starbist |
|---|---|
| 更新时间 | 2026年9月28日 20:33 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<h1><?php echo esc_html( ycf_get_field( 'headline' ) ); ?></h1>
The Documentation page in the plugin explains every step in plain words.
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.
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.
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.
Yes. The fields are in a "Custom fields" box below the content. You don't need the Classic Editor plugin.
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.
Posts, pages and other public content types, like an "Events" type from a theme or plugin.
Only administrators change schemas and settings. Writers fill in fields on posts they may edit.
Nothing is lost. The content stays.
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.
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.
On GitHub. Please say what you did, what you expected and what happened.
ycf_get_fields() now shows the shared value too. Before, it ignored the tick.ycf_has_field() means "has a value". An empty text or an empty list is no value. An unticked box or a zero still is.[ycf] shortcode. Show a field without editing the theme. Works in a Shortcode block, a widget or the content.yaml_cf object. There are routes for site details and collections. You can save through it too, with the same checks as the editor.list: true. Pick many images at once. Reorder by dragging or with the keyboard.yaml_cf_picker_threshold filter.yaml_cf_field_value filter. Change any value before the theme gets it.singular.php (like Twenty Twenty) couldn't get page fields.ycf_get_field() and ycf_get_fields() could give different values for the same field.- info: and - section: caused warnings in shared fields and inside sections.ycf_get_image() with a custom size like [300, 200] crashed the page.2024) could be renamed by some saves.list: true to attach multiple files, with a dedicated admin UI for adding and removing fileslist: true is set, ycf_get_file() returns an array of file-data arrays instead of a single oneycf_get_field() now automatically retrieves template global data