[wp-trac] [WordPress Trac] #56590: TypeError error in get_the_content when $elements['page'] and $elements['pages'] are null

WordPress Trac noreply at wordpress.org
Fri Sep 16 22:45:19 UTC 2022


#56590: TypeError error in get_the_content when $elements['page'] and
$elements['pages'] are null
-------------------------------------+------------------------------
 Reporter:  cantbelieveitsnotbutter  |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Bootstrap/Load           |     Version:  6.0.2
 Severity:  normal                   |  Resolution:
 Keywords:                           |     Focuses:
-------------------------------------+------------------------------

Comment (by cantbelieveitsnotbutter):

 Another, and perhaps better, solution is to use type conditions, e.g., `if
 ( 'integer' === gettype( $elements['page'] ) && 'array' === gettype(
 $elements['pages'] ) )`.

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


More information about the wp-trac mailing list