comment_type ) {
case 'pingback':
case 'trackback':
// Display trackbacks differently than normal comments.
?>
id="comment-">
', '' ); ?>
id="li-comment-">
post_title ) ) {
/** @psalm-suppress PossiblyInvalidPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$output = str_replace( 'href="', 'title="' . esc_attr( $post->post_title ) . '" ' . 'href="', $output );
}
return $output;
}
/**
* Get Post Navigation
*/
if ( ! function_exists( 'astra_single_post_navigation_markup' ) ) {
/**
* Get Post Navigation
*
* Checks post navigation, if exists return as button.
*
* @return mixed Post Navigation Buttons
*/
function astra_single_post_navigation_markup() {
$single_post_navigation_enabled = apply_filters( 'astra_single_post_navigation_enabled', true );
if ( is_single() && $single_post_navigation_enabled ) {
$post_obj = get_post_type_object( get_post_type() );
/** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$post_singular_name = ! empty( $post_obj->labels->singular_name ) ? $post_obj->labels->singular_name : '';
/** @psalm-suppress PossiblyNullPropertyFetch */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$prev_text = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' . Astra_Builder_UI_Controller::fetch_svg_icon( 'long-arrow-alt-left' ) . ' ' . astra_default_strings( 'string-previous-text', false ) . ' %title
' : sprintf(
astra_default_strings( 'string-single-navigation-previous', false ),
$post_singular_name
);
$next_text = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? '' . astra_default_strings( 'string-next-text', false ) . ' ' . Astra_Builder_UI_Controller::fetch_svg_icon( 'long-arrow-alt-right' ) . ' %title
' : sprintf(
astra_default_strings( 'string-single-navigation-next', false ),
$post_singular_name
);
add_filter( 'previous_post_link', 'astra_adjacent_post_links_title', 10, 5 );
add_filter( 'next_post_link', 'astra_adjacent_post_links_title', 10, 5 );
/**
* Filter the post pagination markup
*/
the_post_navigation(
apply_filters(
'astra_single_post_navigation',
array(
'next_text' => $next_text,
'prev_text' => $prev_text,
'screen_reader_text' => __( 'Post navigation', 'astra' ),
)
)
);
remove_filter( 'previous_post_link', 'astra_adjacent_post_links_title', 10 );
remove_filter( 'next_post_link', 'astra_adjacent_post_links_title', 10 );
}
}
}
add_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );