Uncaught Error: Non-static method globals::getInstance() cannot be called static
-
Debugging a custom WP theme and trying to update to WordPress 6 and PHP 8. Keep getting this error
Fatal error: Uncaught Error: Non-static method globals::getInstance() cannot be called statically in…functions.php
Here is the code block in question from my functions.php
function get_resource_cat_ids(){ $IDArray = array(); $resources_id = globals::getInstance()->resources_id; $categories = get_categories( array( 'parent' => $resources_id ) ); foreach($categories as $cat) { array_push($IDArray, $cat->term_id); } array_push($IDArray, $resources_id); return $IDArray; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Uncaught Error: Non-static method globals::getInstance() cannot be called static’ is closed to new replies.