Quantcast
Channel: Katz Web Services » WordPress
Viewing all articles
Browse latest Browse all 17

Enable Shortcodes for Gravity Forms Field Descriptions

$
0
0

To enable shortcodes inside your Gravity Forms form description, field labels and descriptions, you need to add the following code to your theme’s functions.php file:

add_filter('gform_pre_render', 'walker_do_shortcode_gform_description', 10, 2);

function do_shortcode_gform_description(&$item, $key) {
	$item = do_shortcode($item);
}

function walker_do_shortcode_gform_description($form, $ajax) {

	$form['description'] = do_shortcode($form['description']);
	array_walk_recursive($form['fields'], 'do_shortcode_gform_description');

	return $form;
}

The post Enable Shortcodes for Gravity Forms Field Descriptions appeared first on KWS Blog.


Viewing all articles
Browse latest Browse all 17

Trending Articles