Update POST_NAME
-
Hello,
I like to update the POST_NAME after I updated the post title. This seems not to work automaticly.
I use this function to update the POST_NAME. As far as I can see, this worsk very well. Or do I miss something important? Maybe I can delete the sanitize_title if the wp_update_post does it on its own.
$my_post = array( 'ID' => $post_id, 'post_name' => sanitize_title( get_the_title( $post_id ) ) ); wp_update_post( $my_post );
Thanks for help,
Denis
- The topic ‘Update POST_NAME’ is closed to new replies.