Home Forums Plugin Support WP User Frontend Pro Inserting multiple forms with Iframe: How redirect outside the iframe?

This topic is: resolved

This topic contains 11 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 5 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #9351

    ggsalas
    Participant
    Post count: 108

    Hi @tareq,

    I have found a preliminar solution to the limitation about have multiple forms with multiple post-content areas in the same page with tinymce.

    The solution I've found is insert the form with a iframe. With this method I have only one problem: I need set the redirect (after post submit) outside the iframe, adding target=”_top” to the link.

    Exist any way to do this? any hook?

    Best regards.

    #9361

    Tareq Hasan
    Keymaster
    Post count: 2831

    Sorry, no hook is available in that matter. Need to modify the plugin file in that case.

    #9429

    ggsalas
    Participant
    Post count: 108

    Hi @tareq,

    Ok, no problem. Now I'm using a “Message to show” instead of redirect. I would like to show a link to the new post in this message. For example:

    Your Article has been Published!
    
    To see your new post<a href="[CODE I NEED TO LINK]">click in this link</a>

    Do you know how I can do this?

    Best regards

    #9433

    Tareq Hasan
    Keymaster
    Post count: 2831

    Use this text as a message:

    To see your new post<a href="%PERMALINK%">click in this link</a>

    Now, change the %PERMALINK% with the newly created URL.
    [php]
    function wpufe_response_text( $response, $post_id ) {

    $response[‘message'] = str_replace( ‘%PERMALINK%', get_permalink( $post_id ), $response[‘message'] );

    return $response;
    }

    add_filter( ‘wpuf_add_post_redirect', ‘wpufe_response_text', 10, 2 );
    [/php]

    #9435

    ggsalas
    Participant
    Post count: 108

    Ok @tareq, you are the best!

    Thanks for your support. I share the link with the solution to open outside the Iframe:

    To see your new post<a href="%PERMALINK%" target="_parent">click in this link</a>

    Best Regards

    #9436

    Tareq Hasan
    Keymaster
    Post count: 2831

    Care to give a testimonial ๐Ÿ™‚ ?

    #9439

    ggsalas
    Participant
    Post count: 108

    Testimonial dispatched! Thanks again.

    #12655

    ggsalas
    Participant
    Post count: 108

    Hi @tareq,

    I have added this line of code to use the %PERMALINK% url on the post update message, but not do anything, the %PERMALINK% text are not replaced: add_filter( 'wpuf_edit_post_redirect', 'wpufe_response_text', 10, 2 );

    Best regards

    #12706

    Tareq Hasan
    Keymaster
    Post count: 2831

    Have you changed the redirect to of edit settings

    #12715

    ggsalas
    Participant
    Post count: 108

    Hi @tareq,
    No, I see the message, but the link not work. I send you a capture of the config: http://imageshack.us/photo/my-images/822/78ww.png/ and the code I use:

    add_filter( 'wpuf_add_post_redirect', 'wpufe_response_text', 10, 2 );
    add_filter( 'wpuf_edit_post_redirect', 'wpufe_response_text', 10, 2 );
    function wpufe_response_text( $response, $post_id ) {
        $response['message'] = str_replace( '%PERMALINK%', get_permalink( $post_id ), $response['message'] );
        return $response;
    }

    Best regards

    #13558

    ggsalas
    Participant
    Post count: 108

    Hi @tareq,
    Can you see if I make an error? I really think I'm inserting the right code but doesn't work.

    Best regards

    #13618

    Tareq Hasan
    Keymaster
    Post count: 2831

    Umm…seems like it doesn't work like that. Adding filter in edit success message response like this won't work. It acts differently than the add/create new posts message. Simply it just prints the “Post Update Message” in the edit area, without any filter in /class/frontend-form-post.php line: 115. May be you could str_replace there directly by editing the code.

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

The topic ‘Inserting multiple forms with Iframe: How redirect outside the iframe?’ is closed to new replies.