Changeset 405628
- Timestamp:
- 07/06/2011 06:50:15 PM (15 years ago)
- File:
-
- 1 edited
-
buddypress-custom-posts/trunk/controller.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
buddypress-custom-posts/trunk/controller.php
r368058 r405628 825 825 826 826 $args = Array( 827 'action' => sprintf( __( "%s created the %s <a href = '%s'>%s</a>." ), bp_core_get_userlink( $post->post_author ), $object->labels->singular_name, get_permalink( $post->ID ), get_the_title( $post_id )),827 'action' => sprintf( __( "%s created the %s <a href = '%s'>%s</a>." ), bp_core_get_userlink( $post->post_author ), $object->labels->singular_name, get_permalink( $post->ID ), $post->post_title ), 828 828 'content' => '', 829 829 'type' => 'new_' . $object->id … … 831 831 832 832 $args = apply_filters( 'bpcp_create_' . $object->id . '_activity', apply_filters( 'bpcp_create_activity', $args, $post->ID ), $post->ID ); 833 do_action( 'bpcp_create_activity', $args ); 833 834 834 835 bp_activity_add( Array( … … 840 841 'item_id' => $post->ID 841 842 ) ); 842 843 843 } else return false; 844 844 } … … 882 882 */ 883 883 function edit_post_activity( $postid, $post ) { 884 //Eliminating Create 885 if ( !( $new_status != $old_status && $new_status == 'publish' && $post->post_type == $this->id ) ) { 886 if ( $post->post_status == 'publish' && $post->post_type == $this->id ) { 887 $object = get_post_type_object( $post->post_type ); 888 889 $args = Array( 890 'action' => sprintf( __( "%s updated the %s <a href = '%s'>%s</a>." ), bp_core_get_userlink( $post->post_author ), $object->labels->singular_name, get_permalink( $post->ID ), get_the_title( $post->ID ) ), 891 'content' => '', 892 'type' => 'activity_update' 893 ); 894 895 $args = apply_filters( 'bpcp_edit_' . $object->id . '_activity', apply_filters( 'bpcp_edit_activity', $args, $post->ID ) ); 896 897 bp_activity_add( Array( 898 'action' => $args['action'], 899 'component' => $this->id, 900 'content' => $args['content'], 901 'type' => $args['type'], 902 'user_id' => $post->post_author, 903 'item_id' => $post->ID 904 ) ); 905 } 906 } 884 if ( $post->post_status == 'publish' && $post->post_type == $this->id && did_action( 'bpcp_create_activity' ) <= 0 ) { 885 $object = get_post_type_object( $post->post_type ); 886 887 $args = Array( 888 'action' => sprintf( __( "%s updated the %s <a href = '%s'>%s</a>." ), bp_core_get_userlink( $post->post_author ), $object->labels->singular_name, get_permalink( $post->ID ), get_the_title( $post->ID ) ), 889 'content' => '', 890 'type' => 'activity_update' 891 ); 892 893 $args = apply_filters( 'bpcp_edit_' . $object->id . '_activity', apply_filters( 'bpcp_edit_activity', $args, $post->ID ) ); 894 895 bp_activity_add( Array( 896 'action' => $args['action'], 897 'component' => $this->id, 898 'content' => $args['content'], 899 'type' => $args['type'], 900 'user_id' => $post->post_author, 901 'item_id' => $post->ID 902 ) ); 903 } else return false; 907 904 } 908 905
Note: See TracChangeset
for help on using the changeset viewer.