[wp-trac] [WordPress Trac] #13373: category function creates error: Object of class WP_Error could not be converted to string

WordPress Trac wp-trac at lists.automattic.com
Thu May 13 10:14:14 UTC 2010


#13373: category function creates error: Object of class WP_Error could not be
converted to string
-----------------------------+----------------------------------------------
 Reporter:  christian_gnoth  |       Owner:                                         
     Type:  defect (bug)     |      Status:  new                                    
 Priority:  high             |   Milestone:  Unassigned                             
Component:  General          |     Version:  2.9.2                                  
 Severity:  major            |    Keywords:  get_cat_id, get_category_link, WP_error
-----------------------------+----------------------------------------------
 Hello,

 I am using the following PHP script lines:

  $category_id = get_cat_ID( $row['title'] );
  // Get the URL of this category
  $category_link = get_category_link( $category_id );
  $j2wp_post['post_content'] =  substr( $j2wp_post['post_content'], 0,
 $lnk_pos) . 'href="' . $category_link . '" ' . substr(
 $j2wp_post['post_content'], $post_lnk_end + 1);

 they create the subsequent error in the assignment:

 $j2wp_post['post_content'] =

 Catchable fatal error: Object of class WP_Error could not be converted to
 string

 As there is no error in the assignment and I found a lot of hints for the
 categories - one of this two fundtions creates this error.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13373>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list