HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //home/dwauav0tm6jp/public_html/wp-content/themes/photographer-wp/admin/widget-social-feed.php
<?php

	class pixelwars_Social_Feed_Widget extends WP_Widget
	{
		public function __construct()
		{
			parent::__construct('pixelwars_social_feed_widget',
								__( '- Social Feed', 'read' ),
								array( 'description' => __( 'Social feed widget.', 'read' ) ) );
		}
		
		
		public function form( $instance )
		{
			if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = ""; }
			
			
			if ( isset( $instance[ 'network' ] ) ) { $network = $instance[ 'network' ]; } else { $network = ""; }
			
			if ( isset( $instance[ 'user' ] ) ) { $user = $instance[ 'user' ]; } else { $user = ""; }
			
			if ( isset( $instance[ 'number_of_items' ] ) ) { $number_of_items = $instance[ 'number_of_items' ]; } else { $number_of_items = '8'; }
			
			
			?>
				<p>
					<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo __( 'Title:', 'read' ); ?></label>
					
					<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $title ); ?>">
				</p>
				
				<p>
					<label for="<?php echo esc_attr( $this->get_field_id( 'network' ) ); ?>"><?php echo __( 'Network:', 'read' ); ?></label>
					
					<select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'network' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'network' ) ); ?>">
						<option></option>
						<option <?php if ( $network == 'pinterest' ) { echo 'selected="selected"'; } ?> value="pinterest">Pinterest</option>
						<option <?php if ( $network == 'picasa' ) { echo 'selected="selected"'; } ?> value="picasa">Picasa</option>
					</select>
				</p>
				
				<p>
					<label for="<?php echo esc_attr( $this->get_field_id( 'user' ) ); ?>"><?php echo __( 'User:', 'read' ); ?></label>
					
					<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'user' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'user' ) ); ?>" value="<?php echo esc_attr( $user ); ?>">
				</p>
				
				<p>
					<label for="<?php echo esc_attr( $this->get_field_id( 'number_of_items' ) ); ?>"><?php echo __( 'Number of items to show:', 'read' ); ?></label>
					
					<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'number_of_items' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number_of_items' ) ); ?>" size="3" value="<?php echo esc_attr( $number_of_items ); ?>">
				</p>
			<?php
		}
		
		
		public function update( $new_instance, $old_instance )
		{
			$instance = array();
			
			
			$instance['title'] = strip_tags( $new_instance['title'] );
			
			
			$instance['network'] = strip_tags( $new_instance['network'] );
			
			$instance['user'] = strip_tags( $new_instance['user'] );
			
			$instance['number_of_items'] = strip_tags( $new_instance['number_of_items'] );
			
			
			return $instance;
		}
		
		
		public function widget( $args, $instance )
		{
			extract( $args );
			
			
			$title = apply_filters( 'widget_title', $instance['title'] );
			
			
			$network = apply_filters( 'widget_network', $instance['network'] );
			
			$user = apply_filters( 'widget_user', $instance['user'] );
			
			$number_of_items = apply_filters( 'widget_number_of_items', $instance['number_of_items'] );
			
			
			echo $before_widget;
			
			
				if ( ! empty( $title ) )
				{
					echo $before_title . $title . $after_title;
				}
				
				
				?>
					<div class="social-feed" data-social-network="<?php echo esc_attr( $network ); ?>" data-username="<?php echo esc_attr( $user ); ?>" data-limit="<?php echo esc_attr( $number_of_items ); ?>"></div>
				<?php
			
			echo $after_widget;
		}
	}
	
	add_action('widgets_init', function() { register_widget('pixelwars_Social_Feed_Widget'); });

?>