Yep you can use add_settings()
to create the setting itself. There is an example in the codex.
This example code could go in your themes functions.php
file or in a plugin file, it’s up to you.
Then in the header template all you would have to do is use an if
statement to check what the value of the aforementioned setting was and either output the JS
link or not based upon this variable.
Related Posts:
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Add Plugin options as subpage to Theme options page
- ‘Global’ settings page for multisite plugin
- Contact form 7 select box different value-text than content-text in option [closed]
- Correct way to serialize the data of options table?
- Where should I use get_option in a plugin
- Inherit plugin settings to new site in Multisite
- How to tell if plugin has been network activated
- How to find out if option exists but is empty?
- Custom plugin settings: clicking “save changes” does not display success message
- Network-Wide Plugin Settings Management
- How to create a Page alias in WordPress
- How to fetch serialized data from wordpress options
- Some Plugin Settings Are Kept After Removal and Reinstall of the Plugin
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Get all options saved by another plugin
- How to load default scripts included with WordPress correctly?
- Is it ok to call get_option without hooks?
- Enable/Disable WP options programmatically
- Custom options page checkbox will not save, despite working with text
- Add a Custom Permalink option in the Permalink Admin Screen?
- Settings API – input always updates over validation
- add function to saving change on Options Pages
- How to set CORS header?
- Restore a Plugin’s Default Settings
- add action wp_head not working
- How to debug register_setting callback function
- Default Plugin Settings Not Writing to Database
- Update Option Error: Notice: Undefined index
- Set the active Navigation Menu from a plugin
- Serialize data for wp options
- Why slash is removed after domain?
- How to add a default value to get_option if it’s used as a variable?
- Redux Framework has an embedded demo. Click here to activate the sample config file
- WordPress get_option and update_option returned entered on the textbox field
- Get plugin option in another PHP file
- Image upload and other options in the same plugin settings form?
- How to remove traces from widget during uninstallation
- php page not found for plugin options menu
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Enabling plugin failed because MySQL user do not have CREATE permissions
- Getting Theme element into plugins page editor in wp admin
- options creation for plugins
- How to create an option page for this simple plugin
- get_option error plugin development
- Gathering and logging data from a plugin: how to do it without race conditions?
- Elementor: How to override global theme style settings? [closed]
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- WordPress error: Options page Setting_ not found in the allowed options list
- Allowed memory size exhausted problem
- Plugin getting Cannot modify header information errors
- How to add options to the plugin page?
- Saving widget options from class method
- get_option / wp_localize_script Not Working in OOP Plug In
- OceanWP settings are missing from Add New Post [closed]
- Change in one place the data about the company, which are placed on several pages
- Plugin scheduled event not working
- How to save plugin custom settings page fields
- How to reinstate previously saved option?
- Store plugin page content in wp_options?
- Changing plugin options from theme functions file?
- How to make a textarea accept javascript in my settings apge?
- How do you add a settings page to another menu?
- Localise settings section headline
- Need to add/remove group of options and display them as rows
- How to get values from network settings panel?
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Using call_user_func() within add_settings_section() within a Class
- How to make sure settings are not lost when plugin is updated?
- wp_options not returning value for logged out users?
- how to show new field if option selected?
- Problem with MEMCACHE and Redis with wp_options
- Changing the CSS with a plugin
- Swap themes locally
- Optimized PHP & WordPress settings for speed/performance?
- WP options plugin setting not saving the selected checkboxes
- Enable plugins that are “not supported”
- Admin Custom Login loses settings on Code and Data migration
- How do I add a textarea (multirow) option to my WordPress plugin?
- Registered sidebar area is not shown from plugin.
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- why my wordpress dont have toolbar like, plugin, themes and other?
- Why is the WordPress update_option not working in this code?
- database – multiple wordpress installations using same database – can they share plugin settings?
- WordPress update plugin through Dashboard/Plugins displaying error
- How to create a new database table whenever user changes options
- Option page not updating multiple records in settings api
- get_option returning old value for non-admin users
- Error when renaming option
- Validating values using Settings API?
- get Options value in “external” page
- how to protect wordpress website
- homepage olderposts link showing page not found
- WP e-commerce sales-view
- My first plugin doesn’t save the data in options
- Site is setup statically – how to make it content managable?
- selecting options from another form
- How to access values from your own settings page in javascript?
- Multiple plugins settings of same developer into ONE settings page linked together