[wp-trac] [WordPress Trac] #43772: Undefined property: WP_Error::$term_id in /var/www/html/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php on line 655

WordPress Trac noreply at wordpress.org
Sat Apr 14 17:52:47 UTC 2018


#43772: Undefined property: WP_Error::$term_id in /var/www/html/web/wp/wp-includes
/rest-api/endpoints/class-wp-rest-terms-controller.php on line 655
--------------------------+------------------------------
 Reporter:  mahnunchik    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  4.9.5
 Severity:  major         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by mahnunchik):

 {{{
                 if ( isset( $request['parent'] ) && ! empty(
 $schema['properties']['parent'] ) ) {
                         $parent_term_id = 0;
                         $parent_term    = get_term( (int)
 $request['parent'], $this->taxonomy );

                         if ( $parent_term ) {
 655->                   $parent_term_id = $parent_term->term_id;
                         }

                         $prepared_term->parent = $parent_term_id;
                 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43772#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list