astra_single_get_post_meta( boolean $echo = true )
Prints HTML with meta information for the current post-date/time and author.
Description
Parameters
- $echo
-
(boolean) (Optional) Output print or return.
Default value: true
Return
(string|void)
Source
File: inc/blog/single-blog.php
function astra_single_get_post_meta( $echo = true ) {
$enable_meta = apply_filters( 'astra_single_post_meta_enabled', '__return_true' );
$post_meta = astra_get_option( 'blog-single-meta' );
$current_post_type = get_post_type();
$post_type_array = apply_filters( 'astra_single_post_type_meta', array( 'post' ) );
$output = '';
if ( is_array( $post_meta ) && ( in_array( $current_post_type, $post_type_array ) || 'attachment' == $current_post_type ) && $enable_meta ) {
$output_str = astra_get_post_meta( $post_meta );
if ( ! empty( $output_str ) ) {
$output = apply_filters( 'astra_single_post_meta', '<div class="entry-meta">' . $output_str . '</div>', $output_str ); // WPCS: XSS OK.
}
}
if ( $echo ) {
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $output;
}
}
Expand full source code Collapse full source code View on Trac