: 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_PTBNumber extends Tbp_Dynamic_Item {
function is_available() {
return function_exists( 'run_ptb' );
function get_category() {
return array( 'text', 'textarea', 'wp_editor' );
return __( 'PTB Custom Fields (Number)', 'tbp' );
function get_value( $args = array() ) {
if(!empty($args['field'])){
$the_query = Tbp_Utils::get_actual_query();
if($the_query===null || $the_query->have_posts()){
$field_name = explode( ':', $args['field'] );
$value = get_post_meta(get_the_ID(), "ptb_{$field_name[1]}", true );
$display = isset( $args['decimals'] ) ? $args['decimals'] : 'from';
$decimals = isset( $args['decimals'] ) ? (int) $args['decimals'] : 2;
$dec_point = isset( $args['dec_point'] ) ? $args['dec_point'] : '.';
$thousands_sep = isset( $args['thousands_sep'] ) ? $args['thousands_sep'] : ',';
if ( is_array( $value ) ) { // range input
$value = $value[ $display ];
$value = number_format( floatval( $value ), $decimals, $dec_point, $thousands_sep );
/* collect "text" field types in all post types */
$ptb = PTB::$options->get_custom_post_types();
foreach ( $ptb as $post_type_key => $post_type ) {
if ( is_array( $post_type->meta_boxes ) ) {
foreach ( $post_type->meta_boxes as $key => $field ) {
if ( $field['type'] === 'number' ) {
$label = PTB_Utils::get_label( $post_type->plural_label );
$name = PTB_Utils::get_label( $field['name'] );
$options[ "{$post_type_key}:{$key}" ] = sprintf( '%s: %s', $label, $name );
'label' => __( 'Field', 'tbp' ),
'label' => __( 'Display', 'tbp' ),
'from' => __( 'From', 'tbp' ),
'to' => __( 'To', 'tbp' ),
'help' => __( 'In Range inputs, select to display the From value or To value.', 'tbp' ),
'label' => __( 'Decimals', 'tbp' ),
'label' => __( 'Decimal Point', 'tbp' ),
'label' => __( 'Thousands Separator', 'tbp' ),