Trying to insert a shortcode or module into the Number Counter

It’s already on the page. Text editor says: You’ve earned [accessally_field_value operation_id=“2”] out of 550 points

The output is already in the side bar here. I keep mentioning that this is working just fine:

I’m no longer in the page. If you are wanting to edit be my guest.

right I see what you are trying to do here. The shortcode is not a custom field and where you’re adding the shortcode is where a custom field key would go, if you were using custom field. The shortcode wold work in the number field except it only accept integers. So im afraid as it stands this isnt going to work for you.

Your gonna need some custom PHP code in your child theme … scratch that as you are not using a child theme, ok youll need a special plugin to run the code that will add the shortcode to the number field… if that will even work.

Im about to head out now but I can give you the plugin code to try tomorrow if you like.

That would be GREAT! Thank you. Anything you can do to help have that counter tied to our CRM (Ontraport) field would be great. So grateful.

FYI - The field in Ontraport that this shortcode connects to us a Number field and the number is always an integer (no decimal places). Let me know if there’s some code to use to get this Beaver Builder Number Counter Element to the number stored in this field.

Something like this would make a;l number modules use the shortcode, if you want different shortcodes for different counters the code will get more complex.

class FLBuilderSettingsCompatNumbers extends FLBuilderSettingsCompatHelper {
	public function filter_settings( $settings ) {

		// Check this is actually a numbers module by looking for a unique setting
		if ( isset( $settings->circle_width ) ) {
			$settings->number = do_shortcode( '[accessally_field_value operation_id="2"]');
		}
		return $settings;
	}
}
add_action( 'init', function() {
	FLBuilderSettingsCompat::register_helper( 'module', 'FLBuilderSettingsCompatNumbers' );
});

This would go in your child theme if you were using one so you’ll have to use some sort of PHP snippet plugin or make this code into a plugin.