Title: Feature Request: Shortcode or PHP Function for Raised Amount
Last modified: October 3, 2019

---

# Feature Request: Shortcode or PHP Function for Raised Amount

 *  Resolved [mjtwebsites](https://wordpress.org/support/users/mjtwebsites/)
 * (@mjtwebsites)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/)
 * It would be awesome if we could use a shortcode or php function as the raised
   amount. I’m looking to have it dynamically pull that number from my database 
   so it is automatically updated every time someone fills out a Caldera Form entry.
   I’ve got the shortcode and php function ready to go, but when I try to use the
   shortcode nested in your shortcode, it doesn’t work.
 * Thanks!!!

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-11994832)
 * Hi,
    Sounds feasible – it looks like you would just need to make a small modification
   to the plugin code to read the raised amount as a shortcode e.g., [https://slewis.org/nested-wordpress-shortcodes/](https://slewis.org/nested-wordpress-shortcodes/)
 *  Thread Starter [mjtwebsites](https://wordpress.org/support/users/mjtwebsites/)
 * (@mjtwebsites)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-11994967)
 * Thanks. I tried changing line 88 in therm_shortcode.php
    from: $thermProperties[‘
   raised’] = strval($atts[‘raised’]); to: $thermProperties[‘raised’] = strval(do_shortcode(
   $atts[‘raised’]));
 * My shortcode looks like this:
    [thermometer raised=[get_total_donations field
   =”fld_9181836″]]
 * But it didn’t work. I’ll have to look at it later. Hoping it’s something really
   simple!
    Thanks!
    -  This reply was modified 6 years, 7 months ago by [mjtwebsites](https://wordpress.org/support/users/mjtwebsites/).
 *  [tsjippy](https://wordpress.org/support/users/tsjippy/)
 * (@tsjippy)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12239634)
 * I had the same question fixed it by adding
 *     ```
       if (strpos($atts['raised'], '[') !== false) {
       	$shortcode = strval($atts['raised'])."]";
       	$atts['raised'] = do_shortcode( $shortcode);
       }
       ```
   
 * to therm_shortcode.php on line 92.
 * Please add this to the next release
 *  [tsjippy](https://wordpress.org/support/users/tsjippy/)
 * (@tsjippy)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12239890)
 * better code:
 *     ```
       	//raised value
       	if ($atts['raised'] == '' && !empty($options['raised_string'])){
       	    $thermProperties['raised'] = $options['raised_string'];
       	}
       	else{
       		if (!is_numeric($atts['raised'])) {
       			$shortcode = "[".strval($atts['raised'])."]";
       			$atts['raised'] = do_shortcode( $shortcode);
       		}
       	    $thermProperties['raised'] = strval($atts['raised']);
       	}
       ```
   
 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12243009)
 * Thanks for this. I will look into this in a bit more detail for the next release.
 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12892898)
 * Hi, this is now incorporated into the latest plugin update, 2.0.8.
 *  [pixelyzed](https://wordpress.org/support/users/pixelyzed/)
 * (@pixelyzed)
 * [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12895940)
 * This doesn’t seem to work for me. I have a shortcode [total_dons] that returns
   a donations total and I call your shortcode like this:
 * [thermometer target=”50000″ raised=[total_dons]]
 * It shows the thermometer with a 0 raised value and prints the last ] as text 
   on the page.
 * Do I have to do something special in my shortcode for this to work?
 * Thanks!
 *  [pixelyzed](https://wordpress.org/support/users/pixelyzed/)
 * (@pixelyzed)
 * [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12895967)
 * Tried without the target attribute and that doesn’t work either:
 * [thermometer raised=[total_dons]]
 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12896117)
 * Hi, no as long as it outputs just a number. This should work:
 * [thermometer raised=’total_dons’]
 *  [pixelyzed](https://wordpress.org/support/users/pixelyzed/)
 * (@pixelyzed)
 * [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12896460)
 * And it does!! My shortcode does indeed only output a number calculated from the
   sum of Gravity Forms entries’ totals in several donation forms. It’s a moderately
   complex shortcode actually but the ouput is not 🙂
 * I didn’t want the client to have to update this manually. So thank you so much!
   That really helps.
    -  This reply was modified 6 years ago by [pixelyzed](https://wordpress.org/support/users/pixelyzed/).

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Feature Request: Shortcode or PHP Function for Raised Amount’ is closed
to new replies.

 * ![](https://ps.w.org/donation-thermometer/assets/icon-256x256.png?rev=3197594)
 * [Donation Thermometer](https://wordpress.org/plugins/donation-thermometer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/donation-thermometer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/donation-thermometer/)
 * [Active Topics](https://wordpress.org/support/plugin/donation-thermometer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/donation-thermometer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/donation-thermometer/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [pixelyzed](https://wordpress.org/support/users/pixelyzed/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/feature-request-shortcode-or-php-function-for-raised-amount/#post-12896460)
 * Status: resolved