term_id ] ) ) { return $terms[ $term->term_id ]; } $title = ''; $metaData = aioseo()->meta->metaData->getMetaData( $term ); if ( ! empty( $metaData->title ) && ! $default ) { $title = $metaData->title; // Since we might be faking the term, let's replace the title ourselves. $title = aioseo()->helpers->pregReplace( '/#taxonomy_title/', $term->name, $title ); $title = $this->helpers->prepare( $title, $term->term_id ); } $dynamicOptions = aioseo()->dynamicOptions->noConflict(); if ( ! $title && $dynamicOptions->searchAppearance->taxonomies->has( $term->taxonomy ) ) { $newTitle = aioseo()->dynamicOptions->searchAppearance->taxonomies->{$term->taxonomy}->title; $newTitle = preg_replace( '/#taxonomy_title/', $term->name, (string) $newTitle ); $title = $this->helpers->prepare( $newTitle, $term->term_id, $default ); } if ( empty( $title ) ) { // Just return the WP default. $title = $term->name . ' - ' . get_bloginfo( 'name' ); } $terms[ $term->term_id ] = $title; return $terms[ $term->term_id ]; } /** * Retrieve the default title for the taxonomy. * * @since 4.0.17 * * @param string $taxonomy The taxonomy name. * @return string The title. */ public function getTaxonomyTitle( $taxonomy ) { $dynamicOptions = aioseo()->dynamicOptions->noConflict(); return $dynamicOptions->searchAppearance->taxonomies->has( $taxonomy, false ) ? $dynamicOptions->{$taxonomy}->title : ''; } }