I wanted to achieve the same thing.. What I ended up doing was creating a function that collects the Kirki variables (see here about the use of variables in Kirki) and writes them to a scss..
$file = get_template_directory() . '/sass/custom/_custom_vars_mixins_options.scss';
if(file_exists($file)){
$output = "";
$variables = Kirki::get_variables();
foreach ( $variables as $variable => $vvalue ) {
$output .= '$' . $variable . ': ' . $vvalue . ';' . PHP_EOL;
//echo '@' . $variable . ':' . $value . ';';
}
file_put_contents($file, $output, FILE_TEXT )or die('<br />Error writing to custom options CSS file');
This function is called each time the user saves their settings in WP Customizer through the sanitization callback, hence writing all the custom user settings to the .scss file.
Related Posts:
- Need help setting default setting value for radio button in theme customizer
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Dynamically change feature image in customiser
- One button to change all settings in theme customizer?
- Design view breaking on Pages
- How to add default images into theme customizer image control?
- Return a numerical function value in Customizer controls
- Skt full width basic slideshow problem
- How to check if a Customizer setting is set?
- Please show me how to use an if/else statement in combination with wp_enqueue
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Need advice on theme customizer and child themes
- Getting text from custom field from customizer
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Using get_theme_mod with checkbox to display content
- How to add button to top of theme customizer?
- How can I clear the theme mod settings?
- Cant get theme to change footer color through theme customizer
- Sections dependent on checkbox the WordPress WP_Customize_Control
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Use DOMDocument with ob_start breaks my HTML code
- Auto-update products after they were published – Woocommerce
- How to prevent WP_Query function from returning all posts when empty?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- JS file work only in index page
- Display a specific category of products in shop page and disable code for specific actions
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- Removing “wpautop” (auto tags) only on certain pages?
- Fatal error: Uncaught Error: Call to undefined function test()
- How to pick the default selected value in wordpress dropdown?
- Using WP-API and SSE not authenticating user ID
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Validate functions before inserting then into functions.php
- How to retrieve current wordpress profile page URL?
- Firing schema via code in functions.php doesn’t work
- A non-numeric value encountered in /wp-includes/functions.php on line 68
- Get page that displays all children of taxonomy parent
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- get author_name from queried post
- Why ajax doesn’t work on certain wordpress hooks?
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How to call plugin function per site in a multisite?
- Print last modified date only on posts
- different id for same element visual composer [closed]
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- Tax query in pre_get_posts not working
- WordPress Gravatar filter is removing my custom attributes
- foreach loop still echoes array
- trigger html cleanup for all posts
- Error in custom php function doesn’t exist
- dynamic dependent select dropdown
- Customizer: active_callback and sanitize_callback incompatibility?
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Custom shortcode outputs plain text instead of HTML at top of post
- how can i use $_COOKIE[] + PostID to execute the below code?
- getting logged in user info (wp-load.php) from parent directory
- How can I get the values of my WordPress $wpdb query in Jquery?
- What’s the uses of wp_cache_set() or wp_cache_add()?
- Get users that likes the post
- Customizer: Multiple CSS styles on same element in Live Preview
- Blog posts repeat
- Ajax load more button for comments wordpress
- Function to capture a value and store it in a variable
- How to abort saving data in save_extra_profile_fields function WordPress?
- Pass php dynamic variable to shortcode
- Unique icons next to each WordPress menu item
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- How to create a php variable using WordPress the_title() function
- Keyword checking in Gravity Forms
- how to refresh div on template part?
- Child page menu in sidebar
- Populate editor with some content of a page with a page template
- Title Case WordPress Menu Items
- I want to load in a new class but only if the current page is single-movies.php
- Customizer: Category Select Sanitize
- Modify function to print tags/categories/exclude tags/categories/ number of posts
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Search not showing all results
- Validation algorithm in checkout field
- Css loads very slow [closed]
- Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
- Show when user is online/offline in real time on user_profile.php
- Limit 1 global comment per minute
- Create highly customized submenu (possibly using wp_list_pages)
- Problem custom control Customizer
- Create Page To Count Comments For Each Post In WordPress Site
- Modify custom field input data before creating a new post
- Adding a widget function into the php theme file
- Update user profile information from functions.php
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Get the date of the className or classID
- My new button is in the wrong place
- Can’t find infinite loop cause
- how to make custom ajax handler?
- Checking array against author id in loop
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Scrape external webpage for first image and add it to new post
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode