• Resolved mllapan

    (@mllapan)


    https://ww.wp.xz.cn/support/topic/iframe-in-custom-fields/
    This worked until some of the last wordpress updates.
    Now it preserves iframe inside custom field until you try to edit the same post in the backend as an administrator, once you hit update button iframe is gone, but in case post is not made by wp user frontend, updating post wont remove iframe from custom field, so its the case with this plugin.
    This code needs update:

    add_action( 'wpuf_add_post_after_insert', 'rt_render_iframe',10, 4 );
    function rt_render_iframe( $post_id, $form_id, $form_settings, $form_vars ) {
        update_post_meta( $post_id, 'your_custom_meta', $_POST['your_custom_meta'] );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mllapan

    (@mllapan)

    Guys, I need this.
    My all site is about iframes / videos.
    Please, anyone?

    Robin

    (@emazharulislam)

    Hello @mllapan,

    Please try the scenario with the following code.

    add_action( 'wpuf_add_post_after_insert', 'rt_render_iframe',10, 4 );
    add_action( 'wpuf_edit_post_after_update', 'rt_render_iframe',10, 4 );
    function rt_render_iframe( $post_id, $form_id, $form_settings, $form_vars ) {
        update_post_meta( $post_id, 'your_custom_meta', $_POST['your_custom_meta'] );
    }

    Hopefully, this will help you out. If not, please contact here.

    Thanks.

    Thread Starter mllapan

    (@mllapan)

    Unfortunately, same scenario.

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

The topic ‘Iframe in custom fields’ is closed to new replies.