Give "Author" user role ability to embed Google maps

Posted in: Newspaper
Post count: 19

Hi,

I have been able to successfully embed Google maps in posts using the Editor role. I have an API key set up with google and I copy the iframe code below.

However when other Authors on my site try to embed the code below it doesn’t work. They add the text, it displays correctly in the visual editor, but when they save the draft the iframe code completely disappears. Authors mustn’t have the correct permissions to embed maps. I’ve verified this by changing one of my Authors to an Editor and suddenly it worked.

How can I give Authors permission to embed maps (using the code below) without having to make them into Editors? I don’t want them to have all the other permissions that come with being an Editor.

Any help would be greatly appreciated!

Post showing embedded map:
https://revesbyparents.com.au/2018/06/29/lambeth-reserve-picnic-point/

Code to embed the map:
<iframe style=”border: 0;” src=”https://www.google.com/maps/embed/v1/place?key=AIzaSyD5iABQHzGG4pa6Co2dbONeWZCXWSwUeIE&q=Lambeth+Reserve+Picnic+Point&#8221; width=”600″ height=”450″ frameborder=”0″ allowfullscreen=”allowfullscreen”><span data-mce-type=”bookmark” style=”display: inline-block; width: 0px; overflow: hidden; line-height: 0;” class=”mce_SELRES_start”></span><span data-mce-type=”bookmark” style=”display: inline-block; width: 0px; overflow: hidden; line-height: 0;” class=”mce_SELRES_start”></span><span data-mce-type=”bookmark” style=”display: inline-block; width: 0px; overflow: hidden; line-height: 0;” class=”mce_SELRES_start”></span><span data-mce-type=”bookmark” style=”display: inline-block; width: 0px; overflow: hidden; line-height: 0;” class=”mce_SELRES_start”></span><br />
</iframe>

Thank you!
Janelle

Post count: 19

So is there anyone able to help? Doing some research and some suggest to update the user capabilities in the theme file.
https://wordpress.stackexchange.com/questions/183502/give-author-users-the-right-to-embed/183504

Other suggestions are to use a different method of embedding maps or to use a User Role Editor plugin to change the Author capabilities. Does TagDiv have any recommendations on which approach is best?

Thank you!
Janelle

Post count: 20688

Hi,

Authors have the capabilities to create and publish new posts, there is no restriction for the post content for authors. I would suggest if possible that you try with a default WordPress theme. The theme does not change the user role capabilities. Check if the embedded maps show up in a post created by an author the same way.

Also be sure to check who is authorized to use these embeds or if there are any restrictions set for the key
https://developers.google.com/maps/documentation/javascript/get-api-key#key-restrictions

Thanks

Post count: 19

Hi,

There is no restriction on who can use the key other than it has to come from the same website. It is definitely the Author role that is the problem, I know because I changed one of my Authors to be an Editor and it then worked without issue.

Yes its probably the same even for default themes. The Author role does have restrictions on post content – they are not able to embed iframes, see here: https://brilliantinfo.net/embed-video-as-an-author/

But what I would like to know is does TagDiv have any recommended plugins to use with Newspaper for editing User Role capabilities? Or any recommended plugins to use with Newspaper for embedding google maps? The other option is to edit the functions.php file, but I would prefer to just use a plugin recommended with Newspaper.

Thank you!
Janelle

Post count: 20688

Hi,

Did not know that author are limited in embedding, thank you for mentioning it. For user role plugins I can’t make any recommendations as I did not try any. Use the one mentioned in the same topic. Or this one for example
https://www.wpbeginner.com/beginners-guide/wordpress-user-roles-and-permissions/

Thanks

Post count: 19

Thanks for your response. I installed the User Role editor plugin and have been able to add unfiltered HTML to the Author role, which solved my issue.

Thank you!
Janelle

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.