Skip Navigation

[Resolved] Toolset Post Create/Edit frontend form not saving input

This support ticket is created 5 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Waqar 5 years ago.

Assisted by: Waqar.

Author
Posts
#1402003

Hello, I've created a special login for author users to post and edit "Instituciones" custom post types from the frontend with Toolset Forms.

The problem is when they save the post after creating or editing it and the input for the label "Google Maps iFrame" is not saving the content.

But when creating or editing it form the backend as administrator is working fine.

The input is a multiple line type and the content should be the html code of Google Maps to share a map as an iFrame.

#1402457

Hi,

Thank you for contacting us and I'd be happy to assist.

To be able to test and troubleshoot this on my own website, I'll need to see how the custom field and the form are set up in the admin area.

Can you please share temporary admin login details, along with the link to the page with the form?

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1404409

Thank you for sharing the admin access.

During testing on my own website, I was able to confirm that iframe tags are stripped from the Toolset Forms, regardless of the user role.

To allow this tag, you can follow these steps:

1. The code snippet below can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.


add_filter( 'wp_kses_allowed_html', 'esw_author_cap_filter',1,1 );
   
function esw_author_cap_filter( $allowedposttags ) {
   
//Here put your conditions, depending on your context
   
if ( !current_user_can( 'publish_posts' ) )
return $allowedposttags;
   
// Here add tags and attributes you want to allow
   
$allowedposttags['iframe']=array(
   
'align' => true,
'width' => true,
'height' => true,
'frameborder' => true,
'name' => true,
'src' => true,
'id' => true,
'class' => true,
'style' => true,
'scrolling' => true,
'marginwidth' => true,
'marginheight' => true,
);
return $allowedposttags;
}

2. From Toolset -> Settings -> Form, select the "iframe" tag from the "Content Filter" section, as the allowed HTML tag.

I hope this helps and please let me know if you need any further assistance around this.

#1404923

Thanks for your answer! I tryied both ways but is not working, I receibe this messagges:

Toolset Custom Code: There was an error when updating snippets.

Functions.php of current theme: Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.

#1405853

Thanks for the update.

It is strange that this works on my test website, but not on yours.

Would it be possible for you to share a clone/snapshot of your website, as explained in this guide?
https://toolset.com/faq/provide-supporters-copy-site/

This will allow me to troubleshoot this in more depth on my own server.

Note: Your next reply will be private.

#1407991

Thank you for sharing the backup.

I'll be performing some tests on this clone on my own server and will update you with my findings, as soon as this testing completes.

#1413029

Thank you for waiting.

I've performed some tests on your website's clone and was able to save the iframe code in the field as expected, using the same steps that I shared earlier.

1. At the bottom of the Jupiter theme's "functions.php" file, I added the code snippet from step 1.
Screenshot: hidden link

Important note: If you're not able to edit the functions.php file through the WordPress built-in theme editor, you can use FTP access or your host's file manager tool.

2. After that, "iframe" option became available in the "Select allowed HTML tags" section at WP Admin -> Toolset -> Settings -> Forms and I enabled and saved the settings.

Screenshot 1: hidden link
Screenshot 2: hidden link

I hope this helps and please let me know how it goes.