Skip to content
Snippets Groups Projects
Verified Commit d04bd6e0 authored by Bastien Ho's avatar Bastien Ho Committed by Kevin Cristiano
Browse files

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

parent b3e64fbb
No related branches found
No related tags found
No related merge requests found
......@@ -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.'"';
}
$shortcode.=']';
return $shortcode;
}
// check if we've already parsed this shortcode
global $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