Plugin Author
Meitar
(@meitar)
First of all, the shortcode is gdoc, not gDoc. Try that. Second of all, make sure the App Script that you are pointing to is deployed as a Web App with the “Anyone, even anonymous” permission.
yes i use gdoc. not gDoc, and anonymous, but dont worked…
You can show any example?
Plugin Author
Meitar
(@meitar)
Translated to English from this thread:
The script that you’re pointing to does not support direct embeds, probably because it was created using the Apps Script HtmlService. If you want to embed a snippet of HTML in your page, you need to write your Apps Script so that it outputs just that raw HTML snippet.
Google does not allow HtmlService’s HtmlObject to produce HTML output without an iframe.
A simple example in Apps Script might look like this:
function doGet (e) {
return "Hello <strong>world</strong>.";
}
If the above script were deployed as a Web App with the “Anyone, even anonymous” permission and given the ID ABCDEFG, then calling it with the following shortcode would produce a single line of text with the phrase Hello world. where the word world was bolded.
[gdoc key="https://script.google.com/macros/s/ABCDEFG/exec"]
The HTML output in your WordPress post would probably look like this:
<p>Hello <strong>world</strong>.</p>
I hope this helps.
yes I use htmlService.
function doGet(){
return HtmlService.createTemplateFromFile('HTML').evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME);
}