0xsec Shell
0xSec


Server : LiteSpeed
System : Linux webbox1.ncrdns.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
User : rahcos ( 1533)
PHP Version : 8.4.23
Disable Function : NONE
Directory :  /home/rahcos/.trash/wp-content/themes/hara/inc/widgets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/rahcos/.trash/wp-content/themes/hara/inc/widgets/recent_post.php
<?php
if (!hara_redux_framework_activated()) {
    return;
}

class Tbay_Widget_Recent_Post extends Tbay_Widget
{
    public function __construct()
    {
        parent::__construct(
            'hara_recent_post',
            esc_html__('Hara Recent Posts', 'hara'),
            array( 'description' => esc_html__('Show list of recent post', 'hara'), )
        );
        $this->widgetName = 'recent_post';
    }
 
    public function getTemplate()
    {
        $this->template = 'recent-post.php';
    }

    public function widget($args, $instance)
    {
        $this->display($args, $instance);
    }
    
    public function form($instance)
    {
        $defaults = array(
            'title' => 'Latest Post',
            'layout' => 'default' ,
            'number_post' => '4',
            'post_type' => 'post'
        );
        $instance = wp_parse_args((array) $instance, $defaults);
        // Widget admin form?>
        <p>
            <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'hara'); ?></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($instance['title']); ?>" />
        </p>
        <p>
            <label for="<?php echo esc_attr($this->get_field_id('post_type')); ?>">
                <?php esc_html_e('Type:', 'hara'); ?>
            </label>
            <br>
            <select id="<?php echo esc_attr($this->get_field_id('post_type')); ?>" name="<?php echo esc_attr($this->get_field_name('post_type')); ?>">
                <?php foreach (get_post_types(array('public' => true)) as $key => $value) { ?>
                    <?php if ($key!='attachment' && $key!='product') { ?>
                    <option value="<?php echo esc_attr($key); ?>" <?php selected($instance['post_type'], $key); ?> ><?php echo esc_html($value); ?></option>
                    <?php } ?>
                <?php } ?>
            </select>
        </p>
        <p>
            <label for="<?php echo esc_attr($this->get_field_id('number_post')); ?>"><?php esc_html_e('Num Posts:', 'hara'); ?></label>
            <input class="widefat" id="<?php echo esc_attr($this->get_field_id('number_post')); ?>" name="<?php echo esc_attr($this->get_field_name('number_post')); ?>" type="text" value="<?php echo esc_attr($instance['number_post']); ?>" />
        </p>  

<?php
    }

    public function update($new_instance, $old_instance)
    {
        $instance = array();
        $instance['title'] = (! empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
        $instance['post_type'] = $new_instance['post_type'];
        $instance['number_post'] = (! empty($new_instance['number_post'])) ? strip_tags($new_instance['number_post']) : '';
        return $instance;
    }
}

c0oded By c0rpz