Theme Options
Method registers one options page, Method Settings, as a top-level admin menu item (position 2, with Method’s own icon). It is a CMB2 options page, which is why CMB2 is a required plugin, and everything on it is stored in a single option, method_options. The fields are declared in lib/theme-options.php.
This page is about the settings a site administrator fills in. The configuration a child theme supplies in code — breakpoints, breakpoint colors, font-size presets — is a different thing: the METHOD_OPTIONS constant in lib/config.php, overridden by a child theme’s METHOD_CHILD_OPTIONS. The panel shows the loaded configuration in its Diagnostics section, but never edits it.
Reading a setting
Two routes, used side by side in Method itself:
// Through Method_Utility (the option key comes from the method_utility_option_key filter;
// Method's own callback returns 'method_options')
$util = new Method_Utility;
$tag = $util->get_option( 'ga_id', '' );
// Or straight from the option, which is how the Breadcrumb and Mapbox Map blocks read it
$options = get_option( 'method_options' );
$sep = ! empty( $options['bc_sep'] ) ? $options['bc_sep'] : '/';
Group fields (Social Media Links) come back as an array of rows; everything else is a scalar. Checkboxes are on when checked and absent when not, so test them with ! empty().
Sections and fields
Social Media Links
| Field | Key | Type | Read by |
|---|---|---|---|
| Link {#} (repeatable, sortable group) | social_accounts | group | method_build_social_nav_items() → the Social Nav block. |
| Service | social_accounts[n][service] | radio_inline | Choices come from method_get_options_page_social_options(), built from method_get_social_platforms(); add a platform with the method_available_social_platforms filter. |
| Profile URL | social_accounts[n][url] | text_url | The link target. A row with a service and no URL renders as an icon without a link. |
Breadcrumb Trail Configuration
Read by the Breadcrumb block when it builds a trail. The per-type fields are generated at runtime from get_post_types() and get_taxonomies() (public, not built in), so a child theme’s post types appear here without any registration.
| Field | Key | Type | Effect |
|---|---|---|---|
| Include Home | bc_home | checkbox | Adds a link to the front page as the first item of every trail. |
| Include Current Item | bc_current | checkbox | Adds the item being viewed as the last item (no link). |
| Seperator | bc_sep | text_small | Character between items; / when empty. |
| Seperator Inclusion | bc_sep_inclusion | checkbox | Keeps the separator after the last item too. |
| Posts › Parent Page | bc_post_behavior | select | The base of the trail for posts: the posts archive, or a page from method_get_hierarchical_page_options(). |
| Posts › Archive | bc_post_archive | checkbox | Include the posts archive as a trail item. |
| Posts › Archive Label | bc_post_label | text | Label for that item; the post type label when empty. |
| {Post type} › Parent Page | bc_{post_type}_behavior | select | One set per public, non-built-in post type. Types with an archive also get bc_{post_type}_archive and bc_{post_type}_label. |
| Categories › Parent Page | bc_category_behavior | select | The base for category term trails. |
| Tags › Parent Page | bc_post_tag_behavior | select | The base for tag term trails. |
| {Taxonomy} › Parent Page | bc_{taxonomy}_behavior | select | One per public, non-built-in taxonomy. |
Google Analytics
| Field | Key | Type | Read by |
|---|---|---|---|
| Add Tag | ga_enable | checkbox | method_inject_gtag() on wp_head. |
| Tag ID | ga_id | text_medium | Printed into the gtag.js snippet when both fields are set. A GA4 measurement ID (G-…). |
Additional Information
Two read-only textareas (save_field => false, so nothing is stored): Diagnostic Details — Method version, child theme version (THEME_VERSION, when the child defines it), WordPress version, user agent, PHP version — and Loaded Theme Data, a dump of METHOD_CHILD_OPTIONS if defined, otherwise METHOD_OPTIONS, with a note saying which.
HTTP Auth Support
| Field | Key | Type | Read by |
|---|---|---|---|
| Enable Support | http_auth_enabled | checkbox | An http_request_args filter in lib/theme-setup.php. |
| User | http_auth_user | text | Combined into an Authorization: Basic header. |
| Password | http_auth_pass | text | Stored in plain text in the option; use the host’s basic-auth credentials, never a WordPress login. |
When all three are set, WordPress’s own HTTP requests to the site’s host (loopback requests, the block editor fetching styles through the REST API) carry the header, so an environment behind basic auth stops failing those loads. Requests to other hosts are untouched.
Extending the panel
- The
method_options_before_fieldsaction fires with the CMB2 box right after it is created and before Method adds its own fields, so fields added there appear at the top of the panel and are stored in the samemethod_optionsoption. - The
method_utility_option_keyfilter changes which optionMethod_Utility::get_option()reads. Method registers its own callback returningmethod_options; a plugin can point it elsewhere. - The cmb2-mapbox plugin is an example of both: with its Method integration on, it adds a
mapbox_api_tokenfield to this panel, and the Mapbox Map block reads that token frommethod_optionswhen nomethod_mapbox_tokenfilter supplies one.