Could anybody help me on this please? Happend after updating to PHP 7.73 (stable) and updating theme as well as the plugins.
/**
* Get single meta box by name
*
* @param int $post_id
* @param string $control_name valid meta box name
* @param bool $remove_first remove first element
*
* @return array|boolean
*
* @access public
*/
public function get( $post_id, $control_name, $remove_first = true ) {
$post_meta = get_post_meta( $post_id, $this->getId(), true );
if ( $post_meta && RecursiveArray::searchKey( $control_name, $post_meta ) ) {
$meta_boxes = RecursiveArray::searchRecursive( $post_meta, $control_name );
if ( \count( $meta_boxes ) == 1 && \is_array( $meta_boxes ) && $remove_first ) {
return $meta_boxes[ 0 ];
}
if ( is_array( $meta_boxes ) ) {
$meta_boxes = RecursiveArray::removeEmpty( $meta_boxes );
}
return $meta_boxes;
} else {
return false;
}
}
Warning: count(): Parameter must be an array or an object that implements Countable in...
Error is within these lines:
if ( \count( $meta_boxes ) == 1 && \is_array( $meta_boxes ) && $remove_first ) {
return $meta_boxes[ 0 ];
}
How can I correct this so that I don't get this error? Is it something with the closing parenthesis?