WordPress.org

Ready to get started?Download WordPress

Forums

add_action question (1 post)

  1. Jelena85
    Member
    Posted 5 years ago #

    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...
    Jelena

    function asd (){
    .
    .
    .
    wp_insert_post( $my_new_post );
    }

    add_action ('publish_post', 'asd');

Topic Closed

This topic has been closed to new replies.

About this Topic