Theme Options: Finding Default Option Attributes

If you’re really looking to dive into making customizations to the theme options page, you’re going to want to dig in and get your hands dirty in the files of the theme. While all of your customizations are obviously going to come from your child theme (or possibly a plugin), you still want to be able to look at files of the theme to determine what you’re editing.

  1. If you’re looking to retrieve the value of an existing option, you’ll need to know the ID of the option.
  2. If you’re adding an option, you’ll need to know the ID of the section you want to add it to, and the ID of the tab that section belongs to.
  3. If you’re removing or editing an option, you’ll need to know the ID of the option, the ID of the section you want to add it to, and the ID of the tab that section belongs to.
  4. If you’re adding a new section of options, you’ll need to know the ID of the tab, you’re adding it to.
  5. If you’re removing a tab, you’ll need to know the ID of that tab.

Ok, so how do you find these things? — This is probably going to take investigating a little bit through the files of your theme. This is why it’s good to have a copy of the theme on your local computer and be able to open it up in a code editor.

The options of your theme can be at (1) the framework level, (2) the theme level, or the (3) theme base level, if your theme uses theme bases.

Is it at the framework level?

For all options at the framework level, see the following file of the parent theme:

/framework/api/class-tb-options-api.php

You can see where all of the framework sections and options are established.

And further down, you can where this data is merged to create the top-level tabs.

Is it at the theme level?

Out of all our themes, Jump Start is the only one that doe NOT incorporate any option modifications at the theme level. So, if you’re using any other theme, you’ll find some of the options set at the theme level.

To see all of the option modifications made at the theme level, see the following file of the parent theme:

/includes/options.php

The file will contain a function named {theme_name}_options(), where you’ll see the Theme Options API functions being used to modify the theme options page, from the framework defaults.

Is it at the theme base level?

The only themes that have theme bases are Jump Start and Denali.

To see all of the option modifications made at the theme base level, see the following file of the parent theme:

/base/{your-base}/base.php

The file will contain a function named {theme_name}_{base_shorthand}_options(), where you’ll see the Theme Options API functions being used to modify the theme options page, from the theme defaults.

This can be a bit confusing, and that’s why it’s best to utilize the “developer” theme base if you’re making heavy customizations. With your theme’s “developer” base active, it will not change any options. So, you won’t have to worry about overriding any theme option modifications from the theme base level.