Up to 50 percent off

Inserting multiple forms with Iframe: How redirect outside the iframe?

This topic contains 11 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 11 months ago
Viewing 11 Posts - 1 through 11 (of 11 total)
Author Posts
October 24, 2013 at 4:25 am 9351
Tareq Hasan 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.
October 24, 2013 at 12:31 pm 9361
Tareq Hasan Tareq Hasan

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

October 25, 2013 at 6:04 pm 9429
ggsalas ggsalas

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

October 25, 2013 at 7:55 pm 9433
Tareq Hasan Tareq Hasan

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]

October 25, 2013 at 8:21 pm 9435
ggsalas ggsalas

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

October 25, 2013 at 8:27 pm 9436
Tareq Hasan Tareq Hasan

Care to give a testimonial 🙂 ?

October 25, 2013 at 9:05 pm 9439
ggsalas ggsalas

Testimonial dispatched! Thanks again.

November 22, 2013 at 5:49 am 12655
ggsalas ggsalas

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

November 23, 2013 at 3:56 pm 12706
Tareq Hasan Tareq Hasan

Have you changed the redirect to of edit settings

November 24, 2013 at 1:28 am 12715
ggsalas ggsalas

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

December 10, 2013 at 2:33 am 13558
ggsalas ggsalas

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

December 11, 2013 at 5:16 pm 13618
Tareq Hasan Tareq Hasan

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 11 Posts - 1 through 11 (of 11 total)