Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1388911
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionChecking 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?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionChecking 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?
Share Improve this question edited Mar 27, 2020 at 23:56 Peter Mortensen 2682 silver badges10 bronze badges asked Apr 24, 2018 at 13:05 DemonixDemonix 613 silver badges12 bronze badges 1- I got this error today (2020-03-27) after updating WordPress to 5.3.2 (using theme "Responsive"). It happened on submitting updates to an existing blog post. It seems to be theme specific (and updating to the new version of the theme released today did not fix the problem). The workaround is to change to another theme (at least during adding/changing content) - I used the official "Twenty Twenty" theme. – Peter Mortensen Commented Mar 27, 2020 at 22:40
1 Answer
Reset to default 0From the php manual the array_key_exists()
function takes as first argument "any value possible for an array index.", again looking up for arrays in the docs we can get that "The key can either be an integer or a string. The value can be of any type.", which also corresponds to the error you see from the Query Monitor.
Meaning that the $taxonomy
variable that is passing to the array_key_exists()
is not either a string or integer.
You can debug the $taxonomy
variable, by making a var_dump($taxonomy);
.
Hope, that helps.
本文标签: phpPlugin error quotarraykeyexists() The first argument should be either a string or an integerquot
版权声明:本文标题:php - Plugin error "array_key_exists(): The first argument should be either a string or an integer" 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744627700a2616354.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论