After I added a post by wp_insert_post();
Any callback after I added ? I need permalink of added post.
I have idea only search by title and post-type (I use custom post-type in my case), But any better function ?
2 Answers
$post_id = wp_insert_post( $arg ); #returns post ID
$permalink = get_permalink( $post_id ); #returns the permalink
Codex:
http://codex.wordpress.org/Function_Reference/wp_insert_post