Changeset 5367
- Timestamp:
- 04/19/2017 06:08:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-mentors/includes/tasks-data.php
r5366 r5367 10 10 11 11 use WordCamp\Mentors; 12 use WordCamp\Logger; 12 13 13 14 /** … … 681 682 ); 682 683 683 $post_id = wp_insert_post( $args ); 684 $post_id = wp_insert_post( $args, true ); 685 686 if ( is_wp_error( $post_id ) ) { 687 $results[] = $post_id; 688 continue; 689 } 684 690 685 691 $results[] = wp_set_object_terms( $post_id, $data['cat'], Mentors\PREFIX . '_task_category' ); 686 692 } 687 693 688 if ( in_array( false, $results, true ) || 689 ! empty( array_filter( $results, function( $i ) { return $i instanceof \WP_Error; } ) ) ) { 694 $errors = array_filter( $results, function( $i ) { 695 return $i instanceof \WP_Error; 696 } ); 697 698 if ( in_array( false, $results, true ) || ! empty( $errors ) ) { 699 foreach ( $errors as $error ) { 700 Logger\log( 'task_error', compact( $error->get_error_code(), $error->get_error_message() ) ); 701 } 702 690 703 return 'reset-errors'; 691 704 }
Note:
See TracChangeset
for help on using the changeset viewer.