] ) ) {
if ( 'term_taxonomy_id' !== $query['field'] ) {
$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
return;
}
// So long as there are shared terms, 'include_children' requires that a taxonomy is set.
$query['include_children'] = false;
} elseif ( ! taxonomy_exists( $query['taxonomy'] ) ) {
$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
return;
}
if ( 'slug' === $query['field'] || 'name' === $query['field'] ) {
$query['terms'] = array_unique( (array) $query['terms'] );
} else {
$query['terms'] = wp_parse_id_list( $query['terms'] );
}
if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {
$this->transform_query( $query, 'term_id' );
if ( is_wp_error( $query ) ) {
return;
}
$children = array();
foreach ( $query['terms'] as $term ) {
$children = array_merge( $children, get_term_children( $term, $query['taxonomy'] ) );
$children[] = $term;
}
$query['terms'] = $children;
}
$this->transform_query( $query, 'term_taxonomy_id' );
}
/**
* Transforms a single query, from one field to another.
*
* Operates on the `$query` object by reference. In the case of error,
* `$query` is converted to a WP_Error object.
*
* @since 3.2.0
*
* @param array $query The single query. Passed by reference.
* @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id',
* or 'term_id'. Default 'term_id'.
*/
public function transform_query( &$query, $resulting_field ) {
if ( empty( $query['terms'] ) ) {
return;
}
if ( $query['field'] === $resulting_field ) {
return;
}
$resulting_field = sanitize_key( $resulting_field );
// Empty 'terms' always results in a null transformation.
$terms = array_filter( $query['terms'] );
if ( empty( $terms ) ) {
$query['terms'] = array();
$query['field'] = $resulting_field;
return;
}
$args = array(
'get' => 'all',
'number' => 0,
'taxonomy' => $query['taxonomy'],
'update_term_meta_cache' => false,
'orderby' => 'none',
);
// Term query parameter name depends on the 'field' being searched on.
switch ( $query['field'] ) {
case 'slug':
$args['slug'] = $terms;
break;
case 'name':
$args['name'] = $terms;
break;
case 'term_taxonomy_id':
$args['term_taxonomy_id'] = $terms;
break;
default:
$args['include'] = wp_parse_id_list( $terms );
break;
}
if ( ! is_taxonomy_hierarchical( $query['taxonomy'] ) ) {
$args['number'] = count( $terms );
}
$term_query = new WP_Term_Query();
$term_list = $term_query->query( $args );
if ( is_wp_error( $term_list ) ) {
$query = $term_list;
return;
}
if ( 'AND' === $query['operator'] && count( $term_list ) < count( $query['terms'] ) ) {
$query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );
return;
}
$query['terms'] = wp_list_pluck( $term_list, $resulting_field );
$query['field'] = $resulting_field;
}
}
Fatal error: require(): Failed opening required '/var/www/html/helitower.com.br/web/wp-includes/block-supports/border.php' (include_path='.:/usr/share/pear') in /var/www/html/helitower.com.br/web/wp-settings.php on line 367
Fatal error: Uncaught Error: Call to a member function set() on null in /var/www/html/helitower.com.br/web/wp-includes/l10n.php:854
Stack trace:
#0 /var/www/html/helitower.com.br/web/wp-includes/l10n.php(957): load_textdomain('default', '/var/www/html/h...', 'pt_BR')
#1 /var/www/html/helitower.com.br/web/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /var/www/html/helitower.com.br/web/wp-includes/l10n.php on line 854