diff --git a/includes/civicrm.shortcodes.php b/includes/civicrm.shortcodes.php index cf3068d5ffdd62cbb7125323062b2b5a51189b6d..a9765671746579d4c4deb4847b11a8a87d20a0d6 100644 --- a/includes/civicrm.shortcodes.php +++ b/includes/civicrm.shortcodes.php @@ -247,6 +247,18 @@ class CiviCRM_For_WordPress_Shortcodes { */ public function render_single( $atts ) { + // Do not parse shortcodes in REST context for PUT, POST and DELETE methods + if ( defined( 'REST_REQUEST' ) && REST_REQUEST && ( isset( $_PUT ) || isset( $_POST ) || isset( $_DELETE ) ) ) { + // Return the original shortcode + $shortcode = '[civicrm'; + foreach ( $atts as $att => $val ) { + $shortcode .= ' ' . $att . '="' . $val . '"'; + } + $shortcode .= ']'; + + return $shortcode; + } + // check if we've already parsed this shortcode global $post; if ( is_object($post) ) {