WordPress.org

Ready to get started?Download WordPress

Forums

Adding own function (1 post)

  1. aquanutz
    Member
    Posted 7 years ago #

    If I want to add my own php function to be run when someone presses the 'publish' button are these the only things that I need to do?

    1. In the publish-post.php file add:
    if ($post_status == 'publish') {
    add_action('publish_post', 'makeLink') .... }
    2. add my code to the functions.php file
    Is that all? I understand that when someone presses the "publish" button my code will be added with the
    add() call but do I also need to do a do()` call also? I'm new to this so thanks for any help you can give.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags