How to configure ThemePlus for your theme using themeplus_framework_config().
Overview
themeplus_framework_config() is the single function that tells ThemePlus who it belongs to. Call it once from your theme’s after_setup_theme hook and ThemePlus will use your theme’s name, menu slug, option key, and icon throughout — making the options panel appear entirely under your theme’s identity.
Basic Example
add_action( 'after_setup_theme', function () {
if ( ! function_exists( 'themeplus_framework_config' ) ) {
return;
}
$theme = wp_get_theme();
themeplus_framework_config([
'display_name' => $theme->get( 'Name' ),
'opt_name' => 'my_theme_options',
'menu_slug' => 'my-theme-settings',
'menu_title' => __( 'Theme Settings', 'your-textdomain' ),
'menu_icon' => 'dashicons-admin-appearance',
'text_domain' => 'your-textdomain',
]);
} );
Full Configuration Reference
themeplus_framework_config([
// Identity
'display_name' => 'Nijhum Theme', // Your theme name
'display_version' => '1.0.0', // Your theme version (optional)
// Database
'opt_name' => 'nijhum_options', // MUST be unique per theme
// Admin menu
'menu_slug' => 'nijhum-settings',
'menu_title' => __( 'Nijhum Settings', 'nijhum' ),
'page_title' => __( 'Nijhum Theme Options', 'nijhum' ),
'menu_icon' => 'dashicons-admin-appearance',
'menu_position' => 61,
'capability' => 'edit_theme_options',
// Features
'admin_bar' => true,
'show_search' => true,
// i18n
'text_domain' => 'nijhum',
]);
Configuration Options
display_name
Type: string
Your theme’s display name. When provided, ThemePlus uses it to automatically generate menu_title and page_title if those are not explicitly set.
'display_name' => 'Nijhum Theme',
display_version
Type: string
Your theme’s version string. Optional — used for display purposes only.
'display_version' => '1.0.0',
opt_name
Type: string
The WordPress option key used to store all theme settings in the database. Passed directly to get_option() and update_option().
Important: This must be unique per theme. If two themes share the same
opt_name, their settings will collide in the database. Use something specific to your theme — for examplenijhum_optionsormytheme_v2_options.
'opt_name' => 'nijhum_options',
menu_slug
Type: string
The URL slug for your theme’s options page. Appears in the browser address bar as /wp-admin/admin.php?page=your-slug.
'menu_slug' => 'nijhum-settings',
menu_title
Type: string
The label shown in the WordPress admin sidebar menu.
'menu_title' => __( 'Nijhum Settings', 'nijhum' ),
page_title
Type: string
The title shown in the browser tab and at the top of the admin page.
'page_title' => __( 'Nijhum Theme Options', 'nijhum' ),
menu_icon
Type: string
The icon shown next to the menu label in the admin sidebar. Accepts any WordPress Dashicon slug or a base64-encoded SVG data URI.
// Dashicon
'menu_icon' => 'dashicons-admin-appearance',
// Custom SVG (base64)
'menu_icon' => 'data:image/svg+xml;base64,...',
menu_position
Type: int — Default: 59
The position of your theme’s menu item in the WordPress admin sidebar. Lower numbers appear higher. Common reference points: Posts = 5, Pages = 20, Appearance = 60, Plugins = 65.
'menu_position' => 61,
capability
Type: string — Default: manage_options
The WordPress capability required to access the options panel and all ThemePlus REST API endpoints. Use manage_options for administrators only, or edit_theme_options to also allow users with the Theme Editor role.
'capability' => 'edit_theme_options',
admin_bar
Type: bool — Default: true
Whether to show a quick-access link to your theme’s options panel in the WordPress admin bar.
'admin_bar' => true,
show_search
Type: bool — Default: true
Whether to show the live search box in the sidebar. When enabled, users can instantly search across all field titles, subtitles, descriptions, and IDs.
'show_search' => true,
text_domain
Type: string — Default: themeplus
Your theme’s i18n text domain. ThemePlus uses this to store a reference to your theme’s domain — but your theme is responsible for translating its own config strings. Every string you pass into themeplus_framework_config() or themeplus_add_section() should already be wrapped in __()with your own text domain. ThemePlus only translates its own internal fallback strings.
'text_domain' => 'nijhum',
Developer Panel and Dev Mode
The Developer Panel activates automatically — you do not need to configure it. ThemePlus detects the development environment behind the scenes using this priority order:
When any of these conditions is met, the Developer Panel section appears in the sidebar automatically. To force it off regardless of environment, define the constant explicitly:
define( 'THEMEPLUS_DEV', false );
See the Developer Panel article for full details.
Safety Check
Always wrap the call in a function_exists() check. This ensures your theme degrades gracefully if ThemePlus is not installed or not yet active:
if ( ! function_exists( 'themeplus_framework_config' ) ) {
return;
}Default Values
If you do not provide a value for an option, ThemePlus falls back to its own defaults:
| Option | Default |
|---|---|
opt_name | themeplus_options |
menu_slug | themeplus |
menu_title | ThemePlus |
page_title | ThemePlus Options |
menu_icon | ThemePlus SVG icon |
menu_position | 59 |
capability | manage_options |
admin_bar | true |
show_search | true |
text_domain | themeplus |