| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/siteorigin-panels/widgets/widgets/list/ |
Upload File : |
<?php
class SiteOrigin_Panels_Widget_List extends SiteOrigin_Panels_Widget {
function __construct() {
parent::__construct(
__('List (PB)', 'siteorigin-panels'),
array(
'description' => __('Displays a bullet list of elements', 'siteorigin-panels'),
'default_style' => 'simple',
),
array(),
array(
'title' => array(
'type' => 'text',
'label' => __('Title', 'siteorigin-panels'),
),
'text' => array(
'type' => 'textarea',
'label' => __('Text', 'siteorigin-panels'),
'description' => __('Start each new point with an asterisk (*)', 'siteorigin-panels'),
),
)
);
}
static function create_list($text){
// Add the list items
$text = preg_replace( "/\*+(.*)?/i", "<ul><li>$1</li></ul>", $text );
$text = preg_replace( "/(\<\/ul\>\n(.*)\<ul\>*)+/", "", $text );
$text = wpautop( $text );
// Return sanitized version of the list
return wp_kses_post($text);
}
}