Skip to main content
deleted 7 characters in body
Source Link
CodeMascot
  • 4.5k
  • 2
  • 14
  • 25

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post''trash_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    if ( !is_admin() ) {
        wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
        exit();
    }
}

Hope that helps.

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    if ( !is_admin() ) {
        wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
        exit();
    }
}

Hope that helps.

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'trash_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    if ( !is_admin() ) {
        wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
        exit();
    }
}

Hope that helps.

Add support for only frontend
Source Link
CodeMascot
  • 4.5k
  • 2
  • 14
  • 25

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    if ( !is_admin() ) {
        wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
        exit();
    }
}

Hope that helps.

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
    exit();
}

Hope that helps.

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    if ( !is_admin() ) {
        wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
        exit();
    }
}

Hope that helps.

Source Link
CodeMascot
  • 4.5k
  • 2
  • 14
  • 25

There is a action hook in wp_delete_post() called after_delete_post. So hook a function in that hook and redirect your user to where ever you want. You can redirect to author's page by below code-

add_action( 'after_delete_post', 'the_dramatist_redirect_after_post_delete' );
function the_dramatist_redirect_after_post_delete() {
    wp_safe_redirect( get_author_posts_url( get_current_user_id() ) );
    exit();
}

Hope that helps.