[wp-trac] [WordPress Trac] #31703: Trying to get property of non-object in nav-menu.php

WordPress Trac noreply at wordpress.org
Fri Mar 20 09:49:08 UTC 2015


#31703: Trying to get property of non-object in nav-menu.php
---------------------------+--------------------
 Reporter:  mehulkaklotar  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  4.2
Component:  Menus          |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+--------------------

Comment (by mehulkaklotar):

 In the code below, we have $original_object->ID, in my case the ID is also
 not set. which causes the error.
 {{{
 if ( '' === $original_title ) {
     $original_title = sprintf( __( '#%d (no title)' ),
 $original_object->ID );
 }
 }}}

 is should be checked first. So it is better, we check for $original_object
 first before doing anything.

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


More information about the wp-trac mailing list