Make WordPress Core

Ticket #58234: 58234.diff

File 58234.diff, 761 bytes (added by mouhdev, 2 years ago)
  • src/wp-includes/class-wp-query.php

     
    21072107
    21082108                                if ( ! $ptype_obj->hierarchical ) {
    21092109                                        // Non-hierarchical post types can directly use 'name'.
    2110                                         $q['name'] = $q[ $ptype_obj->query_var ];
     2110                                        $q['name'] = is_string( $q[ $ptype_obj->query_var ] ) ? $q[ $ptype_obj->query_var ] : '';
    21112111                                } else {
    21122112                                        // Hierarchical post types will operate through 'pagename'.
    2113                                         $q['pagename'] = $q[ $ptype_obj->query_var ];
     2113                                        $q['pagename'] = is_string( $q[ $ptype_obj->query_var ] ) ? $q[ $ptype_obj->query_var ] : '';
    21142114                                        $q['name']     = '';
    21152115                                }
    21162116