Replace a symbol in value returned by shortcode
-
I want to remove the currency symbol from return value by a shortcode
I am using following code
function oj_total( $atts ) { extract( shortcode_atts( array( 'cat_id'=>235, ), $atts ) ); $t = do_shortcode( '[give_totals cats="4" message="{total}"]', $ignore_html = false ); //returns $89,695.00 $t = filter_var($t, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); return $t; //should return 89695.00 but returns 3689695.00 } add_shortcode( 'oj_total', 'oj_total' );
Value of $t should return 89695.00 but in my case returning 3689695.00
i.e $ get replaced by 36
Can you please help
thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Replace a symbol in value returned by shortcode’ is closed to new replies.