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
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- Is having multiple theme customizers for different pages possible?
- class=”parent” for wp_list_pages?
- if has theme mod
- Count Title and Post Characters
- Remove css styles from specific page
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- HTML table from shortcode with multiple parameters
- Add a Second Menu to a theme that only support 1 menu
- Custom excerpt function re-factoring
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- How to get specific image in media library with php
- Displaying the Month and Year that a page was Created?
- Only Show Link If div Exists
- Change the WP Video Shortcode Output
- How to pick the default selected value in wordpress dropdown?
- Using WP-API and SSE not authenticating user ID
- Validate functions before inserting then into functions.php
- How to retrieve current wordpress profile page URL?
- How to Reference/Echo Variable from Another PHP Function
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Call to undefined function get_userdata() in plugin
- Echo string and function?
- how to test for all children (including multilevel grand-childern) of page
- Dilemma of Populating all the categories in a drop down list
- Add item to top of menu using a filter in functions.php
- Adding wrapper elements in the_date() like in the_title()?
- Notify users only on post publish
- Plugin Generate Unexpected output during activation
- require_once() if a product in woocommerce contains a tag [closed]
- PHP code for displaying WordPress posts in a static page not working
- Shortcode for Listing Users from Meta Value?
- Display css ONLY on most recent post of specific category?
- How to add data to a custom field at the wp_users table?
- How can I use custom menus with a Bootstrap WordPress theme?
- How to make a cookie be on the whole site instead of being on a specific page/
- Only load certain artists on this page
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Get the alt text of the image in a array
- Make table disappear when fields are left blank?
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- Woocommerce order status payment
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Unzip file in functions.php, and add it to cron
- Add Block Before Entry Title Using PHP
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- Dynamically populate parameter in Gravity Forms using PHP
- Store ajax data in PHP variable
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can i create a function tag in my plugin
- How to escape echo for input tag?
- Including user data in “new user notification email”
- Display current user metadata on WordPress page
- Reload page with a different shortcode when a user selects from a dropdown
- Refresh page after login with litespeed cache
- Return newly created category by code
- Woocommerce Add custom “Add to cart button” in single page with tags
- Hook into all password resets in WordPress and get password before hashing?
- remove_action() not working in page template – Genesis
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Dropdown menu on custom menu
- What is wrong in this code?
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- WordPress get_post_meta issue
- Woocommerce Price Text
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Show custom default avatar instead of gravatar
- WordPress 2014 Theme – Featured Content with multiple tags?
- ajax form function error
- Display custom meta box in my template file
- How to display the date under the post title?
- Simple Probléme in wordpress
- How to store the_post_thumbnail() value in a variable
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- a problem in class in class-wp-hook.php
- change title of page dynamically
- Display endpoint’s return into a file (file_put_contents())
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- Show the terms of the hierarchical taxonomy