Yes, you can change post title and slug from frontend. by using wp_update_post
you can change title and slug of post. in below code, it will update post title and slug of post_id
. Replace your-post-title-field
with your title field in form. slug will generated using that post title.
if ( isset( $_POST['my_image_upload_nonce'], $_POST['post_id'] )
&& wp_verify_nonce( $_POST['my_image_upload_nonce'], 'my_image_upload' )
&& current_user_can( 'manage_options', $_POST['post_id'] )) {
if(!empty($_POST['your-post-title-field']))
{
$new_slug = $new_title = sanitize_title($_POST['your-post-title-field']);
wp_update_post(
array (
'ID' => $_POST['post_id'],
'post_title' => $new_title,
'post_name' => $new_slug
)
);
}
}