Commit eea0e26a authored by Bastien Ho's avatar Bastien Ho Committed by Bastien Ho

Do not parse shortcodes in REST context for PUT, POST and DELETE methods

update dates
parent 03d442bc
......@@ -241,6 +241,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.'"';
}
$shortcode.=']';
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