您好,我收到Wordpress includes的一个错误,当我发布分类法的多个值时会出现此错误
<form role="search" method="post" id="searchform" action="<?php echo home_url( \'/\' ); ?>">
<select name="books[]" multiple>
<option value="a">a</option>
<option value="b">b</option>
</select>
<input type="submit" id="searchsubmit" value="Search" />
</form>
警告:strpos()要求参数1为字符串,数组在www.domain中给出。com\\wordpress\\wp包含\\查询。php在线1718警告:preg\\u split()要求参数2为字符串,数组在www.domain中给出。com\\wordpress\\wp包含\\查询。php联机1719警告:为www.domain中的foreach()提供的参数无效。com\\wordpress\\wp包含\\查询。php联机1720 foreach ( $GLOBALS[\'wp_taxonomies\'] as $taxonomy => $t ) {
if ( \'post_tag\' == $taxonomy )
continue; // Handled further down in the $q[\'tag\'] block
if ( $t->query_var && !empty( $q[$t->query_var] ) ) {
$tax_query_defaults = array(
\'taxonomy\' => $taxonomy,
\'field\' => \'slug\',
);
if ( isset( $t->rewrite[\'hierarchical\'] ) && $t->rewrite[\'hierarchical\'] ) {
$q[$t->query_var] = wp_basename( $q[$t->query_var] );
}
$term = $q[$t->query_var];
if ( strpos($term, \'+\') !== false ) {
$terms = preg_split( \'/[+]+/\', $term );
foreach ( $terms as $term ) {
$tax_query[] = array_merge( $tax_query_defaults, array(
\'terms\' => array( $term )
) );
}
} else {
$tax_query[] = array_merge( $tax_query_defaults, array(
\'terms\' => preg_split( \'/[,]+/\', $term )
) );
}
}
}
当我将其发布到searchresults时,该错误不会出现。php或当我使用单一值或无分类名称时;<select name="books">
<select name="NoneTaxonomyName[]" multiple>
有人知道如何解决这个问题吗?