HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (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: //proc/thread-self/root/proc/self/cwd/wp-content/themes/ronneby/inc/widgets/widget-styled-list.php
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }
class crum_list_widget extends WP_Widget {

    public function __construct() {
        parent::__construct(
            'list_widget', // Base ID
            'Widget: Styled list', // Name
            array( 'description' => __( 'List of ', 'dfd' ), ) // Args
        );
    }


    public function widget( $args, $instance ) {
        extract( $args );
        $title = apply_filters( 'widget_title', $instance['title'] );

        $html = $instance['html'];

        echo $before_widget;
        if ($title) {

            echo $before_title;
            echo $title;
            echo $after_title;

        }
        echo '<ul class="styled-widget-list">';
        echo $html;
        echo '</ul>'; ?>

        <?php echo $after_widget;
    }

    /**
     * Sanitize widget form values as they are saved.
     */
    public function update( $new_instance, $old_instance ) {
        $instance = array();
        $instance['title'] = strip_tags( $new_instance['title'] );

        $instance['html'] = $new_instance['html'];

        return $instance;
    }

    /**
     * Back-end widget form.
     */
    public function form( $instance ) {
        if ( isset( $instance[ 'title' ] ) ) {
            $title = $instance[ 'title' ];
        }
        else {
            $title = __( 'Styled list', 'dfd' );
        }

        if ( isset( $instance[ 'html' ] ) ) {
            $html = $instance[ 'html' ];
        }

        ?>
    <p>
        <label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php _e( 'Title:', 'dfd' ); ?></label>
        <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
    </p>


    <p>
        <label for="<?php echo esc_attr($this->get_field_id( 'html' )); ?>"><?php _e( 'Items wrapped in: li HTML tags', 'dfd' ); ?>:</label>
        <textarea  class="widefat" cols="40" rows="20" id="<?php echo esc_attr($this->get_field_id( 'html' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'html' )); ?>"><?php echo $html; ?></textarea>
    </p>


    <?php
    }

}