WordPress.org

Plugin Directory

Changeset 244779


Ignore:
Timestamp:
05/23/10 15:25:21 (4 years ago)
Author:
ryan
Message:

Handle WP_Error. Props ampt. fixes #WP13460

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wpcat2tag-importer/trunk/wp-cat2tag.php

    r244682 r244779  
    276276                        $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); 
    277277 
     278                    if ( is_wp_error($id) ) { 
     279                        echo $id->get_error_message() . "</li>\n"; 
     280                        continue; 
     281                    } 
     282 
    278283                    $id = $id['term_taxonomy_id']; 
    279284                    $posts = get_objects_in_term($category->term_id, 'category'); 
Note: See TracChangeset for help on using the changeset viewer.