Support » Plugins » add_action question

  • Hi guys, I want to create new post with some parameters after original post is published, can this be done, I mean can I trigger wp_insert_post function from plugin?
    I tried and everything is ok, i mean there is no exceptions, but no new post is writen to the database.
    This is my first plugin, sorry if I ask dumb questions…

    function asd (){
    wp_insert_post( $my_new_post );

    add_action (‘publish_post’, ‘asd’);

  • The topic ‘add_action question’ is closed to new replies.