Saturday, December 3, 2022
HomeWordPress Developmentphp - Frontend redirect after delete publish in wordpress

php – Frontend redirect after delete publish in wordpress


I am utilizing the next hyperlink to delete a publish within the frontend of wordpress:

perform wp_delete_post_link($hyperlink = 'Delete', $earlier than="", $after="")
{
world $publish;
if ( $post->post_type == 'web page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) )
return;
} else {
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
}
$hyperlink = "<a href="https://wordpress.stackexchange.com/questions/411787/" . wp_nonce_url( get_bloginfo("url') . "/wp-admin/publish.php?motion=delete&amp;publish=" . $post->ID, 'delete-post_' . $post->ID) . "'>".$hyperlink."</a>";
echo $earlier than . $hyperlink . $after;
}

 
perform remove_parent_theme_features() {
    
}
add_action( 'after_setup_theme', 'remove_parent_theme_features', 10 );

This works advantageous. However after I delete the publish its takes me to the 404 Not Discovered web page. What can I add to point out a short message that confirms the posts deletion and redirect again to a different web page?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments