If a user can not change them then they are not options, they are constants. Declare them using const
in your maim theme file (probably functions.php
but any other files that is being always loaded will do), and use them wherever you have use the “options” array now.
If you want to control it without editing you theme files, you can use a conditional define
instead (check if value is not defined yet and if not define it). That way you will be able to override the default values by defining them at the wp-config.php
file per site.
… But this all question sounds wrong. The DB is there, so just use it, and a basic UI to control the options is easy to come up with. There is no real reason to resort to code changes every time you want to active/deactivate a module.
Related Posts:
- How to store widget fields data as an array?
- How To Add New Option Types To Option Tree?
- How does WordPress decide what template to use as frontpage
- get_option function
- Get category slug and display it on a query_post
- Override Current Theme Setting in wp_config.php
- Why might $input (Settings API) be coming through empty?
- Multiple Custom_Background, is it possible?
- Static Front Page problem
- two tinyMCE editors in the same page
- Cannot update WordPress General Settings Site Title and Tagline
- How to upload images using Settings API
- Theme settings keep getting reset/erased
- Where should I update_options in a theme?
- How can I display/hide certain content based on a Theme Option field?
- How can I make my options in an array and store theme in WP options one DB row?
- How to Call pages from a Options Panel
- Efficiency of wp_options vs a new table
- How to set wp_options in functions.php for removeing the Default Front Page
- Override plugin option by with a custom theme
- not getting API setting saved confirmation message after update on option page
- Update Specific Key Value in Complex `wp_options` object
- How to remove permalinks links presents in each page of my site?
- Tabbed theme options query about add_settings_section callback function
- Unable to delete option
- Theme Option’s Save Button is not working
- Change admin bar to default:off
- How to add a 2nd “featured image” to a post?
- What is the difference between WP: template_directory vs TEMPLATEPATH
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Adding Content Areas to Custom Page Template
- Add class to before_widget for all widgets with a dropdown and a counter
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Override default cropping in WordPress [duplicate]
- How to use Iris color picker on front-end?
- First post of each category
- create blocks programmtically on theme activation
- Possible to add “Template” selector to posts?
- How to keep theme layout the same when admin gray bar is present?
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- Adding LazyLoad and InfiniteScroll to WordPress Theme
- WordPress default theme css units
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- How to remove class attributes from custom menu markup?
- If I build a custom theme, will it update?
- Implement content-nosidebar.php / content-leftsidebar.php
- Users table association with users_metadata table appears broken
- Injecting a custom sql query into a page/theme
- What are the Entry classes for?
- Using an if statement in the theme customizer page
- Installing WordPress locally
- Custom markup with wp_nav_menu based on pages
- How to edit my theme for full width?
- Force Balance Tags not working
- Fetch wordpress video attachment with post ID
- Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
- Why does has_nav_menu return false when get_registered_nav_menus shows the opposite?
- Displaying icon image for WordPress post formats, is there a cleaner way to do this?
- How can I develop multiple widgets for a WordPress theme?
- How to create first post, fifth post full width, rest in three columns and so on
- How to seperate static phrases from template files in custom theme?
- How can I compare publish and update dates for a single post?
- How to code custom special page
- Displaying the right content on a page url
- Is it possible to set a variable for get_post_meta?
- Custom admin logo not showing after wordpress 4.5 upgrade
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- Translate a child theme with pure PHP and gettext
- Remove h1 from 2015 theme
- Only the latest post shows up on post page?
- WordPress pulling in random page themes
- Trouble in enquing all js files under certain directory
- Can’t change theme name
- Pagination: Keep prev and next link even on the first/ last page
- multiple queries to get posts from same category?
- Stop WordPress from showing images on non post pages
- enqueuing external and internal js and css in wordpress did not work with owl.js animate.css
- Attribute form NumberControl doesn’t update when I update page before it lose its focus
- Next and previous post link shows error in first and last post
- Problem with pagination link (error 404)
- WordPress wp_get_current_user returning blank values until refresh
- use a single nonce in three different nonce field
- Whether an tag is required in header?
- Theme is Enqueueing Everything in Footer
- Local theme changes upload on server but theme changes not showing
- Media & Plugin screens stall
- wp_kses allow checkbox class and checked
- Is wp_mail plugin territory?
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- Understanding WordPress theme files and underscores
- New theme HTML5 Support for Search in WordPress 4.4
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- Create a variable with string, array or multiple values
- What hook to use for loading a custom class extension during Theme initialization?
- What are these variables and where are they documented?
- Use external fonts in WordPress stylesheet
- Custom link color or stylesheets
- What is the advantage of using home.php over index.php for the front page
- Add wrapper for a specific sub-menu
- Theme’s featured image option is not showing up