%2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( /* translators: %s: post date. */ esc_html_x( 'Posted on %s', 'post date', 'blogmarks' ), '' . $time_string . '' ); echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'blogmarks_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blogmarks_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blogmarks' ), '' ); echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'blogmarks_get_single_post_metas' ) ) : /** * Get allowed single post meta based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_get_single_post_metas( $post_id ) { // Check if the metas are overridden in post meta. $override_post_metas = get_post_meta( $post_id, 'blogmarks_override_post_metas', true ); if ( $override_post_metas ) { $enabled_post_meta = get_post_meta( $post_id, 'blogmarks_single_post_metas', true ); } else { $enabled_post_meta = blogmarks_get_option( 'single_post_meta', array( 'author', 'date', 'comment', 'category', 'tags' ) ); } // Return an empty array if all options are unchecked. if ( $enabled_post_meta ) { return $enabled_post_meta; } else { return array(); } } endif; if ( ! function_exists( 'blogmarks_show_single_post_meta_icons' ) ) : /** * Get if post meta icons is enabled based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_show_single_post_meta_icons( $post_id ) { $show_single_post_meta_icons = get_post_meta( $post_id, 'blogmarks_show_post_meta_icons', true ); if ( '0' == $show_single_post_meta_icons ) { $show_single_post_meta_icons = false; } elseif ( '1' == $show_single_post_meta_icons ) { $show_single_post_meta_icons = true; } else { $show_single_post_meta_icons = blogmarks_get_option( 'show_single_post_meta_icon', true ); } return $show_single_post_meta_icons; } endif; if ( ! function_exists( 'blogmarks_show_author_info' ) ) : /** * Get if author info is enabled based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_show_author_info( $post_id ) { $show_author_info = get_post_meta( $post_id, 'blogmarks_show_author_info', true ); if ( '0' == $show_author_info ) { $show_author_info = false; } elseif ( '1' == $show_author_info ) { $show_author_info = true; } else { $show_author_info = blogmarks_get_option( 'show_author_info' ); } return $show_author_info; } endif; if ( ! function_exists( 'blogmarks_show_related_posts' ) ) : /** * Get if related posts are enabled based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_show_related_posts( $post_id ) { $show_related_posts = get_post_meta( $post_id, 'blogmarks_show_related_posts', true ); if ( '0' == $show_related_posts ) { $show_related_posts = false; } elseif ( '1' == $show_related_posts ) { $show_related_posts = true; } else { $show_related_posts = blogmarks_get_option( 'show_related_posts' ); } return $show_related_posts; } endif; if ( ! function_exists( 'blogmarks_show_sticky_article_navigation' ) ) : /** * Get if related posts are enabled based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_show_sticky_article_navigation( $post_id ) { $show_sticky_article_nav = get_post_meta( $post_id, 'blogmarks_show_sticky_article_navigation', true ); if ( '0' == $show_sticky_article_nav ) { $show_sticky_article_nav = false; } elseif ( '1' == $show_sticky_article_nav ) { $show_sticky_article_nav = true; } else { $show_sticky_article_nav = blogmarks_get_option( 'sticky_article_navigation' ); } return $show_sticky_article_nav; } endif; if ( ! function_exists( 'blogmarks_show_author_posts' ) ) : /** * Get if author posts are enabled based on post meta/customizer * * @param int $post_id Post ID. */ function blogmarks_show_author_posts( $post_id ) { $show_author_posts = get_post_meta( $post_id, 'blogmarks_show_author_posts', true ); if ( '0' == $show_author_posts ) { $show_author_posts = false; } elseif ( '1' == $show_author_posts ) { $show_author_posts = true; } else { $show_author_posts = blogmarks_get_option( 'show_author_posts' ); } return $show_author_posts; } endif; if ( ! function_exists( 'blogmarks_post_meta_info' ) ) : /** * Display post meta info. * * @param array $enabled_post_meta Enabled Post Meta. * @param string $settings Additinal Settings * * @since 1.0.0 */ function blogmarks_post_meta_info( $enabled_post_meta = array(), $settings = array() ) { if ( $enabled_post_meta && ! empty( $enabled_post_meta ) ) : // Filter out valid metas. $valid_post_metas = array( 'author', 'read_time', 'date', 'comment' ); $enabled_post_meta = array_intersect( $enabled_post_meta, $valid_post_metas ); $enabled_post_meta = array_values( $enabled_post_meta ); if ( ! empty( $enabled_post_meta ) ) : $wrapper_class = ''; if ( empty( $settings ) || ! is_array( $settings ) ) { $settings = array( 'date_format' => 'format_2', 'author_image' => false, 'show_icons' => true, ); } else { if ( ! isset( $settings['date_format'] ) ) { $settings['date_format'] = 'format_2'; } if ( ! isset( $settings['author_image'] ) ) { $settings['author_image'] = false; } if ( ! isset( $settings['show_icons'] ) ) { $settings['show_icons'] = true; } } ?>
$limit ) { $categories = array_slice( $categories, 0, $limit ); } } if ( null == $display_style ) { $display_style = 'style_1'; } if ( null == $show_color ) { $show_color = 'none'; } $wrapper_class = $display_style . ' cat-color-' . $show_color; ?>