< class="fp-title"> > Start'; } ); * * @param none */ do_action( 'flex_posts_meta_start' ); if ( ! empty( $instance['show_author'] ) || ! empty( $instance['show_avatar'] ) ) { flex_posts_author_meta( $instance ); } if ( ! empty( $instance['show_date'] ) ) { flex_posts_date_meta(); } if ( ! empty( $instance['show_comments'] ) ) { flex_posts_comments_meta(); } /** * Action: flex_posts_meta_end * * Fired at the end of meta output for a post inside the widget/block. * Useful for adding extra meta content. * * @param none */ do_action( 'flex_posts_meta_end' ); } } if ( ! function_exists( 'flex_posts_author_meta' ) ) { /** * Display author meta. * * @param array $instance Widget settings. */ function flex_posts_author_meta( $instance = array() ) { $author_id = get_the_author_meta( 'ID' ); $author_url = get_author_posts_url( $author_id ); $author_title = sprintf( /* translators: %s: Author's display name. */ __( 'Posts by %s', 'flex-posts' ), get_the_author() ); /** * Filter: flex_posts_author_image_size * * Filter the size (in pixels) used for author avatars in meta output. * * @param int $size Default avatar size in pixels. * @return int Modified avatar size. * * Example: * add_filter( 'flex_posts_author_image_size', function( $size ) { return 32; } ); */ $image_size = apply_filters( 'flex_posts_author_image_size', 24 ); ?> '; foreach ( $categories as $category ) { if ( 0 < $i ) { echo ', '; } $color = get_term_meta( $category->term_id, 'fp_color', true ); $style = $color ? "--fp-color: $color" : ''; echo '' . esc_html( $category->name ) . ''; ++$i; } echo ''; } } } if ( ! function_exists( 'flex_posts_thumbnail' ) ) { /** * Display post thumbnail. * * @param string $size Image size. * @param array $instance Widget settings. * @param int $current_post Post index number. */ function flex_posts_thumbnail( $size, $instance = array(), $current_post = 0 ) { if ( isset( $instance['show_image'] ) ) { if ( 'none' === $instance['show_image'] ) { return; } if ( 'first' === $instance['show_image'] && $current_post > 0 ) { return; } } /** * Filter: flex_posts_default_image * * Filter the default image URL used when a post has no featured image. * * @param string $url Default image URL. * @return string Modified image URL. * * Example: * add_filter( 'flex_posts_default_image', function( $url ) { return get_stylesheet_directory_uri() . '/img/default.png'; } ); */ $default_image = apply_filters( 'flex_posts_default_image', FLEX_POSTS_URL . 'public/images/default.png' ); ?>
New'; } ); */ do_action( 'flex_posts_media', $instance ); ?>