themexpert / onepager

Onepage Theme/Website Builder for WordPress
https://themesgrove.com/wp-onepager/
Other
304 stars 101 forks source link

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead #156

Open anamwp opened 3 years ago

anamwp commented 3 years ago

array_key_exists() is deprecated in php 7.4 it give error on collection page (src > onepager > block > collection.php on line 5). Use that function as below.

public function get( $key ) {
        $new_arr = json_decode(json_encode($this), true);
        return array_key_exists(  $key, $new_arr ) ? $this[ $key ] : null;
    } 
shamsbd71 commented 3 years ago

@anamwp Can you submit a PR? i can merge that directly. Thank you