Options pages provide a UI for site-wide settings (logo, footer text, social links, etc.). Requires PRO license. Values are accessed using get_field( 'field_name', 'options' ).
Field Forge supports three registration paths — pick whichever fits your workflow. They coexist; values stored against a given slug are reachable regardless of how the page was registered.
| Path | Source | When to use |
|---|---|---|
Admin UI (Field Forge > Options Pages) | wp_fieldforge_options_pages table | Content managers want to add or rename pages without touching code |
Auto-register from a field-group location rule (options_page == ) | Field group definition | The page hosts exactly one field group; you don’t need a custom icon or position |
fieldforge_add_options_page([...]) PHP API | functions.php / plugin code | The registration should ship with the theme; you want full control over icon, position, capability, parent slug |
fieldforge_add_options_page( $args )
Full Parameter Reference:
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
page_title | string | 'Options' | Page title shown at the top | |
menu_title | string | 'Options' | Menu label in admin sidebar | |
menu_slug | string | 'fieldforge-options' | Unique slug for page URL | |
capability | string | 'manage_options' | Required capability | |
parent_slug | string | '' | Parent menu slug (empty = top-level) | |
icon_url | string | 'dashicons-admin-generic' | Dashicon class or image URL | |
position | int | null | null | Menu position |
Top-Level Options Page
add_action( 'init', function() {
if ( ! function_exists( 'fieldforge_add_options_page' ) ) {
return;
}
fieldforge_add_options_page( [
'page_title' => 'Theme Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-settings',
'icon_url' => 'dashicons-admin-customizer',
'position' => 2,
] );
} );Sub-Pages Under a Parent
add_action( 'init', function() {
if ( ! function_exists( 'fieldforge_add_options_page' ) ) {
return;
}
fieldforge_add_options_page( [
'page_title' => 'Site Options',
'menu_title' => 'Site Options',
'menu_slug' => 'site-options',
'icon_url' => 'dashicons-admin-site',
] );
fieldforge_add_options_page( [
'page_title' => 'Header Settings',
'menu_title' => 'Header',
'menu_slug' => 'site-options-header',
'parent_slug' => 'site-options',
] );
fieldforge_add_options_page( [
'page_title' => 'Footer Settings',
'menu_title' => 'Footer',
'menu_slug' => 'site-options-footer',
'parent_slug' => 'site-options',
] );
} );Accessing Options Page Values
$logo = get_field( 'site_logo', 'options' );
$phone = get_field( 'site_phone', 'options' );
// Repeater on options page
if ( have_rows( 'business_hours', 'options' ) ) :
echo '<table class="hours">';
while ( have_rows( 'business_hours', 'options' ) ) : the_row();
echo '<tr><td>' . esc_html( get_sub_field( 'day' ) ) . '</td>';
echo '<td>' . esc_html( get_sub_field( 'hours' ) ) . '</td></tr>';
endwhile;
echo '</table>';
endif;REST API for UI-managed pages
Pages added in the admin UI live in wp_fieldforge_options_pages and are exposed for headless / scripted management (PHP-API and field-group-rule sources are NOT in this table and are read-only via this endpoint). All routes require an authenticated request with manage_options.
GET /wp-json/fieldforge/v1/options-pages # list active rows (?include_deleted=1 to see soft-deleted)
GET /wp-json/fieldforge/v1/options-pages/{id} # one row
POST /wp-json/fieldforge/v1/options-pages # create — body: { page_title, menu_slug, capability, parent_slug, position, icon_url, ... }
PUT /wp-json/fieldforge/v1/options-pages/{id} # update — same body shape
DELETE /wp-json/fieldforge/v1/options-pages/{id} # soft-delete (status='deleted')Validation matches the admin UI: page_title and menu_slug required, slug must be unique, reserved Field Forge slugs (e.g. fieldforge-settings) are rejected. Errors return WP_Error-shaped JSON with code and message.
Lang Forge Integration
When Lang Forge is active, options page values are stored per language. From the template side, get_field() automatically returns the value for the current language.
// These calls automatically return the correct language value
$logo = get_field( 'site_logo', 'options' );
$phone = get_field( 'site_phone', 'options' );
$cta = get_field( 'cta_text', 'options' );
// Internal storage:
// Default (EN): option_page = 'site-options'
// French: option_page = 'site-options:fr'
// Spanish: option_page = 'site-options:es'—