Fundraising Plugin: Stripping the dollar sign.

I have a quick question: How can I strip the "$" being displayed from
wdf_amount_raised(); and wdf_goal(); using PHP not CSS?
All your thoughts are appreciated.

  • Vaughan

    Hi Orlando,

    Hope you're well?

    As both those functions are surrounded by an if()

    You should be able to add those to your theme functions.php

    I haven't tried this, but the following should hopefully work.

    Add the following to your theme functions.php

    function wdf_goal($echo = true, $post_id = '') {
    		global $wdf, $post;
    		$post_id = (empty($post_id) ? $post->ID : $post_id );
    		if(!get_post($post_id))
    			return;
    
            $settings = get_option('wdf_settings');
            		//check decimal option
    		if ( $settings['curr_decimal'] === '0' ) {
    			$decimal_place = 0;
    			$zero = '0';
    		} else {
    			$decimal_place = 2;
    			$zero = '0.00';
    		}
    
    		$goal = get_post_meta($post_id,'wdf_goal_amount',true);
    		$goal = number_format_i18n($goal, $decimal_place);
    		if($echo) {echo $goal;} else {return $goal;}
    	}
    	function wdf_amount_raised($echo = true, $post_id = '') {
    		global $post, $wdf;
    		$post_id = (empty($post_id) ? $post->ID : $post_id );
    		if(!get_post($post_id))
    			return false;
            $settings = get_option('wdf_settings');
            		//check decimal option
    		if ( $settings['curr_decimal'] === '0' ) {
    			$decimal_place = 0;
    			$zero = '0';
    		} else {
    			$decimal_place = 2;
    			$zero = '0.00';
    		}
    		$raised = number_format_i18n($wdf->get_amount_raised($post_id), $decimal_place);
    
    		if($echo) {echo $raised;} else {return $raised;}
    
    	}

    Also, be aware, this is for the latest version of fundraising, it might be different in the version you are using.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.