: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @package Themify Builder Pro
* @link https://themify.me/
class Tbp_Dynamic_Item_CustomField extends Tbp_Dynamic_Item {
function get_category() {
return array( 'text', 'textarea', 'image', 'wp_editor', 'url', 'custom_css' );
return __( 'Custom Field', 'tbp' );
function get_value( $args = array() ) {
if ( ! empty( $args['custom_field'] ) ) {
$enable_shortcodes = isset( $args['custom_field_shortcode'] ) && $args['custom_field_shortcode'] === 'yes';
if ( empty( $args['post_id'] ) ) {
$the_query = Tbp_Utils::get_actual_query();
if($the_query===null || $the_query->have_posts()){
$value = $this->get_meta( get_the_id(), $args['custom_field'], $enable_shortcodes );
if ( ! empty( $the_query ) ) {
$value = $this->get_meta( $args['post_id'], $args['custom_field'], $enable_shortcodes );
function get_meta( $post_id, $meta_key, $enable_shortcodes ) {
$value = get_post_meta( $post_id, $meta_key, true );
if ( $enable_shortcodes ) {
$value = do_shortcode( $value );
'label' => __( 'Custom Field', 'tbp' ),
'type' => 'autocomplete',
'dataset' => 'custom_fields',
'label' => __( 'Enable Shortcodes', 'tbp' ),
'id' => 'custom_field_shortcode',
'no' => __( 'No', 'tbp' ),
'yes' => __( 'Yes', 'tbp' ),
'help' => __( 'Enable parsing shortcodes on the custom field value.', 'tbp' ),
'label' => __( 'Post ID', 'tbp' ),
'help' => __( 'Leave empty to get the data from current post in the loop.', 'tbp' ),