{"action":"opened","issue":{"url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/128","repository_url":"https://api.github.com/repos/elegantthemes/create-divi-extension","labels_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/128/comments","events_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/128/events","html_url":"https://github.com/elegantthemes/create-divi-extension/issues/128","id":337223484,"node_id":"MDU6SXNzdWUzMzcyMjM0ODQ=","number":128,"title":"VB :: React: Divi builder shortcodes doesn't exist in AJAX calls","user":{"login":"jcdotnet","id":10810636,"node_id":"MDQ6VXNlcjEwODEwNjM2","avatar_url":"https://avatars0.githubusercontent.com/u/10810636?v=4","gravatar_id":"","url":"https://api.github.com/users/jcdotnet","html_url":"https://github.com/jcdotnet","followers_url":"https://api.github.com/users/jcdotnet/followers","following_url":"https://api.github.com/users/jcdotnet/following{/other_user}","gists_url":"https://api.github.com/users/jcdotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdotnet/subscriptions","organizations_url":"https://api.github.com/users/jcdotnet/orgs","repos_url":"https://api.github.com/users/jcdotnet/repos","events_url":"https://api.github.com/users/jcdotnet/events{/privacy}","received_events_url":"https://api.github.com/users/jcdotnet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-30T15:43:43Z","updated_at":"2018-06-30T15:43:43Z","closed_at":null,"author_association":"NONE","body":"### Problem Description\r\nHello, I'm trying to get data generated from the Divi Builder via AJAX but I'm having issues when trying to call a Divi Builder shortcode, this is my AJAX call:\r\n\r\n```\r\ncomponentDidUpdate() {  \r\n     $.ajax({\r\n        url : window.ETBuilderBackend.ajaxUrl,\r\n        type : 'post',\r\n        data : {\r\n          action : 'ddtest_handle_divi_section_shortcode',\r\n          test_id : 3 // I'm hardcoding the value for this example\r\n        },\r\n        success : function( response ) {\r\n          console.log(response);\r\n            $('.test-selector').html( response );\r\n        }\r\n      });\r\n}\r\n```\r\nAnd this is my PHP code:\r\n\r\n```\r\nfunction ddtest_handle_divi_section_shortcode() {\r\n\r\n    if (function_exists('et_pb_section')) \r\n        echo 'et_pb_section exists ';\r\n    else \r\n     echo 'et_pb_section DOES NOT exist '; // this is echoed  \r\n    if (function_exists('do_shortcode')) \r\n        echo 'do_shortcode exists '; // this is echoed\r\n    else \r\n     echo 'do_shortcode  DOES NOT exist ';\r\n\r\n    echo do_shortcode( '[et_pb_section global_module=\"' . $_POST['test_id'] . '\"][/et_pb_section]' );\r\n    wp_die();\r\n}\r\nadd_action( 'wp_ajax_nopriv_ddtest_handle_divi_section_shortcode', 'ddtest_handle_divi_section_shortcode' );\r\nadd_action( 'wp_ajax_ddtest_handle_divi_section_shortcode', 'ddtest_handle_divi_section_shortcode' );\r\n\r\n```\r\nThe function `do_shortcode` works and I can render other plugins shortcodes, this only happens with Divi when making AJAX calls. \r\n\r\n### Steps To Reproduce\r\n1. Created a PHP function that returns a module content using the WP built-in `do_shortcode` function\r\n2. Called this function via AJAX in `componentDidUpdate()`\r\n3. The response is the string of the shortcode. The function `do_shortcode` works but fails when trying to extract the shortcode content, no matter the layout: if fails for sections, modules and for all the Divi shortcode functions. It works fine when using other plugins shortcodes.\r\n"}}
{"actor":{"display_login":"jcdotnet"}}