---
title: "How to process shortcodes contained within fields used by the Calendar"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravitycalendar/how-to-process-shortcodes-contained-within-fields-used-by-the-calendar/"
---

When setting up a GravityCalendar feed, you can specify a field to populate the calendar title and description.

![Gravity Forms settings for embedding calendars and setting event details](https://www.gravitykit.com/wp-content/uploads/2025/10/file-SREhUWzZQ6.png)
*Sometimes, these fields contain shortcodes, like the [](https://www.gravitykit.com/docs/gravitymath/math-shortcode/) or the*[](https://www.gravitykit.com/docs/gravityview/shortcodes/gvlogic-shortcode/) shortcode. By using the code below, these shortcodes will be parsed and displayed correctly on your calendar:

```
add_filter( 'gravityview/calendar/events', 'gv_calendar_process_field_value_shortcode' );

/**
 * Sometimes field values contain shortcodes you want to process. This does that.
 *
 * @param array $events Array of events to display on the calendar.
 *
 * @return array $events, but with `title` and `description` keys processed.
 */
function gv_calendar_process_field_value_shortcode( $events ) {

	foreach ( $events as $key => $event ) {
		$events[ $key ]['title']       = do_shortcode( GVCommon::decode_shortcodes( $event['title'] ) );
		$events[ $key ]['description'] = do_shortcode( GVCommon::decode_shortcodes( $event['description'] ) );
	}

	return $events;
}
```

```
add_filter( 'gravityview/calendar/events', 'gv_calendar_process_field_value_shortcode' );

/**
 * Sometimes field values contain shortcodes you want to process. This does that.
 *
 * @param array $events Array of events to display on the calendar.
 *
 * @return array $events, but with `title` and `description` keys processed.
 */
function gv_calendar_process_field_value_shortcode( $events ) {

	foreach ( $events as $key => $event ) {
		$events[ $key ]['title']       = do_shortcode( GVCommon::decode_shortcodes( $event['title'] ) );
		$events[ $key ]['description'] = do_shortcode( GVCommon::decode_shortcodes( $event['description'] ) );
	}

	return $events;
}
```

Read here how to add these code samples to your website: [Where to put code samples.](https://www.gravitykit.com/docs/gravityview/customizing-your-views/where-to-put-code-samples/)