Changeset 13108 for trunk/src/bp-core/bp-core-attachments.php
- Timestamp:
- 09/12/2021 08:43:39 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-attachments.php
r12901 r13108 92 92 } 93 93 94 $r = bp_parse_args( $args, array( 95 'object_id' => $object_id, 96 'object_directory' => $object_directory, 97 ), 'cover_image_upload_dir' ); 98 94 $r = bp_parse_args( 95 $args, 96 array( 97 'object_id' => $object_id, 98 'object_directory' => $object_directory, 99 ), 100 'cover_image_upload_dir' 101 ); 99 102 100 103 // Set the subdir. … … 287 290 } 288 291 289 $r = bp_parse_args( $args, array( 290 'item_id' => 0, 291 'object' => 'user', 292 'component' => '', 293 'image' => '', 294 'crop_w' => 0, 295 'crop_h' => 0, 296 'crop_x' => 0, 297 'crop_y' => 0 298 ), 'create_item_' . $type ); 292 $r = bp_parse_args( 293 $args, 294 array( 295 'item_id' => 0, 296 'object' => 'user', 297 'component' => '', 298 'image' => '', 299 'crop_w' => 0, 300 'crop_h' => 0, 301 'crop_x' => 0, 302 'crop_y' => 0, 303 ), 304 'create_item_' . $type 305 ); 299 306 300 307 if ( empty( $r['item_id'] ) || empty( $r['object'] ) || ! file_exists( $r['image'] ) || ! @getimagesize( $r['image'] ) ) { … … 446 453 $attachment_data = false; 447 454 448 $r = bp_parse_args( $args, array( 449 'object_dir' => 'members', 450 'item_id' => bp_loggedin_user_id(), 451 'type' => 'cover-image', 452 'file' => '', 453 ), 'attachments_get_attachment_src' ); 455 $r = bp_parse_args( 456 $args, 457 array( 458 'object_dir' => 'members', 459 'item_id' => bp_loggedin_user_id(), 460 'type' => 'cover-image', 461 'file' => '', 462 ), 463 'attachments_get_attachment_src' 464 ); 454 465 455 466 /** … … 698 709 699 710 // Get an instance of the class and get the script data. 700 $attachment = new $class; 701 $script_data = $attachment->script_data(); 702 703 $args = bp_parse_args( $script_data, array( 704 'action' => '', 705 'file_data_name' => '', 706 'max_file_size' => 0, 707 'browse_button' => 'bp-browse-button', 708 'container' => 'bp-upload-ui', 709 'drop_element' => 'drag-drop-area', 710 'bp_params' => array(), 711 'extra_css' => array(), 712 'extra_js' => array(), 713 'feedback_messages' => array(), 714 ), 'attachments_enqueue_scripts' ); 711 $attachment = new $class; 712 $script_data = $attachment->script_data(); 713 714 $args = bp_parse_args( 715 $script_data, 716 array( 717 'action' => '', 718 'file_data_name' => '', 719 'max_file_size' => 0, 720 'browse_button' => 'bp-browse-button', 721 'container' => 'bp-upload-ui', 722 'drop_element' => 'drag-drop-area', 723 'bp_params' => array(), 724 'extra_css' => array(), 725 'extra_js' => array(), 726 'feedback_messages' => array(), 727 ), 728 'attachments_enqueue_scripts' 729 ); 715 730 716 731 if ( empty( $args['action'] ) || empty( $args['file_data_name'] ) ) { … … 1022 1037 1023 1038 // Set default args. 1024 $default_args = wp_parse_args(1039 $default_args = bp_parse_args( 1025 1040 $args, 1026 1041 array( … … 1050 1065 * @param array $settings The cover image settings 1051 1066 */ 1052 $settings = bp_parse_args( $args, $default_args, $component . '_cover_image_settings' ); 1067 $settings = bp_parse_args( 1068 $args, 1069 $default_args, 1070 $component . '_cover_image_settings' 1071 ); 1053 1072 1054 1073 // Handle deprecated xProfile fitler. … … 1282 1301 } 1283 1302 1284 $bp_params = bp_parse_args( $_POST['bp_params'], array( 1285 'object' => 'user', 1286 'item_id' => bp_loggedin_user_id(), 1287 ), 'attachments_cover_image_ajax_upload' ); 1303 $bp_params = bp_parse_args( 1304 $_POST['bp_params'], 1305 array( 1306 'object' => 'user', 1307 'item_id' => bp_loggedin_user_id(), 1308 ), 1309 'attachments_cover_image_ajax_upload' 1310 ); 1288 1311 1289 1312 $bp_params['item_id'] = (int) $bp_params['item_id'];
Note: See TracChangeset
for help on using the changeset viewer.