',
'condition' => ( is_front_page() || is_home() ),
);
$args = wp_parse_args( $args, $defaults );
/**
* Filters the arguments for `aino_site_logo()`.
*
* @param array $args Parsed arguments.
* @param array $defaults Function's default arguments.
*/
$args = apply_filters( 'aino_site_logo_args', $args, $defaults );
if ( has_custom_logo() ) {
$contents = sprintf( $args['logo'], $logo, esc_html( $site_title ) );
$classname = $args['logo_class'];
} else {
$contents = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) );
$classname = $args['title_class'];
}
$wrap = $args['condition'] ? 'home_wrap' : 'single_wrap';
$html = sprintf( $args[ $wrap ], $classname, $contents );
/**
* Filters the arguments for `aino_site_logo()`.
*
* @param string $html Compiled html based on our arguments.
* @param array $args Parsed arguments.
* @param string $classname Class name based on current view, home or single.
* @param string $contents HTML for site title or logo.
*/
$html = apply_filters( 'aino_site_logo', $html, $args, $classname, $contents );
if ( ! $echo ) {
return $html;
}
echo $html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Displays the site description.
*
* @param boolean $echo Echo or return the html.
*
* @return string $html The HTML to display.
*/
function aino_site_description( $echo = true ) {
$description = get_bloginfo( 'description' );
if ( ! $description ) {
return;
}
$wrapper = '
%s
';
$html = sprintf( $wrapper, esc_html( $description ) );
/**
* Filters the html for the site description.
*
* @since 1.0.0
*
* @param string $html The HTML to display.
* @param string $description Site description via `bloginfo()`.
* @param string $wrapper The format used in case you want to reuse it in a `sprintf()`.
*/
$html = apply_filters( 'aino_site_description', $html, $description, $wrapper );
if ( ! $echo ) {
return $html;
}
echo $html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Post Meta
*/
if ( ! function_exists( 'aino_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function aino_posted_on() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$byline = sprintf(
'%1$s %3$s',
esc_html_x( 'Author', 'Used before post author name.', 'aino' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
$posted_on = '' . $time_string . '';
if ( get_avatar( get_the_author_meta( 'ID' ) ) ) :
echo '' . get_avatar( get_the_author_meta( 'ID' ), 80 ) . '';
endif;
echo ' ' . wp_kses_post( $byline ) . '' . $posted_on . '';
}
endif;
if ( ! function_exists( 'aino_entry_date_blog' ) ) :
/**
* Prints HTML with information for the current post-date/time and number of comments.
*/
function aino_entry_date_blog() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
echo '' . $time_string . '';
}
endif;
if ( ! function_exists( 'aino_entry_meta' ) ) :
/**
* Prints HTML with meta information for the categories and tags.
*/
function aino_entry_meta() {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'aino' ) );
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
if ( $categories_list && ! is_single() ) {
printf(
'' . ( '%1$s' ) . '',
wp_kses_post( $categories_list )
);
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', ( ' ' ) );
if ( $tags_list && is_single() ) {
printf(
'' . ( '%1$s' ) . '',
wp_kses_post( $tags_list )
);
}
}
}
endif;
if ( ! function_exists( 'aino_edit_link' ) ) :
/**
* Returns an accessibility-friendly link to edit a post or page.
*/
function aino_edit_link() {
$editlink = sprintf(
esc_html__( 'Edit Post', 'aino' ) . '' . aino_get_svg( array( 'icon' => 'baseline-edit-24px' ) ) . '' . get_the_title() . ''
);
// Edit post link.
edit_post_link(
$editlink
);
}
endif;
/**
* Comments
*/
/**
* Custom Aino Comment structure.
*
* @param mixed $comment Custom comment parameter.
* @param mixed $args Comment arguments.
* @param mixed $depth Depth of the comment.
*
* @return void
*/
function aino_comment( $comment, $args, $depth ) {
global $post;
// Checks if we are using a div or ol|ul for our output.
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
?>
< id="comment-" >
%s %2$s',
get_comment_author_link( $comment ),
// If current post author is also comment author, make it known visually.
( $comment->user_id === $post->post_author ) ? '' . esc_html__( 'Author', 'aino' ) . '' : ''
);
?>