transform_query example

$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( $childrenget_term_children( $term$query['taxonomy'] ) );
                $children[] = $term;
            }
            $query['terms'] = $children;
        }
Home | Imprint | This part of the site doesn't use cookies.