Solved by updating the second value in get_option
like
$location = get_option('location_select', 'ch');
Codex Reference:
https://developer.wordpress.org/reference/functions/get_option
Related Posts:
- Enqueue scripts in footer
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- How to include PHP files in plugins the correct way
- How to add a javascript snippet to the footer that requires jQuery
- How to include jQuery and JavaScript files correctly?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Load js/css files only on specific admin UI pages
- Get list of scripts / styles and show file which enqueued them
- Using OOP plugin’s methods throughout the website
- jQuery in header or footer
- Enqueue script only when shortcode is used, with WP Plugin Boilerplate
- How do I conditionally enqueue script for CPT single post type with plugin?
- function triggered by “manage_users_custom_column” filter not working
- How can I change the frequency of a scheduled event?
- WordPress plugin how to run function when button is clicked
- Shortcodes, output buffering, and WordPress functions
- Determine which theme location a wp_get_nav_menu_items is for
- When to check if a function exists
- Checking for existence of a page by title?
- Script won’t load via plugin class
- Check if I am in the Admin Panel (wp-admin)?
- What is the difference between current_page_parent and current_page_ancestor?
- Does add_filter work outside functions.php
- What function to hook for changes made in status and visibility of a post
- Inserting JS snippet in the footer if there is no wp_footer?
- Can’t get JS code to work with shortcode
- how to use preg_replace for wordpress video?
- How do I add a javascript file to all admin pages via a plugin?
- wp_enqueue_script + wp_enqueue_style Since When
- WordPress setting with select – where is my mistake?
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- WordPress after content Hook & external template part
- Retrieve contents/page names of various pages for use in a plugin
- Can wp_list_comments output into variable?
- is user logged in not working
- Can I change header.php of current theme through a plugin function?
- get_current_screen() return null
- Is there a way to ensure plugin script loads before another script?
- Override class inside $atts shortcode_atts in WordPress
- conditionally load javascript & CSS for do_action() calls from plugin
- What stylesheets are available in core?
- correct way to call javascript into hook function
- How to change the hover content of a specific menu item on WordPress?
- How do I update a field of a meta box?
- How to add user details to different tables immediately after user registration
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Enqueue script globally
- wp_localize_script is not adding a global variable for javascript
- wp_get_theme Warning: Illegal offset type
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- should i be checking for jquery before enqueing it in a plugin
- Why wp_die() doesn’t work with wp_redirect but exit() works
- How to import the css in the plugin admin area?
- Print Dashboard submenu name and filename
- My stylesheets are not enqueuing
- Custom Plugin – CSS works, JS doesn’t
- unable to wp_enqueue_script(‘suggest’);
- Apply styles to blockquote element with the WYSIWYG editor
- How to make my shortcode load scripts and styles, from within the plugin?
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- How to output functions from plugin inside theme
- Enqueue a file that’s not js or css
- Enqueueing common php scripts in a plugin
- Overwriting a plugin function
- Writing editor content to a file
- Enqueue scripts inside a class in a plugin
- Enqueue ONLY Plugin Styles and Scripts
- Remove Permalink Meta Box not working?
- WordPress Plugin Authoring question about jquery and css
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- can’t access some WordPress function from my plugin
- Customise Grouped Product display in Woocommerce with custom column
- Change the behaviour of a button
- Can someone explain what’s the use of parse request function in WordPress?
- Is “document loaded” different on admin side than public side?
- Override category archive page title (not the head title)
- Redirection from a specific page for users logged in but not with membership
- plugin css is not being applied to the page
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- Adding External Gmap JS to WordPress
- I cant add is_admin control to plugin
- Enqueue sripts and styles only if function is called
- Append php file to footer
- How to avoid conflict if a plugin already have included open library?
- AJAX call of function containing javascript which is not loaded (Plugin development)
- Javascript not being loaded only in custom taxonomy template
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Ajax Response Error | just getting error as the response
- Add function to Dokan ajax class
- Implementing Select2 plugin into WordPress
- Function not working on any file other than the main plugin file
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Template file structure , wordpress hook for altering the template
- How can I see a varibles value when my plugin runs?
- Custom options page for themes
- Enqueue Script in custom plugin before other
- Call do_action() within WordPress cronjob
- How to only Load scripts on variable products page
- get_term_by() returning null on plugin