term_taxonomy_id ] ) ) { continue; } $link = get_term_link( $term ); if ( ! $link || is_wp_error( $link ) ) { continue; } $seen[ $term->term_taxonomy_id ] = true; $needs[] = array( 'name' => $term->name, 'url' => (string) $link, 'taxonomy' => $taxonomy, ); } } if ( empty( $needs ) ) { return; } if ( $as_row ) { $wrapper_attrs = get_block_wrapper_attributes( array( 'class' => 'aieo-post-related-needs aieo-post-related-needs--row' ) ); $list_name = '' !== $heading ? $heading : __( 'Topics', 'ai-eshop-optimizer' ); $out = '
'; $out .= '
'; echo $out; return; } $wrapper_attrs = get_block_wrapper_attributes( array( 'class' => 'aieo-post-related-needs' ) ); ob_start(); ?>
>