Skip Navigation

[Resolved] Error with iframe after edit in Front End

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to save the HTML code for an iframe in a custom field using Forms, but the code isn't saved correctly.

Solution: HTML iframe tags are a security issue, so Forms strip them out when submitted by non-admin Users. One solution is to only save the iframe src attribute URL, like this:

https://docs.google.com/presentation/d/e/2PAC-x...embed/?start=false&loop=false&delayms=3000

Then in your Template Layout, you can use the field value in an iframe tag:

[wpv-conditional if="( $(wpcf-vvedyt-kod-prezentacziyi) ne '' )"]
<iframe src="[types field='vvedyt-kod-prezentacziyi' output='raw'][/types]" frameborder="0"... ></iframe>
[/wpv-conditional]
This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Rostislav Avtodiychuk 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#1390313

I have post type Lesson hidden link i create custom field Single Line i need insert in them iframe (presentation from google slides) in cred form.

If i insert them from wp admin hidden link i see presentation on front end hidden link. But i need made site use only cred form and front-end edition.
When i click on edit hidden link made any change and save after i lost my presentation iframe, any case even i insert iframe in my field presentation not shown after save.

Link to a page where the issue can be seen: hidden link

thanks for help

#1390681

Hello, iframe tags are a security issue, so cred forms strip them out when submitted by non-admin Users. One solution is to only save the iframe src attribute URL, like this:

<em><u>hidden link</u></em>...embed/?start=false&loop=false&delayms=3000

Then in your Template Layout, you can use the field value in an iframe tag:

[wpv-conditional if="( $(wpcf-vvedyt-kod-prezentacziyi) ne '' )"]
<iframe src="[types field='vvedyt-kod-prezentacziyi' output='raw'][/types]" frameborder="0"... ></iframe>
[/wpv-conditional]

Can this work for your site?

#1391803

My issue is resolved now. Thank you very much Christian!
I'll add parameters for fullscreen presentation and it works perfectly for me.

#1745605

Hello again. My question is again relevant and maybe you can suggest some kind of solution so that you can insert a link into the visual editor iframe or YouTube.
The fact is that it is very difficult for our users in back-end (yes, there are still such people and there are many of them).
Our task is to make a website with easy front-end edit. Cred form for post is powerful and have only the name of the record, WYSIWIG editor and category selection.
But unfortunately they don't have enough text information and need to insert an iframe or a link to a video.
I tried this solution https://toolset.com/forums/topic/field-for-embed-youtube-video/ but it didn't work for me, iframe tag not shown in allow list.
Also i see embeded video field in custom field, but they can use only in out of my wisiwig editor and we need video wrap the text.
Is it possible to make a button with a shortcode on the control panel to insert a link. all users will be registered and assigned special rights.
Thanks for any answer and any help.

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/insert-iframe-or-link-to-a-video-in-forms/