| @@ -396,9 +396,11 @@ | ||
| 396 | 396 | $array_value = array(); |
| 397 | 397 | foreach ( $value as $v ) { |
| 398 | 398 | if ( ! empty( $v ) ) { |
| 399 | 399 | $data = $this->uwp_array_search( $option_values_arr, 'value', $v ); |
| 400 | - $array_value[] = $data[0]['label']; | |
| 400 | + if ( ! empty( $data ) && isset( $data[0]['label'] ) ) { | |
| 401 | + $array_value[] = $data[0]['label']; | |
| 402 | + } | |
| 401 | 403 | } |
| 402 | 404 | |
| 403 | 405 | } |
| 404 | 406 | if ( ! empty( $array_value ) ) { |
| @@ -1760,8 +1762,16 @@ | ||
| 1760 | 1762 | * @return string Html. |
| 1761 | 1763 | */ |
| 1762 | 1764 | public function crop_submit_form( $type = 'avatar' ) { |
| 1763 | 1765 | |
| 1766 | + if ( is_admin() && defined( 'IS_PROFILE_PAGE' ) && IS_PROFILE_PAGE ) { | |
| 1767 | + $user_id = get_current_user_id(); | |
| 1768 | + } elseif ( is_admin() && current_user_can( 'manage_options' ) && ! empty( $_GET['user_id'] ) && is_numeric( $_GET['user_id'] ) ) { | |
| 1769 | + $user_id = absint( $_GET['user_id'] ); | |
| 1770 | + } else { | |
| 1771 | + $user_id = get_current_user_id(); | |
| 1772 | + } | |
| 1773 | + | |
| 1764 | 1774 | ob_start(); |
| 1765 | 1775 | |
| 1766 | 1776 | // get file sizes |
| 1767 | 1777 | $files = new UsersWP_Files(); |
| @@ -1768,9 +1778,9 @@ | ||
| 1768 | 1778 | $max_file_size = $files->uwp_get_max_upload_size( $type ); |
| 1769 | 1779 | |
| 1770 | 1780 | $design_style = uwp_get_option( "design_style", 'bootstrap' ); |
| 1771 | 1781 | $template = $design_style ? $design_style . "/modal-profile-image.php" : "modal-profile-image.php"; |
| 1772 | - uwp_get_template( $template ); | |
| 1782 | + uwp_get_template( $template, array( 'user_id' => $user_id ) ); | |
| 1773 | 1783 | |
| 1774 | 1784 | $content_wrap = $design_style == 'bootstrap' ? '.uwp-profile-image-change-modal .modal-content' : '#uwp-popup-modal-wrap'; |
| 1775 | 1785 | $bg_color = apply_filters('uwp_crop_image_bg_color', '', $type); |
| 1776 | 1786 | |