Skip to:
Content

BuddyPress.org

Ticket #6795: 6795.02.patch

File 6795.02.patch, 1.7 KB (added by r-a-y, 9 years ago)
  • src/bp-activity/bp-activity-actions.php

     
    803803                        if ( null === $edit ) {
    804804                                bp_activity_post_type_publish( $post->ID, $post );
    805805                        }
     806
     807                // Allow plugins to eventually deal with other post stati.
     808                } else {
     809                        /**
     810                         * Fires when editing the post and the new status is not 'publish'.
     811                         *
     812                         * This is a variable filter that is dependent on the post type
     813                         * being untrashed.
     814                         *
     815                         * @since 2.5.0
     816                         *
     817                         * @param WP_Post $post Post data.
     818                         * @param string $new_status New status for the post.
     819                         * @param string $old_status Old status for the post.
     820                         */
     821                        do_action( 'bp_activity_post_type_edit_' . $post->post_type, $post, $new_status, $old_status );
    806822                }
    807823
    808824                return;
     
    833849        } elseif ( 'publish' === $old_status ) {
    834850                // Some form of pending status - only remove the activity entry.
    835851                bp_activity_post_type_unpublish( $post->ID, $post );
     852
     853        // For any other cases, allow plugins to eventually deal with it.
     854        } else {
     855                /**
     856                 * Fires when the old and the new post status are not 'publish'.
     857                 *
     858                 * This is a variable filter that is dependent on the post type
     859                 * being untrashed.
     860                 *
     861                 * @since 2.5.0
     862                 *
     863                 * @param WP_Post $post Post data.
     864                 * @param string $new_status New status for the post.
     865                 * @param string $old_status Old status for the post.
     866                 */
     867                do_action( 'bp_activity_post_type_transition_status_' . $post->post_type, $post, $new_status, $old_status );
    836868        }
    837869}
    838870add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );