Skip to content
Snippets Groups Projects
Commit 09d990ae authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

pre-release Gutenberg shortcode block fixes

Fixes https://lab.civicrm.org/dev/wordpress/issues/1



Plan for 5.2.0 release if not merged

Signed-off-by: default avatarKevin Cristiano <kcristiano@tadpole.cc>
parent 8100f8d8
No related branches found
No related tags found
No related merge requests found
......@@ -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) ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment