HEX
Server: Apache/2
System: Linux server-27-254-144-72.da.direct 5.10.0-33-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64
User: pokaorgani (1114)
PHP: 8.1.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/pokaorgani/public_html/wp-content/plugins/so-widgets-bundle/base/inc/less-functions.php
<?php

/**
 * Class siteorigin_lessc
 *
 * An extension to the SiteOrigin_LessC class that adds a few custom functions
 */
class SiteOrigin_Widgets_Less_Functions {
	private $widget;
	private $widget_instance;

	public function __construct( $widget, $widget_instance ) {
		$this->widget = $widget;
		$this->widget_instance = $widget_instance;
	}

	/**
	 * @param SiteOrigin_LessC $c
	 *
	 * Register less functions in a SiteOrigin_LessC object
	 */
	public function registerFunctions( &$c ) {
		if ( method_exists( $c, 'registerFunction' ) ) {
			$c->registerFunction( 'length', array( $this, 'length' ) );
		}
	}

	/**
	 * Very basic length function that checks the length of a list. Might need some more checks for other types.
	 *
	 * @return int
	 */
	public function length( $arg ) {
		if ( empty( $arg[0] ) || empty( $arg[2] ) || $arg[0] != 'list' ) {
			return 1;
		}

		return count( $arg[2] );
	}
}