Astra_Related_Posts_Markup::astra_get_related_post_title( int $current_post_id )

Render Post Title HTML.


Description


Parameters

$current_post_id

(int) (Required) current post ID.


Source

File: inc/modules/related-posts/class-astra-related-posts-markup.php

	public function astra_get_related_post_title( $current_post_id ) {
		$related_post_structure = astra_get_option_meta( 'related-posts-structure' );

		if ( ! in_array( 'title-meta', $related_post_structure ) ) {
			return;
		}

		$target    = apply_filters( 'astra_related_post_title_opening_target', '_self' );
		$title_tag = apply_filters( 'astra_related_post_title_tag', 'h3' );

		do_action( 'astra_related_post_before_title', $current_post_id );
		?>
			<<?php echo esc_html( $title_tag ); ?> class="ast-related-post-title entry-title">
				<a href="<?php echo esc_url( apply_filters( 'astra_related_post_link', get_the_permalink(), $current_post_id ) ); ?>" target="<?php echo esc_html( $target ); ?>" rel="bookmark noopener noreferrer"><?php the_title(); ?></a>
			</<?php echo esc_html( $title_tag ); ?>>
		<?php
		do_action( 'astra_related_post_after_title', $current_post_id );
	}

Changelog

Changelog
Version Description
3.5.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.