- Timestamp:
- 10/04/2015 01:47:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r10180 r10184 929 929 930 930 $activity_id = 0; 931 if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) { 931 $item_id = 0; 932 $object = ''; 933 934 935 // Try to get the item id from posted variables. 936 if ( ! empty( $_POST['item_id'] ) ) { 937 $item_id = (int) $_POST['item_id']; 938 } 939 940 // Try to get the object from posted variables. 941 if ( ! empty( $_POST['object'] ) ) { 942 $object = sanitize_key( $_POST['object'] ); 943 944 // If the object is not set and we're in a group, set the item id and the object 945 } elseif ( bp_is_group() ) { 946 $item_id = bp_get_current_group_id(); 947 $object = 'groups'; 948 } 949 950 if ( ! $object && bp_is_active( 'activity' ) ) { 932 951 $activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) ); 933 952 934 } elseif ( $_POST['object'] == 'groups') {935 if ( ! empty( $_POST['item_id'] )&& bp_is_active( 'groups' ) )936 $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $ _POST['item_id']) );953 } elseif ( 'groups' === $object ) { 954 if ( $item_id && bp_is_active( 'groups' ) ) 955 $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $item_id ) ); 937 956 938 957 } else { 939 958 940 959 /** This filter is documented in bp-activity/bp-activity-actions.php */ 941 $activity_id = apply_filters( 'bp_activity_custom_update', false, $ _POST['object'], $_POST['item_id'], $_POST['content'] );960 $activity_id = apply_filters( 'bp_activity_custom_update', false, $object, $item_id, $_POST['content'] ); 942 961 } 943 962
Note: See TracChangeset
for help on using the changeset viewer.