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: PTBNumber.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_PTBNumber extends Tbp_Dynamic_Item {
[5] Fix | Delete
[6] Fix | Delete
function is_available() {
[7] Fix | Delete
return function_exists( 'run_ptb' );
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
function get_category() {
[11] Fix | Delete
return 'ptb';
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
function get_type() {
[15] Fix | Delete
return array( 'text', 'textarea', 'wp_editor' );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
function get_label() {
[19] Fix | Delete
return __( 'PTB Custom Fields (Number)', 'tbp' );
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
function get_value( $args = array() ) {
[23] Fix | Delete
$value='';
[24] Fix | Delete
if(!empty($args['field'])){
[25] Fix | Delete
$the_query = Tbp_Utils::get_actual_query();
[26] Fix | Delete
if($the_query===null || $the_query->have_posts()){
[27] Fix | Delete
if($the_query!==null){
[28] Fix | Delete
$the_query->the_post();
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
$field_name = explode( ':', $args['field'] );
[32] Fix | Delete
$value = get_post_meta(get_the_ID(), "ptb_{$field_name[1]}", true );
[33] Fix | Delete
[34] Fix | Delete
$display = isset( $args['decimals'] ) ? $args['decimals'] : 'from';
[35] Fix | Delete
$decimals = isset( $args['decimals'] ) ? (int) $args['decimals'] : 2;
[36] Fix | Delete
$dec_point = isset( $args['dec_point'] ) ? $args['dec_point'] : '.';
[37] Fix | Delete
$thousands_sep = isset( $args['thousands_sep'] ) ? $args['thousands_sep'] : ',';
[38] Fix | Delete
if ( is_array( $value ) ) { // range input
[39] Fix | Delete
$value = $value[ $display ];
[40] Fix | Delete
}
[41] Fix | Delete
$value = number_format( floatval( $value ), $decimals, $dec_point, $thousands_sep );
[42] Fix | Delete
[43] Fix | Delete
}
[44] Fix | Delete
if($the_query!==null){
[45] Fix | Delete
wp_reset_postdata();
[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
$options = array();
[53] Fix | Delete
[54] Fix | Delete
/* collect "text" field types in all post types */
[55] Fix | Delete
$ptb = PTB::$options->get_custom_post_types();
[56] Fix | Delete
foreach ( $ptb as $post_type_key => $post_type ) {
[57] Fix | Delete
if ( is_array( $post_type->meta_boxes ) ) {
[58] Fix | Delete
foreach ( $post_type->meta_boxes as $key => $field ) {
[59] Fix | Delete
[60] Fix | Delete
if ( $field['type'] === 'number' ) {
[61] Fix | Delete
$label = PTB_Utils::get_label( $post_type->plural_label );
[62] Fix | Delete
$name = PTB_Utils::get_label( $field['name'] );
[63] Fix | Delete
$options[ "{$post_type_key}:{$key}" ] = sprintf( '%s: %s', $label, $name );
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
}
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
return array(
[70] Fix | Delete
array(
[71] Fix | Delete
'label' => __( 'Field', 'tbp' ),
[72] Fix | Delete
'id' => 'field',
[73] Fix | Delete
'type' => 'select',
[74] Fix | Delete
'options' => $options,
[75] Fix | Delete
),
[76] Fix | Delete
array(
[77] Fix | Delete
'label' => __( 'Display', 'tbp' ),
[78] Fix | Delete
'id' => 'display',
[79] Fix | Delete
'type' => 'select',
[80] Fix | Delete
'options' => array(
[81] Fix | Delete
'from' => __( 'From', 'tbp' ),
[82] Fix | Delete
'to' => __( 'To', 'tbp' ),
[83] Fix | Delete
),
[84] Fix | Delete
'help' => __( 'In Range inputs, select to display the From value or To value.', 'tbp' ),
[85] Fix | Delete
),
[86] Fix | Delete
array(
[87] Fix | Delete
'label' => __( 'Decimals', 'tbp' ),
[88] Fix | Delete
'id' => 'decimals',
[89] Fix | Delete
'type' => 'text',
[90] Fix | Delete
),
[91] Fix | Delete
array(
[92] Fix | Delete
'label' => __( 'Decimal Point', 'tbp' ),
[93] Fix | Delete
'id' => 'dec_point',
[94] Fix | Delete
'type' => 'text',
[95] Fix | Delete
),
[96] Fix | Delete
array(
[97] Fix | Delete
'label' => __( 'Thousands Separator', 'tbp' ),
[98] Fix | Delete
'id' => 'thousands_sep',
[99] Fix | Delete
'type' => 'text',
[100] Fix | Delete
),
[101] Fix | Delete
);
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function