← All changes
|
features/email-confirmation/email-confirmation.php
+13
-14
3.16.5
→
4.0.3
View file →
| @@ -142,8 +142,19 @@ | ||
| 142 | 142 | alert( response.trim() ); |
| 143 | 143 | }); |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | + | |
| 147 | + jQuery(document).on('click', 'a.wppb-ec-action', function(e) { | |
| 148 | + e.preventDefault(); | |
| 149 | + var link = jQuery(this); | |
| 150 | + confirmECAction( | |
| 151 | + link.attr('data-url'), | |
| 152 | + link.attr('data-todo'), | |
| 153 | + link.attr('data-email'), | |
| 154 | + link.attr('data-message') | |
| 155 | + ); | |
| 156 | + }); | |
| 146 | 157 | </script> |
| 147 | 158 | <?php |
| 148 | 159 | } |
| 149 | 160 | |
| @@ -298,15 +309,9 @@ | ||
| 298 | 309 | case 'Upload':{ |
| 299 | 310 | if ( isset( $meta[$value['meta-name']] ) ){ |
| 300 | 311 | if( !empty( $meta[$value['meta-name']] ) ) { |
| 301 | 312 | if (is_numeric($meta[$value['meta-name']])) { |
| 302 | - update_user_meta($user_id, $value['meta-name'], trim($meta[$value['meta-name']])); | |
| 303 | - | |
| 304 | - // use this to update the post author to the correct user | |
| 305 | - wp_update_post( array( | |
| 306 | - 'ID' => trim( $meta[$value['meta-name']] ), | |
| 307 | - 'post_author' => $user_id | |
| 308 | - ) ); | |
| 313 | + wppb_save_attachment_id( trim( $meta[$value['meta-name']] ), $value, $user_id ); | |
| 309 | 314 | } else { |
| 310 | 315 | $wp_upload_array = wp_upload_dir(); // Array of key => value pairs |
| 311 | 316 | |
| 312 | 317 | $file = trim($meta[$value['meta-name']]); |
| @@ -335,15 +340,9 @@ | ||
| 335 | 340 | case 'Avatar':{ |
| 336 | 341 | if ( isset( $meta[$value['meta-name']] ) ) { |
| 337 | 342 | if( !empty( $meta[$value['meta-name']] ) ) { |
| 338 | 343 | if (is_numeric($meta[$value['meta-name']])) { |
| 339 | - update_user_meta($user_id, $value['meta-name'], trim($meta[$value['meta-name']])); | |
| 340 | - | |
| 341 | - // use this to update the post author to the correct user | |
| 342 | - wp_update_post( array( | |
| 343 | - 'ID' => trim( $meta[$value['meta-name']] ), | |
| 344 | - 'post_author' => $user_id | |
| 345 | - ) ); | |
| 344 | + wppb_save_attachment_id( trim( $meta[$value['meta-name']] ), $value, $user_id ); | |
| 346 | 345 | } else { |
| 347 | 346 | $wp_upload_array = wp_upload_dir(); // Array of key => value pairs |
| 348 | 347 | |
| 349 | 348 | $file = trim($meta[$value['meta-name']]); |