HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/wintergenomics_site/wp-content/jetpack/modules/custom-css/custom-css/preprocessors.php
<?php

/**
 * CSS preprocessor registration.
 *
 * To add a new preprocessor (or replace an existing one), hook into the
 * jetpack_custom_css_preprocessors filter and add an entry to the array
 * that is passed in.
 *
 * Format is:
 * $preprocessors[ UNIQUE_KEY ] => array( 'name' => 'Processor name', 'callback' => [processing function] );
 *
 * The callback function accepts a single string argument (non-CSS markup) and returns a string (CSS).
 *
 * @param array $preprocessors The list of preprocessors added thus far.
 * @return array
 */

function jetpack_register_css_preprocessors( $preprocessors ) {
	$preprocessors['less'] = array(
		'name' => 'LESS',
		'callback' => 'jetpack_less_css_preprocess'
	);

	$preprocessors['sass'] = array(
		'name' => 'Sass (SCSS Syntax)',
		'callback' => 'jetpack_sass_css_preprocess'
	);

	return $preprocessors;
}

add_filter( 'jetpack_custom_css_preprocessors', 'jetpack_register_css_preprocessors' );

function jetpack_less_css_preprocess( $less ) {
	require_once( dirname( __FILE__ ) . '/preprocessors/lessc.inc.php' );

	$compiler = new lessc();

	try {
		return $compiler->compile( $less );
	} catch ( Exception $e ) {
		return $less;
	}
}

function jetpack_sass_css_preprocess( $sass ) {
	require_once( dirname( __FILE__ ) . '/preprocessors/scss.inc.php' );

	$compiler = new scssc();
	$compiler->setFormatter( 'scss_formatter' );

	try {
		return $compiler->compile( $sass );
	} catch ( Exception $e ) {
		return $sass;
	}
}