Changeset 10189
- Timestamp:
- 10/05/2015 10:12:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-attachments.php
r10154 r10189 917 917 918 918 // We need it to carry on 919 if ( ! empty( $_POST['bp_params' 920 $bp_params = bp_parse_args( $_POST['bp_params' 919 if ( ! empty( $_POST['bp_params'] ) ) { 920 $bp_params = bp_parse_args( $_POST['bp_params'], array( 921 921 'object' => 'user', 922 922 'item_id' => bp_loggedin_user_id(), … … 939 939 $needs_reset = array(); 940 940 941 // Default object data 942 $object_data = array( 'dir' => 'members', 'component' => 'xprofile' ); 943 if ( 'group' === $bp_params['object'] ) { 941 // Member's cover image 942 if ( 'user' === $bp_params['object'] ) { 943 $object_data = array( 'dir' => 'members', 'component' => 'xprofile' ); 944 945 if ( ! bp_displayed_user_id() && ! empty( $bp_params['item_id'] ) ) { 946 $needs_reset = array( 'key' => 'displayed_user', 'value' => $bp->displayed_user ); 947 $bp->displayed_user->id = $bp_params['item_id']; 948 } 949 950 // Group's cover image 951 } elseif ( 'group' === $bp_params['object'] ) { 944 952 $object_data = array( 'dir' => 'groups', 'component' => 'groups' ); 945 953 … … 951 959 ) ); 952 960 } 953 } elseif ( 'user' !== $bp_params['object'] ) { 954 $object_data = apply_filters( 'bp_attachments_cover_image_object_dir', $object_data, $bp_params['object'] ); 955 956 if ( ! bp_displayed_user_id() && ! empty( $bp_params['item_id'] ) ) { 957 $needs_reset = array( 'key' => 'displayed_user', 'value' => $bp->displayed_user ); 958 $bp->displayed_user->id = $bp_params['item_id']; 959 } 961 962 // Other object's cover image 963 } else { 964 $object_data = apply_filters( 'bp_attachments_cover_image_object_dir', array(), $bp_params['object'] ); 965 } 966 967 // Stop here in case of a missing parameter for the object 968 if ( empty( $object_data['dir'] ) || empty( $object_data['component'] ) ) { 969 bp_attachments_json_response( false, $is_html4 ); 960 970 } 961 971
Note: See TracChangeset
for help on using the changeset viewer.