HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/dailygoldindex/public_html/wp-content/themes/jnews/class/Widget/Normal/Element/LineWidget.php
<?php
/**
 * @author : Jegtheme
 */
namespace JNews\Widget\Normal\Element;

use JNews\Widget\Normal\NormalWidgetInterface;

Class LineWidget implements NormalWidgetInterface
{
    /**
     * Register widget with WordPress.
     */
    public function get_options()
    {
        return array (
            'color'   => array(
                'title'     => esc_html__('HR Color', 'jnews'),
                'desc'      => esc_html__('Color of line element.', 'jnews'),
                'type'      => 'color',
                'default'   => 'rgba(255,255,255,0.2)'
            ),
            'margintop'   => array(
                'title'     => esc_html__('Margin Top', 'jnews'),
                'desc'      => esc_html__('Set margin top in px.', 'jnews'),
                'type'      => 'slider',
                'options'    => array(
                    'min'  => '0',
                    'max'  => '200',
                    'step' => '1',
                ),
                'default'   => 0,
            ),
            'marginbottom'   => array(
                'title'     => esc_html__('Margin Bottom', 'jnews'),
                'desc'      => esc_html__('Set margin bottom in px.', 'jnews'),
                'type'      => 'slider',
                'options'    => array(
                    'min'  => '0',
                    'max'  => '200',
                    'step' => '1',
                ),
                'default'   => 0,
            ),
        );
    }

    public function render_widget($instance, $text_content = null)
    {
        $style = '';
        if(isset($instance['color'])) $style .= 'border-color : ' . $instance['color'] . ';';
        if(isset($instance['margintop'])) $style .= 'margin-top: ' . $instance['margintop'] . 'px;';
        if(isset($instance['marginbottom'])) $style .= 'margin-bottom: ' . $instance['marginbottom'] . 'px;';
        ?>
        <hr class="clearfix" style="<?php echo esc_attr($style); ?>">
        <?php
    }
}