| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/ict/wp-content/plugins/so-widgets-bundle/base/inc/ |
Upload File : |
<?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] );
}
}