- Timestamp:
- 03/02/2018 07:37:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-attachment-cover-image.php
r11447 r11875 97 97 */ 98 98 public function upload_dir_filter( $upload_dir = array() ) { 99 // Default values are for profiles. 100 $object_id = bp_displayed_user_id(); 101 102 if ( empty( $object_id ) ) { 103 $object_id = bp_loggedin_user_id(); 104 } 105 106 $object_directory = 'members'; 107 108 // We're in a group, edit default values. 109 if ( bp_is_group() || bp_is_group_create() ) { 110 $object_id = bp_get_current_group_id(); 111 $object_directory = 'groups'; 112 } 113 114 // Set the subdir. 115 $subdir = '/' . $object_directory . '/' . $object_id . '/cover-image'; 116 117 /** 118 * Filters the cover image upload directory. 119 * 120 * @since 2.4.0 121 * 122 * @param array $value Array containing the path, URL, and other helpful settings. 123 * @param array $upload_dir The original Uploads dir. 124 */ 125 return apply_filters( 'bp_attachments_cover_image_upload_dir', array( 126 'path' => $this->upload_path . $subdir, 127 'url' => $this->url . $subdir, 128 'subdir' => $subdir, 129 'basedir' => $this->upload_path, 130 'baseurl' => $this->url, 131 'error' => false 132 ), $upload_dir ); 99 return bp_attachments_cover_image_upload_dir(); 133 100 } 134 101
Note: See TracChangeset
for help on using the changeset viewer.