Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #52738, comment 4


Ignore:
Timestamp:
11/11/2022 07:17:00 AM (3 years ago)
Author:
cadic
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #52738, comment 4

    initial v1  
    44<?php
    55function wp_get_object_vars( $object ) {
    6         $result = get_object_vars( $object );
    7         if ( isset( $result[ chr( 0 ) ] ) ) {
    8                 unset( $result[ chr( 0 ) ] );
    9         }
    10         return $result;
     6        return array_filter(
     7                get_object_vars( $object ),
     8                function( $key ) {
     9                        return ord( $key ) !== 0;
     10                },
     11                ARRAY_FILTER_USE_KEY
     12        );
    1113}
    12 
    1314}}}