Plugin error “array_key_exists(): The first argument should be either a string or an integer” [closed]

Question

Checking the Query Monitor, it’s throwing out this error,

array_key_exists(): The first argument should be either a string or an integer

which relates to this function:

public function lsx_team_scporder_get_terms_orderby( $orderby, $args ) {
    if ( is_admin() )
        return $orderby;

    $tags = $this->get_lsx_team_scporder_options_tags();

    if ( ! isset( $args['taxonomy'] ) )
        return $orderby;

    $taxonomy = $args['taxonomy'];
    if ( is_array( $taxonomy ) && count( $taxonomy ) == 1 )
        $taxonomy = $taxonomy[0];
    if ( ! array_key_exists($taxonomy, $tags ) )
        return $orderby;

    $orderby = 't.lsx_team_term_order';
    return $orderby;
}

Why is it throwing out that error?

0
, , Demonix 3 years 2020-03-27T20:51:07-05:00 0 Answers 147 views 0

Leave an answer

Browse
Browse