class can be filtered now. * * @since 1.0.0 * * @param void * @return bool True if image exists and was not removed, false otherwise. */ function calibration_has_header_image() { if ( ! has_header_image() ) : return false; endif; return (bool) apply_filters( 'calibration_has_header_image', true ); } endif; if ( ! function_exists( 'calibration_content_format_gallery' ) ) : /** * Extract first gallery shortcode from the content to use it in the template * * @since 1.0.0 * * @param string $more_link_text Optional. Content for when there is more text. * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. * @return array Raw content of the post and the first gallery shortcode found in the content */ function calibration_content_format_gallery( $more_link_text = null, $strip_teaser = false ) { $content = get_the_content( $more_link_text, $strip_teaser ); $content_gallery = array( 'content' => str_replace( ']]>', ']]>', $content ), 'gallery' => '' ); preg_match_all( '/'. get_shortcode_regex() .'/s', $content, $matches, PREG_SET_ORDER ); if ( ! empty( $matches ) ) : foreach ( $matches as $shortcode ) : if ( 'gallery' === $shortcode[2] ) : $content_gallery['gallery'] = $shortcode[0]; // Store content without the extracted shortcode $pos = strpos( $content, $shortcode[0] ); if ( false !== $pos ) : $content_gallery['content'] = substr_replace( $content, '', $pos, strlen( $shortcode[0] ) ); break; endif; endif; endforeach; endif; return $content_gallery; } endif; if ( ! function_exists( 'calibration_the_author' ) ) : /** * Display the post author * * @since 1.0.0 * * @return void */ function calibration_the_author() { $output = "
\n"; $output .= sprintf( "%1s\n%2s\n%3s\n

%4s

\n%6s\n", esc_html__( 'Author:', 'calibration' ), get_avatar( get_the_author_meta( 'ID' ) ), esc_html( get_the_author() ), get_the_author_meta( 'description' ), get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_html__( 'View posts', 'calibration' ) ); if ( get_the_author_meta( 'url' ) ) $output .= sprintf( "%2s\n", get_the_author_meta( 'url' ), esc_html__( 'Visit website', 'calibration' ) ); $output .= "
\n"; /** * Filters the post author HTML * * @since 1.0.0 * * @param string $output Author info code. */ $output = apply_filters( 'calibration_the_author_html', $output ); echo $output; } endif; if ( ! function_exists( 'calibration_entry_date' ) ) : /** * Display entry date wrapped in