In functions.php: function mynewproduct(){ myfunction(); } add_action( 'new_product', 'mynewproduct' ); For more and the official documentation, refer here: http://codex.wordpress.org/Post_Status_Transitions More Solution categories - 5 blogs on one WordPress site in WordPress templates - Updating WordPress overwriting customization tweaks - strategies? in WordPress licensing - Am I allowed to license my Wordpress theme under the aGPL in WordPress security - Can I rename the wp-admin folder? in WordPress php - WordPress Theme variables scope in WordPress Reffered: https://wordpress.org/