You can use the get_option
function on the back-end too. There are several possibilities on how to pass your option value to your script:
- Use
wp_localize_script
function to pass PHP values to your script (see WordPress Codex page for this function). - Print your option value along with
name
andname2
values inside ascript
tag. - Use AJAX. When user clicks your checkbox A, you send an AJAX request to the server requesting the value of your option.
The rest is just a matter of joining all the pieces together and putting them inside your textfield using jQuery.
Related Posts:
- Best practices for a Style/CSS based theme options page?
- How do I create my own admin button and theme settings page?
- Moving WordPress.com theme and widget settings to self-hosted site?
- Multisite: setting theme and options when a new blog is created
- Copying theme from Localhost to Live does not copy all theme settings with it?
- Register theme customizer settings when theme activates [duplicate]
- How to mark an option as selected
- Add transparency to wordpress color picker?
- Working with an Array inside Your Theme Options Array – Multiple Values
- Add a series of checkboxes to theme options
- What’s the order of loading wordpress elements?
- loss of theme options while site deployment in production
- Theme settings default, strange behavior before first save
- How to find out if page_for_posts is showing (in order to style menu item)
- New custom theme option (text input) giving index error
- Full page (no WP admin menus and options) admin theme options
- How to dynamically change theme’s slogan from admin?
- Passing dynamic options from backend to frontend
- Problems to disable the comments for my statics pages
- WordPress setup one database with two different website?
- How to include stylesheet in custom admin using parent_slug
- What’s the easiest way of adding more options in the Theme Options of the twenty eleven theme?
- How to implement theme option to change bootstrap 4 container from .container to .container-fluid
- Can i add wordpress editor to my custom theme option? [closed]
- Theme Options Menu Item – Permission Issue
- How to Link External jQuery/Javascript files with WordPress
- Am I allowed to license my WordPress theme under the aGPL
- Best way to include Bootstrap in WordPress
- How to license my commercial WordPress theme? [closed]
- How to Use WordPress as Static CMS Without Blog Posts
- Jquery in Child Theme
- Changing the visible url path to css & js files
- How to automatically highlight syntax of code in a post?
- Retaining old HTML archives and displaying themes conditionally
- Extra User Profile Field Upload File / Image
- Theme Activation, Create Database Tables
- Alternate header image
- Change logo on each page of University Hub theme [closed]
- Delete database tables on theme uninstall?
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- How do you manage your theme versions when privately distributing?
- wordpress themes demo file importing problem? [closed]
- How to run word press theme on localhost in Ubuntu OS?
- get_template_directory has an odd functionality
- Confit theme on WordPress.org
- How to set different settings for a mobile theme?
- Problem after renaming wordpress template file
- 100% width Featured Image Size
- What’s the proper way to include inlined javascript-source?
- How can I display/hide certain content based on a Theme Option field?
- Make it possible to pick a color theme for specific pages
- How can I use a logo in the header?
- the_content() is not displaying content, why? [closed]
- Unwanted edit link on front page
- Need help with making a website where user can add products
- Frameworks for Premium Theming [duplicate]
- Remove problem PHP code entered into footer via Theme
- What is the “pub” theme? [closed]
- Can I change the WordPress default color?
- Enqueue custom css file on specific page
- How to put single-***.php in a specific folder?
- Using JQuery to check for Rel Attribute of Image before Overriding It
- Is a very simple theme secure enough?
- New WordPress Theme Not Showing in Blog
- Theme Modified By Updates
- I want to develop a theme using WordPress. Which theme should I start from or develop from scratch? [closed]
- Background image appears on localhost site but not online
- Remove Commenting on Certain Pages
- Error when installing theme – “failed to open stream: No such file or directory in…”
- disable default widgets in Responsive theme
- Theme seems to have different options on wordpress.com and own-server install
- Cannot update a file for my theme
- Do all themes accommodate all features?
- How to reduce Header at the top of the page
- Custom fields not displaying on front end
- Change “published by”
- how to notify users about new theme updates?
- Theme check warning about text domain
- dynamic image path within a javascript file
- WP Customize API Checkbox change value
- Updating a theme
- Background image not showing up
- How to display post meta data in secure manner
- theme continuous deployment from bitbucket to windows azure
- Changing themes on locally hosted webpages
- What is the template file for topic layouts in bbPress?
- Will this js code work in a page template?
- Showing wordpress theme demo at front end
- separate home page into separate pages
- Moving WordPress with Super Skeleton theme
- How can I allow a client to edit certain parts of a static site?
- A problem with functions.php file on my WordPress site
- hardened wordpress linux install
- change template with button
- How do I remove the dash (-) between my Site Title and Tagline?
- WordPress Theme redirects to the Index page – Theme customizer problem
- Obtaining the original unchanged Theme [closed]
- How to assign posts to different themes? [closed]
- Using AJAX to Update WordPress Theme
- Remove image next to header image on WellExpo theme [closed]