I was able to get SASS syntax highlighting in a code textarea in Customizer with the following:
add_action( 'customize_register', function( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_setting( 'favorite_html' );
$control = new WP_Customize_Code_Editor_Control( $wp_customize, 'favorite_html', array(
'label' => 'SASS',
'code_type' => 'sass',
'settings' => 'favorite_html',
'section' => 'title_tagline',
) );
$wp_customize->add_control( $control );
} );
The editor is powered by CodeMirror, since 4.9, so if you’re looking for different code types look their.
Related Posts:
- Should all plugins be encapsulated in a Class?
- Consuming an external API in WordPress?
- How can I import a class privately into a plugin?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Generate custom output for page/URL in a plugin
- Post source link plugin – small modification
- Add CSS animation as Preloader to WordPress
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Setting up widgets in wordpress with a unique ID for the after_title argument
- Modifying Footnote Plugin for Descriptive Title Attributes
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- force customers to add only single item to card per purchase EDD [closed]
- Auto delete WordPress users according to time
- Edit Yoast SEO breadcrumbs output [closed]
- How would I go about creating a user ranked post popularity page?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Redirect to another page using contact form 7? [closed]
- Inserting custom PHP script on homepage
- Loop in elementor custom widget not working
- I am trying to make a field show and save from quickedit screen
- .php file for woocommerce edit category? [closed]
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- same user role or copy the user role to be same as the other role
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- woocommerce remove coupon link does not work
- implement custom roles in custom plugin
- Post source link plugin – small modification
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- Rename a folder via HTML POST request
- Move plugin pages from dashboard to front-end
- working code, not working – Plugin Dev
- Cron job shedules replace?
- Custom shortcode being shown in WPBakery backend rather than the block
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Woocommerce list variations that are added already to cart in Single Product
- Flexslider empty slide
- Custom SportsPress list
- How to fix vanilla comments extra iframe space
- I want to remove the register/login WordPress top bar from my website
- How to delete remain data in WP database after deleting custom post via admin interface
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress: code structure
- How to make a Template page to show the information of different things Shop and Product page?
- Best collection of code for your 'functions.php' file [closed]
- How to get the active theme’s slug?
- Preserve custom URL parameter on more pages
- if plugin is active? check if plugin is enabled or not?
- Making plugin unique to not conflict with plugins with the same name
- How to store ACF custom fields data in a custom table
- Trying to disable plugins doens’t work
- shortcode doesn’t work
- Copyright messages for a particular set of pages
- how to load the language file in plugin?
- View Private Published Page with URL Code (no login required)
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- Image upload and download from front-end
- Send reply with pre-prepared answers
- Using Wishlist Member and I need to access a user’s status
- Why namespaces are rarely used in WordPress plugins?
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- PHP Error When a plugin is active
- Include a php file from another plugin
- How to change the wp_upload_dir() path in plugin
- wp-mail attachment is not sent for no reason?
- Custom shortcode for displaying user based on a role parameter
- How can I fetch data from another website to my wordpress website with mysql database
- Save user total active time after login in wordpress [closed]
- Add the_post_thumbnail_url to a shortcode in function.php
- Can’t create new CPTs when menu hidden
- Modify pages widget and make a plugin?
- Strange admin-ajax / CSS / $_SESSION issue
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- How to create admin setting for this small plugin
- Allowed memory size of 134217728 … wp-includes/wp-db.php on line 1989
- Undefined offset: 0 in WordPress after latest version upgrade [closed]
- Can we hide a certain user in WP?
- How to create algorithm for ordering posts in WordPress?
- How to use WordPress header function and footer function and not load word press database
- Hooking into the HTML header container
- Block plugin update possibilities (but not by hiding notifications)
- Conditional Fields depending on checkboxes
- Soflyy WP All Import Custom File Download Issue
- Translation plugin with default language?
- Custom pages with plugin
- Displaying friend’s posts only
- how to restore wordpress backup(.rar) manually?
- WordPress Code Access to Restricted Content without Registration
- White Screen When Includding A Folder With PHP Files
- How to pre-set WordPress settings for specific posts?
- Two sites one PC
- PHP if url extension action=discussion condition use [closed]
- Option value not getting updated until page refresh in WordPress
- Fatal error: Uncaught Error: Call to a member function fetch_array() on bool
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class