Skip to main content

Create a Site Settings Page in Secure Custom Fields with AI

Get one admin-only page in wp-admin for the details your whole site shares.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running Secure Custom Fields 6.9.10 or newer (free, tested on 6.9.10) on WordPress 7.1 or newer (tested on 7.1.5), with an administrator account and Abilities API left on under SCF, Settings.

The prompt
My WordPress site uses Secure Custom Fields (SCF). Create a settings page called [page name] with these fields: [for example support phone as text, promo banner as text].

If a reply from a read-only ability ends with a note starting --- TRUNCATED, run that ability again with max_length 100000. If it is still cut, stop and tell me. Never conclude that a group or field is missing from a cut reply. If a create or change is cut, do not run it again: read the result back.

1. Run discover_abilities with category scf-ui-options-pages and confirm scf/create-ui-options-page is there, and with category acf-field-management and confirm acf/register-field-group is there. If they are not, stop and check GET /wp/v2/plugins?_fields=plugin,name,status. If Advanced Custom Fields or ACF PRO is active, tell me this recipe is written for Secure Custom Fields and do not suggest installing SCF, because activating it deactivates them. If you cannot tell, do not suggest installing SCF until I confirm neither is active. Otherwise tell me to install or update the free Secure Custom Fields plugin (6.9.10 or newer, on WordPress 7.1 or newer) and check that Abilities API, Post Types & Taxonomies UI (for post types and taxonomies) and Options Pages UI (for options pages) are on under SCF, Settings.
2. Run scf/list-ui-options-pages and note every menu slug. If it returns an error, stop, tell me which check could not run, and create nothing. SCF accepts a second page with a slug already in use, and only the first one works, and this list does not show options pages added in code, so choose one none of them uses, made of a word from my site's name, a word from the page name and four random lowercase letters or numbers, for example acme-settings-k7q2. Propose the page title, menu title, menu slug (lowercase letters, numbers and hyphens) and the fields with their types. Run scf/list-fields with filter name set to each proposed field name, and find each result's group in scf/list-field-groups by its parent. Choose a different name if that search returns an error, or unless every location rule of the result's group is post type or taxonomy is equal to something, because options pages share storage and two fields with one name overwrite each other. Run scf/list-fields with filter type set to group, and treat as taken every name made of a group field's name, an underscore and a name in its sub_fields, at any depth, because SCF stores sub field values under those combined names. Run scf/list-fields with filter type set to clone. If either of these two lists returns an error, or the clone list returns any field, tell me that the stored names of group or clone fields cannot be checked, and wait for my yes before going on. Warn me not to store passwords or API keys on this page. Wait for my yes.
3. Run scf/create-ui-options-page once with a key (ui_options_page_ followed by the slug without hyphens), title, page_title, menu_title, menu_slug and capability set to manage_options. Always set the capability: SCF's default is edit_posts, which lets authors and contributors open this page. If this returns an error, stop, tell me nothing was created, and do not retry.
4. Run acf/register-field-group once with a title (the page title), the fields, show_in_rest off, and a location rule of options_page is equal to MENU_SLUG. Leave out the field keys so SCF generates them. If this returns an error, stop, tell me the page was created and the field group was not, and do not retry or delete anything.
5. Read the page back with scf/get-ui-options-page and confirm the capability is manage_options. Run acf/field-groups and confirm the fields are there.
6. Tell me where the page is in the wp-admin menu and that I fill in the values there. Tell me the values will not show on my site until my theme or a block displays them. Do not add code.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Create a Site Settings Page in Secure Custom Fields with AI” recipe from the WPVibe cookbook on my connected site.

Your support phone number, a promo banner, the footer address: details used across the whole site need one place to live. Without one they end up hardcoded in a template or repeated on every page, and changing them means hunting each copy down.

The AI builds an options page in SCF with the fields you list, and gives it a menu slug with a random ending, so it does not clash with another options page, even one added in code. SCF lets anyone who can edit posts open a new options page by default, contributors included, so the AI limits it to administrators. Then it reads the page back to confirm that limit and the fields.

You fill in the values yourself on the new page in wp-admin. Do not store passwords or API keys there. The values will not appear on your site until your theme or a block displays them, and the AI will not add code to do that.

Outcome

A new settings page in wp-admin, open to administrators only, with your fields on it, ready for you to fill in.