2

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 ?

3
$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

| improve this answer | |
1

Oh I found !

$post_id = wp_insert_post($arg); // return post ID
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.