HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
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: /var/www/shoetique/wp-content/themes/north-wp/inc/widgets/twitter.php
<?php
// thb Flickr Widget
class widget_thbtwitter extends WP_Widget { 
	function __construct() {
		$widget_ops = array(
			'classname'   => 'widget_thbtwitter',
			'description' => __('Display your Tweets','north')
		);
	
		parent::__construct(
			'thb_twitter_widget',
			__( 'Fuel Themes - Twitter Widget' , 'north' ),
			$widget_ops
		);
				
		$this->defaults = array( 'title' => 'Latest Tweets', 'notweets' => '3' );
	}
	
	function widget($args, $instance) {
		extract($args);
		$title = apply_filters('widget_title', $instance['title'] );
		$notweets = $instance['notweets'];
		
		// Output
		echo $before_widget;
		echo $before_title . $title . $after_title;
	
		$username = ot_get_option('twitter_bar_username');
		?>
		<ul>
			<?php echo get_theme_tweets($username, ot_get_option('twitter_bar_consumerkey'), ot_get_option('twitter_bar_consumersecret'), ot_get_option('twitter_bar_accesstoken'), ot_get_option('twitter_bar_accesstokensecret'), $notweets); ?>
		</ul>
		<a href="http://twitter.com/<?php echo ot_get_option('twitter_bar_username'); ?>" class="btn small twitter" target="_blank"><i class="icon-budicon-841"></i> <?php _e('Follow <strong>@'.esc_attr($username).'</strong>', 'north'); ?> <i class="fa fa-twitter"></i></a>
		<?php
		echo $after_widget;
	}
	function update( $new_instance, $old_instance ) {  
		$instance = $old_instance; 
		
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['notweets'] = $new_instance['notweets'];

		return $instance;
	}
	// Settings form
	function form($instance) {
		$defaults = $this->defaults;
		$instance = wp_parse_args( (array) $instance, $defaults ); ?>
        
			<p>Please make sure you fill out the settings inside Theme Options -> Twitter Oauth</p>
			<p>
				<label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label>
				<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
			</p>
			<p>
				<label for="<?php echo $this->get_field_id( 'notweets' ); ?>"><?php _e('Number of Tweets', 'theme'); ?></label>
				<input id="<?php echo $this->get_field_id( 'notweets' ); ?>" name="<?php echo $this->get_field_name( 'notweets' ); ?>" value="<?php echo $instance['notweets']; ?>" class="widefat" />
			</p>
    <?php
	}
}
function widget_thbtwitter_init()
{
	register_widget('widget_thbtwitter');
}
add_action('widgets_init', 'widget_thbtwitter_init');

?>