Viewing 12 replies - 16 through 27 (of 27 total)
  • Hi, I used this code snippet to redirect users to my desired page after they submit their posts.

    function custom_redirect( $url ) {
        global $post;
    
        return get_permalink( $post->ID=8);
    }
    add_filter( 'wpuf_after_post_redirect', 'custom_redirect' );

    But instead of implementing this code to the theme’s function.php file, I had to implement this to wpuf-functions.php of the plug in file. Here 8 could be replaced by your desired page or post ID number. In my case, 8 is the page ID of Dashboard page of users.

    Is there a way to redirect users after they edit a post? Currently it shows the edit post form, and I would like them to be redirected to their post.

    Hi wombat86. Try editing the code using the examples above, the notes in Close Button and return on Post and code in the development version to achieve what you want.

    I think there was also some mention of this elsewhere in the forums. Do a search for: “WP USer Frontend” “redirect”

    I cant find any frontend user editing option? am I missing a shortcode or something?

    frontend user editing option can be turned on or off by changing plugin settings in the dashboard.

    Where? I think I have checked every screen about a dozen times each!

    Hi ajamm,

    First you have to create a page named ‘edit’ or something like that and then you have to put the short code [wpuf_editpost] in that page. After that, go to WP User Frontend settings from the wordpress dashboard. Go to the ‘others’ tab. Look for the option, ‘user can edit post?’ select ‘yes’ or ‘no’ from the drop down list. Look for the option ‘edit page’ and then locate the edit page there (select the page where you used this short code [wpuf_editpost]). After that save the changes. If you follow the steps accurately then users should be able to edit their post from the front end. Hope that helped.

    @adnan,

    Sorry I see that you have missed what I was after, probably I wasnt very clear.

    I want to be able to edit the USERS – add/remove, see and change subscriptions etc.

    The feature list includes Admins can manage their users from frontend and I cannot find how to use this feature.

    Thankyou for taking the time to help.

    I am still not able to get this to work when adding a new post.

    It looks like when I click Submit, the new post isn’t yet saved as a $post object, and I think this is why the redirect isn’t working.

    I tried adding var_dump($post); in my custom redirect function and it shows “post_name”]=> string(8) “new-post”
    and it also shows my post id is 109, which is the id of my new-post page, NOT the id of the new post I just submitted.

    Shouldn’t this object show the information in the post I just submitted, and not the information about the Add new post page?

    My permalinks are set up to be the post name not the id if that makes any difference.

    Thank you for the help! I hope that made sense!

    I figured out a workaround, but my last question still stands.

    I added

    if ( $post_id ) {
    $permalink = get_permalink( $post_id );
     wp_redirect( $permalink );
    exit;
    }

    to the end of wpuf-add-post.php and wpuf-edit-post.php

    The Tareq code Work well to me. I put redirect to my Category name ??

    Thanks Tareq!!

    /***
     * Change the direction url
     *
     * @uses <code>wpuf_after_post_redirect</code> filter hook
     *
     * @param string $url the redirection url
     * return string new redirect url
     */
    function wpufe_force_redirection( $url ) {
        return home_url('../categoryname/');
    }
    add_filter( 'wpuf_after_post_redirect', 'wpufe_force_redirection' );

    After a post is submitted and the user is redirected to that post, I am trying to echo a message on the page they are redirected to, but I can’t get it to work.

    The redirect part works fine, but I can’t get it to echo anything on the page they are redirected to. How can I achieve this?

    This is the code I am using in wpuf-add-post.php:

    if ( $post_id ) {
    $permalink = get_permalink( $post_id );
     wp_redirect( $permalink );
    echo 'Post published succesfully';
    exit;
    }

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘[Plugin: WP User Frontend] redirecting after posting’ is closed to new replies.