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/themify-.../includes/dynamic-...
File: CustomField.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package Themify Builder Pro
[2] Fix | Delete
* @link https://themify.me/
[3] Fix | Delete
*/
[4] Fix | Delete
class Tbp_Dynamic_Item_CustomField extends Tbp_Dynamic_Item {
[5] Fix | Delete
[6] Fix | Delete
function get_category() {
[7] Fix | Delete
return 'advanced';
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
function get_type() {
[11] Fix | Delete
return array( 'text', 'textarea', 'image', 'wp_editor', 'url', 'custom_css' );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
function get_label() {
[15] Fix | Delete
return __( 'Custom Field', 'tbp' );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
function get_value( $args = array() ) {
[19] Fix | Delete
$value = '';
[20] Fix | Delete
if ( ! empty( $args['custom_field'] ) ) {
[21] Fix | Delete
$enable_shortcodes = isset( $args['custom_field_shortcode'] ) && $args['custom_field_shortcode'] === 'yes';
[22] Fix | Delete
if ( empty( $args['post_id'] ) ) {
[23] Fix | Delete
$the_query = Tbp_Utils::get_actual_query();
[24] Fix | Delete
if($the_query===null || $the_query->have_posts()){
[25] Fix | Delete
if($the_query!==null){
[26] Fix | Delete
$the_query->the_post();
[27] Fix | Delete
}
[28] Fix | Delete
$value = $this->get_meta( get_the_id(), $args['custom_field'], $enable_shortcodes );
[29] Fix | Delete
if ( ! empty( $the_query ) ) {
[30] Fix | Delete
wp_reset_postdata();
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
} else {
[34] Fix | Delete
$value = $this->get_meta( $args['post_id'], $args['custom_field'], $enable_shortcodes );
[35] Fix | Delete
}
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
return $value;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
function get_meta( $post_id, $meta_key, $enable_shortcodes ) {
[42] Fix | Delete
$value = get_post_meta( $post_id, $meta_key, true );
[43] Fix | Delete
[44] Fix | Delete
if ( $enable_shortcodes ) {
[45] Fix | Delete
$value = do_shortcode( $value );
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
return $value;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
function get_options() {
[52] Fix | Delete
return array(
[53] Fix | Delete
array(
[54] Fix | Delete
'label' => __( 'Custom Field', 'tbp' ),
[55] Fix | Delete
'id' => 'custom_field',
[56] Fix | Delete
'type' => 'autocomplete',
[57] Fix | Delete
'dataset' => 'custom_fields',
[58] Fix | Delete
),
[59] Fix | Delete
array(
[60] Fix | Delete
'label' => __( 'Enable Shortcodes', 'tbp' ),
[61] Fix | Delete
'id' => 'custom_field_shortcode',
[62] Fix | Delete
'type' => 'select',
[63] Fix | Delete
'options' => array(
[64] Fix | Delete
'no' => __( 'No', 'tbp' ),
[65] Fix | Delete
'yes' => __( 'Yes', 'tbp' ),
[66] Fix | Delete
),
[67] Fix | Delete
'help' => __( 'Enable parsing shortcodes on the custom field value.', 'tbp' ),
[68] Fix | Delete
),
[69] Fix | Delete
array(
[70] Fix | Delete
'label' => __( 'Post ID', 'tbp' ),
[71] Fix | Delete
'id' => 'post_id',
[72] Fix | Delete
'type' => 'number',
[73] Fix | Delete
'help' => __( 'Leave empty to get the data from current post in the loop.', 'tbp' ),
[74] Fix | Delete
),
[75] Fix | Delete
);
[76] Fix | Delete
}
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function