diff --git src/bp-activity/bp-activity-actions.php src/bp-activity/bp-activity-actions.php
index 7d17133..7ec5e39 100644
|
|
function bp_activity_catch_transition_post_type_status( $new_status, $old_status |
798 | 798 | // An edit of an existing post should update the existing activity item. |
799 | 799 | if ( $new_status == 'publish' ) { |
800 | 800 | bp_activity_post_type_update( $post ); |
| 801 | |
| 802 | // Allow plugins to eventually deal with other post stati |
| 803 | } else { |
| 804 | /** |
| 805 | * Fires when editing the post and the new status is not 'publish'. |
| 806 | * |
| 807 | * This is a variable filter that is dependent on the post type |
| 808 | * being untrashed. |
| 809 | * |
| 810 | * @since 2.5.0 |
| 811 | * |
| 812 | * @param WP_Post $post Post data. |
| 813 | * @param string $new_status New status for the post. |
| 814 | * @param string $old_status Old status for the post. |
| 815 | */ |
| 816 | do_action( 'bp_activity_post_type_edit_' . $post->post_type, $post, $new_status, $old_status ); |
801 | 817 | } |
802 | 818 | |
803 | 819 | return; |
… |
… |
function bp_activity_catch_transition_post_type_status( $new_status, $old_status |
828 | 844 | } elseif ( 'publish' === $old_status ) { |
829 | 845 | // Some form of pending status - only remove the activity entry. |
830 | 846 | bp_activity_post_type_unpublish( $post->ID, $post ); |
| 847 | |
| 848 | // For any other cases, allow plugins to eventually deal with it |
| 849 | } else { |
| 850 | /** |
| 851 | * Fires when the old and the new post status are not 'publish'. |
| 852 | * |
| 853 | * This is a variable filter that is dependent on the post type |
| 854 | * being untrashed. |
| 855 | * |
| 856 | * @since 2.5.0 |
| 857 | * |
| 858 | * @param WP_Post $post Post data. |
| 859 | * @param string $new_status New status for the post. |
| 860 | * @param string $old_status Old status for the post. |
| 861 | */ |
| 862 | do_action( 'bp_activity_post_type_transition_status_' . $post->post_type, $post, $new_status, $old_status ); |
831 | 863 | } |
832 | 864 | } |
833 | 865 | add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 ); |