Recently, I was not understand how to get the updated customizer contents in $UPDATED_CONTROL_CONTENTS
variable within the selective_refresh
.
I used type => option
for the setting. So, It store the date in option
name my-sample-text-option
.
So, Using get_option()
I’m able to get the update options from customizer.
Solution:
/**
* Add partial refresh
*/
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'my-sample-text-option', array(
'selector' => '.custom-html-section',
'container_inclusive' => false,
'render_callback' => function() {
// Get update data from option `my-sample-text-option` using funcition get_option()
$options = get_option( `my-sample-text-option` );
return do_shortcode( $options );
},
) );
}
Related Posts:
- Responsive Images – Generating multiple images from Theme Customizer control upload?
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- Modify the Additional CSS section (adding a disclaimer)
- Customizer: Unique identifier that distinguishes which image upload control is uploading an image
- Disabling Customizer Selective Refresh shortcut icons for selected controls
- JavaScript stops working on selectively refreshed sections one inside the other
- “Add A Widget” button in the Customizer
- Customizer: save setting/control content to post/page
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Is it possible to visually group items on the theme customizer?
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Default Text not showing from customizer
- How to transfer one domain to another domain without losing theme options (customizer)?
- Is there a WordPress boolean for “theme_customizer_active()”?
- Customizer: get_preview_url() inside customize_save_after hook
- What is difference between add_theme_support and Theme Customization API?
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- WordPress Customizer Help with FontAwesome Icon
- Customizer API way function is_customize_preview() works only in main page?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- When to use is_home() vs is_front_page()?
- Theme customizer – settings order
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- Add a dropdown to theme customizer
- Can I create customizer setting that can handle plugin shortcode?
- Editing the custom background CSS
- Is the theme customizer slowing down my site?
- WordPress Customize — Move “menus” options / field to another section
- Changing the entire control choices using wp.customize with JavaScript
- How to remove menus section from WordPress theme customizer
- “Display Site Title and Tagline” checkbox not working?
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Best approach to create sites with Modular Content? [closed]
- What’s the best action to use when you want to do something only once per theme setup?
- wordpress custom theme import and export options for sample data [closed]
- How to hook CSS file according to theme selection in the customizer section
- Change setting name in Customizer and keep the data
- Creating multiple hooks for theme
- after_setup_theme, Global Variable and Theme Customizer
- Customizer: widget-synced triggers twice
- How to add a second stylesheet to the editor
- Get a setting value conditionally in the Customizer api
- WP_Customize_Color_Control omitting # symbol
- Conditional statement to show pagination
- How to create a custom template to admin dashboard
- How do I Add images uploaded in the post to a default custom field
- How to add a button which saves the post then executes a function
- Theme-wide custom post template
- Getting custom posts by post id from cutomizer text input
- Zoom on custom theme without child
- Dynamically generated wordpress customizer options?
- Changing a slider to a grid [closed]
- Custom Navigation build using wp_nav_menu and walker
- Override customizer values on a per-menu base
- Using My Own Classes On Wp Unit Tests
- Integrate WooCommerce theme with a WordPress theme [closed]
- How do you use WordPress for a website that’s not in a blog format?
- Replace site title with logo when logo is uploaded in customizer using
- Extending Twenty Eleven Theme
- Templates without a loop, best practice?
- Doing context-aware previews in the WordPress Customizer
- Alignment Problem [closed]
- Avada Child Theme Development
- CSS added through customizer neglects the need of a child theme?
- Theme logo metadata into template file
- WP Customazation API doesn’t save the default Value
- Clearing dummy data before launch
- Create theme for mobile phones and tablets only?
- Using the media library for theme customization
- Twenty Twelve Author not displaying
- Alternatives to handle customizer settings
- How to copy page/post from one theme to another?
- How to change listing type permlink?
- Why does wp_customizer default values do not apply when theme is installed for the first time?
- Customizer API Multi Sections in single Panel
- How Do I Create a WordPress Demo Site with Limited Admin Access
- Fatal error: Class WP_Customize_Image_Control not found
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- How do I remove header/page-title image in farvis theme? [closed]
- How to show Custom Field Value in Woocommerce Shop Page
- Is hand coding required at all?
- How to show some of category in wordpress
- how to edit woocommerce checkout page
- Import settings from another theme
- Nav menus Fast previewing not working with wp_get_nav_menu_items!
- Customizer Image-Picker Preview Not Working
- Correct was to customise theme using get_theme_mod in scripts
- How to get url image page the right way?
- Load get_page_templates into select menu
- Undefined index: custom_sidebars
- page.php is not called when I load a Page
- “No Data Received” error in Chrome every time i try to update the theme functions file
- How to add button to top of theme customizer?
- Turning WordPress Into full-featured website?
- How do I make it super customisable?
- How to set up a development/staging site to make major changes to the theme then update on the live site?
- My theme is full of error messages in the “Customize” screen, but nowhere else
- WP Customizer get control value on change
- Execute javscript when theme customizer loads (autosave issue)