This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function to be executed when a custom post type is published | |
function run_when_post_published() | |
{ | |
// your function code here | |
} | |
// replace {custom_post_type_name} with the name of your post type | |
add_action('new_to_publish_{custom_post_type_name}', 'run_when_post_published'); | |
add_action('draft_to_publish_{custom_post_type_name}', 'run_when_post_published'); | |
add_action('pending_to_publish_{custom_post_type_name}', 'run_when_post_published'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Put this in your ( for example ) functions.php file. | |
** Credits | |
** http://pastebin.com/qrfjCat8 | |
** http://premium.wpmudev.org/forums/topic/how-to-add-custom-posts-types-in-buddypress-activity | |
*/ | |
function custom_record_activity( $post_id, $post, $user_id = false ) { | |
global $bp, $wpdb; |
NewerOlder