I have a problem in my php code. does anyone know how to fix this? Help me please!
Warning: A non-numeric value encountered in C:\xampp\htdocs\reza\wp-content\plugins\trx_addons\shortcodes\promo\tpl.default.php on line 24
This is line 24:
? (100 - $args['gap'] - (int) str_replace('%', '', $args['image_width'])).'%'
Whole code:
$args = get_query_var('trx_addons_args_sc_promo');
$args['image'] = trx_addons_get_attachment_url($args['image'], 'full');
if (empty($args['image'])) {
$args['image_width'] = '0%';
$text_width = "100%";
} else if (empty($args['title']) && empty($args['subtitle']) && empty($args['description']) && empty($args['content']) && (empty($args['link']) || empty($args['link_text']))) {
$args['image_width'] = '100%';
$text_width = 0;
} else {
$args['gap'] = trim(str_replace('%', '', $args['gap']));
if (!empty($args['gap']) && strpos($args['image_width'], '%')!==false)
$args['image_width'] = ((int) str_replace('%', '', $args['image_width']) - $args['gap']/2) . '%';
$text_width = strpos($args['image_width'], '%')!==false
? (100 - $args['gap'] - (int) str_replace('%', '', $args['image_width'])).'%'
: 'calc(100%-'.($args['gap'] ? $args['gap'].'%' : '').trim($args['image_width']).')';
}