Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/portfoli.../includes
File: class-prtfl-widget.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Display Portfolio Widget
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[5] Fix | Delete
die();
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Class for Portfoilo widget
[10] Fix | Delete
*/
[11] Fix | Delete
class Prtfl_Widget extends WP_Widget {
[12] Fix | Delete
/**
[13] Fix | Delete
* Constructor of class
[14] Fix | Delete
*/
[15] Fix | Delete
public function __construct() {
[16] Fix | Delete
parent::__construct(
[17] Fix | Delete
'prtfl_widget',
[18] Fix | Delete
__( 'Latest Portfolio Items', 'portfolio' ),
[19] Fix | Delete
array( 'description' => __( 'Displays the latest Portfolio projects.', 'portfolio' ) )
[20] Fix | Delete
);
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Function to displaying widget in front end
[25] Fix | Delete
*
[26] Fix | Delete
* @param array $args Array with sidebar settings.
[27] Fix | Delete
* @param array $instance Array with widget settings.
[28] Fix | Delete
*/
[29] Fix | Delete
public function widget( $args, $instance ) {
[30] Fix | Delete
[31] Fix | Delete
$widget_title = ( ! empty( $instance['widget_title'] ) ) ? apply_filters( 'widget_title', $instance['widget_title'], $instance, $this->id_base ) : '';
[32] Fix | Delete
$widget_count_posts = ( ! empty( $instance['widget_count_posts'] ) ) ? $instance['widget_count_posts'] : '';
[33] Fix | Delete
$widget_count_colums = ( ! empty( $instance['widget_count_colums'] ) ) ? $instance['widget_count_colums'] : '';
[34] Fix | Delete
[35] Fix | Delete
$atts['count'] = $widget_count_posts;
[36] Fix | Delete
$content = prtfl_latest_items( $atts, $widget_count_colums );
[37] Fix | Delete
echo wp_kses_post( $args['before_widget'] . $args['before_title'] . $widget_title . $args['after_title'] . $content );
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Function to displaying form
[42] Fix | Delete
*
[43] Fix | Delete
* @param array $instance Array with widget settings.
[44] Fix | Delete
*/
[45] Fix | Delete
public function form( $instance ) {
[46] Fix | Delete
global $sbscrbr_options;
[47] Fix | Delete
[48] Fix | Delete
$widget_title = isset( $instance['widget_title'] ) ? stripslashes( sanitize_text_field( $instance['widget_title'] ) ) : '';
[49] Fix | Delete
$widget_count_posts = isset( $instance['widget_count_posts'] ) ? stripslashes( sanitize_text_field( $instance['widget_count_posts'] ) ) : 5;
[50] Fix | Delete
$widget_count_colums = isset( $instance['widget_count_colums'] ) ? stripslashes( sanitize_text_field( $instance['widget_count_colums'] ) ) : 3;
[51] Fix | Delete
?>
[52] Fix | Delete
<p>
[53] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'widget_title' ) ); ?>">
[54] Fix | Delete
<?php esc_html_e( 'Title', 'portfolio' ); ?>:
[55] Fix | Delete
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'widget_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'widget_title' ) ); ?>" type="text" value="<?php echo esc_html( $widget_title ); ?>"/>
[56] Fix | Delete
</label>
[57] Fix | Delete
</p>
[58] Fix | Delete
<p>
[59] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'widget_count_posts' ) ); ?>">
[60] Fix | Delete
<?php esc_html_e( 'Number of Projects:', 'portfolio' ); ?>:
[61] Fix | Delete
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'widget_count_posts' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'widget_count_posts' ) ); ?>" type="number" min="1" max="100" value="<?php echo esc_attr( $widget_count_posts ); ?>" />
[62] Fix | Delete
</label>
[63] Fix | Delete
</p>
[64] Fix | Delete
<p>
[65] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'widget_count_colums' ) ); ?>">
[66] Fix | Delete
<?php esc_html_e( 'Number of Colums:', 'portfolio' ); ?>:
[67] Fix | Delete
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'widget_count_colums' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'widget_count_colums' ) ); ?>" type="number" min="1" max="100" value="<?php echo esc_attr( $widget_count_colums ); ?>" />
[68] Fix | Delete
</label>
[69] Fix | Delete
</p>
[70] Fix | Delete
<?php
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Function to update widget data
[75] Fix | Delete
*
[76] Fix | Delete
* @param array $new_instance New data with widget settings.
[77] Fix | Delete
* @param array $old_instance New data with widget settings.
[78] Fix | Delete
*/
[79] Fix | Delete
public function update( $new_instance, $old_instance ) {
[80] Fix | Delete
$instance = array();
[81] Fix | Delete
$instance['widget_title'] = ( ! empty( $new_instance['widget_title'] ) ) ? wp_strip_all_tags( $new_instance['widget_title'] ) : null;
[82] Fix | Delete
$instance['widget_count_posts'] = ( ! empty( $new_instance['widget_count_posts'] ) ) ? wp_strip_all_tags( $new_instance['widget_count_posts'] ) : null;
[83] Fix | Delete
$instance['widget_count_colums'] = ( ! empty( $new_instance['widget_count_colums'] ) ) ? wp_strip_all_tags( $new_instance['widget_count_colums'] ) : null;
[84] Fix | Delete
return $instance;
[85] Fix | Delete
}
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function