Unable to embed html

This topic contains 2 replies, has 2 voices, and was last updated by  Alex Rollin 4 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #512234

    Andrew
    Expired Member
    Post count: 197

    Hi Team,

    Every-time we attempt to embed an <i-frame> into a custom post field and click save, the listing does not save the code and just appears blank again.

    Have done the following

    1) The custom post type is a HTML field with Embed Media URLs ticked.
    2) Have double checked that our packages are correct and the “Tick to disable html editor in description field.” is not ticked

    Will provide further details in the next post.

    Thanks

    #512235

    Andrew
    Expired Member
    Post count: 197
    This reply has been marked as private.
    #512292

    Alex Rollin
    Moderator
    Post count: 27815

    Potentially dangerous tags are stripped from GD fields.

    To allow iframes and other tags in the main post_content Description field use this snippet

    
    
    
    /**
     * Skip sanitize specific field values.
     *
     * Skipping sanitize values may result in cross-site scripting (XSS) attack.
     */
    function gd_snippet_custom_skip_sanitize_field( $value, $gd_post, $custom_field, $post_id, $post, $update ) {
        // Fields to skip strip tags.
        $skip_strip_tags = array();
        $skip_strip_tags[] = 'post_content';
        if ( in_array( $custom_field->htmlvar_name, $skip_strip_tags ) ) {
            $value = $gd_post[ $custom_field->htmlvar_name ];
            if ( isset( $custom_field->data_type ) && ( $custom_field->data_type == 'DECIMAL' || $custom_field->data_type == 'INT' ) && $value === '' ) {
                $value = null;
            }
        }
        return $value;
    }
    

    Also see: https://wpgeodirectory.com/support/topic/script-tags-in-custom-field-not-working-after-update/#post-511899

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket