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.../public_h.../wp-conte.../plugins/themify-.../classes
File: class-themify-builder-widgets.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/***************************************************************************
[2] Fix | Delete
*
[3] Fix | Delete
* ----------------------------------------------------------------------
[4] Fix | Delete
* DO NOT EDIT THIS FILE
[5] Fix | Delete
* ----------------------------------------------------------------------
[6] Fix | Delete
*
[7] Fix | Delete
* Copyright (C) Themify
[8] Fix | Delete
*
[9] Fix | Delete
* ----------------------------------------------------------------------
[10] Fix | Delete
*
[11] Fix | Delete
***************************************************************************/
[12] Fix | Delete
[13] Fix | Delete
defined( 'ABSPATH' ) || exit;
[14] Fix | Delete
[15] Fix | Delete
///////////////////////////////////////////
[16] Fix | Delete
// Layout Parts Class
[17] Fix | Delete
///////////////////////////////////////////
[18] Fix | Delete
class Themify_Layout_Part extends WP_Widget {
[19] Fix | Delete
[20] Fix | Delete
///////////////////////////////////////////
[21] Fix | Delete
// Layout Parts
[22] Fix | Delete
///////////////////////////////////////////
[23] Fix | Delete
function __construct() {
[24] Fix | Delete
/* Widget settings. */
[25] Fix | Delete
$widget_ops = array( 'classname' => 'layout-parts', 'description' => __('Layout Parts widget', 'themify') );
[26] Fix | Delete
[27] Fix | Delete
/* Widget control settings. */
[28] Fix | Delete
$control_ops = array( 'id_base' => 'themify-layout-parts' );
[29] Fix | Delete
[30] Fix | Delete
/* Create the widget. */
[31] Fix | Delete
parent::__construct( 'themify-layout-parts', __('Themify - Layout Parts', 'themify'), $widget_ops, $control_ops );
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
///////////////////////////////////////////
[35] Fix | Delete
// Widget
[36] Fix | Delete
///////////////////////////////////////////
[37] Fix | Delete
function widget( $args, $instance ) {
[38] Fix | Delete
[39] Fix | Delete
/* User-selected settings. */
[40] Fix | Delete
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
[41] Fix | Delete
$layout_part = isset( $instance['layout_part'] ) ? $instance['layout_part'] : false;
[42] Fix | Delete
[43] Fix | Delete
/* Before widget (defined by themes). */
[44] Fix | Delete
echo $args['before_widget'];
[45] Fix | Delete
[46] Fix | Delete
if ( $title ) {
[47] Fix | Delete
echo $args['before_title'] , $title , $args['after_title'];
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
echo do_shortcode('[themify_layout_part slug=' . $layout_part . ']'),$args['after_widget'];
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
///////////////////////////////////////////
[54] Fix | Delete
// Update
[55] Fix | Delete
///////////////////////////////////////////
[56] Fix | Delete
function update( $new_instance, $old_instance ) {
[57] Fix | Delete
$instance = $old_instance;
[58] Fix | Delete
[59] Fix | Delete
$instance['title'] = $new_instance['title'];
[60] Fix | Delete
$instance['layout_part'] = $new_instance['layout_part'];
[61] Fix | Delete
[62] Fix | Delete
return $instance;
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
///////////////////////////////////////////
[66] Fix | Delete
// Form
[67] Fix | Delete
///////////////////////////////////////////
[68] Fix | Delete
function form( $instance ) {
[69] Fix | Delete
[70] Fix | Delete
/* Set up some default widget settings. */
[71] Fix | Delete
$instance = wp_parse_args( (array) $instance, array(
[72] Fix | Delete
'title' => '',
[73] Fix | Delete
'layout_part' => '',
[74] Fix | Delete
) );
[75] Fix | Delete
$field = esc_attr($this->get_field_id( 'layout_part' ));
[76] Fix | Delete
?>
[77] Fix | Delete
<p>
[78] Fix | Delete
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'themify'); ?></label><br />
[79] Fix | Delete
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" type="text" />
[80] Fix | Delete
</p>
[81] Fix | Delete
<p>
[82] Fix | Delete
<label for="<?php echo $field; ?>"><?php _e('Layout Part:', 'themify'); ?></label>
[83] Fix | Delete
<select id="<?php echo $field; ?>" name="<?php esc_attr_e( $this->get_field_name( 'layout_part' ) ); ?>">
[84] Fix | Delete
<?php
[85] Fix | Delete
$layouts = get_posts( array(
[86] Fix | Delete
'post_type'=>Themify_Builder_Layouts::LAYOUT_PART_SLUG,
[87] Fix | Delete
'post_status' => 'publish',
[88] Fix | Delete
'orderby' => 'post_title',
[89] Fix | Delete
'order' => 'ASC',
[90] Fix | Delete
'no_found_rows'=>true,
[91] Fix | Delete
'cache_results'=>false,
[92] Fix | Delete
'ignore_sticky_posts'=>true,
[93] Fix | Delete
'update_post_term_cache'=>false,
[94] Fix | Delete
'update_post_meta_cache'=>false,
[95] Fix | Delete
'nopaging'=>true,
[96] Fix | Delete
));
[97] Fix | Delete
[98] Fix | Delete
foreach( $layouts as $layout ) {
[99] Fix | Delete
echo '<option value="' . $layout->post_name . '"';
[100] Fix | Delete
[101] Fix | Delete
if ( $layout->post_name === $instance['layout_part'] ) echo ' selected="selected"';
[102] Fix | Delete
[103] Fix | Delete
echo '>' , esc_html( $layout->post_title ),'</option>';
[104] Fix | Delete
}
[105] Fix | Delete
?>
[106] Fix | Delete
</select>
[107] Fix | Delete
</p>
[108] Fix | Delete
[109] Fix | Delete
<?php
[110] Fix | Delete
}
[111] Fix | Delete
}
[112] Fix | Delete
register_widget( 'Themify_Layout_Part' );
[113] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function