Unverified Commit 0e209a47 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #130 from bastienho/master

Do not render shortcodes in PUT, POST or DELETE
parents 4d42759d eea0e26a
......@@ -246,6 +246,16 @@ class CiviCRM_For_WordPress_Shortcodes {
* @return string HTML for output
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.'"';
return $shortcode;
// check if we've already parsed this shortcode
global $post;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment