'%1$s%2$s', 'logo_class' => 'site-logo', 'title' => '%2$s', 'title_class' => 'site-title', 'home_wrap' => '

%2$s

', 'single_wrap' => '
%2$s
', '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() ) ); $posted_on = '' . $time_string . ''; echo '' . $posted_on . ''; } endif; if ( ! function_exists( 'aino_author' ) ) : /** * Prints HTML with meta information for the post author. */ function aino_author() { $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() ) ); if ( get_avatar( get_the_author_meta( 'ID' ) ) ) : echo ''; endif; echo ' ' . wp_kses_post( $byline ) . ''; } 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' ) . '' . 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-" >
'; echo get_avatar( $comment, $args['avatar_size'] ); echo ''; } ?> %s', get_comment_author_link( $comment ), ); ?>
comment_approved ) : ?>

show_toggles ) && $args->show_toggles ) { // Wrap the menu item link contents in a div, used for positioning. $args->before = '
'; $args->after = ''; // Add a toggle to items with children. if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { $toggle_target_string = '.menu-modal .menu-item-' . $item->ID . ' > .sub-menu'; $toggle_duration = aino_toggle_duration(); // Add the sub menu toggle. $args->after .= ''; } // Close the wrapper. $args->after .= '
'; // Add sub menu icons to the primary menu without toggles. } elseif ( 'primary' === $args->theme_location ) { if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { $args->after = '' . aino_get_svg( array( 'icon' => 'dropdown' ) ) . ''; } else { $args->after = ''; } } return $args; } add_filter( 'nav_menu_item_args', 'aino_add_sub_toggles_to_main_menu', 10, 3 ); /** * Classes */ /** * Add No-JS Class. * If we're missing JavaScript support, the HTML element will have a no-js class. */ function aino_no_js_class() { ?> tag. 2: Estimated reading time text, in minutes. */ $read_time_text = sprintf( _nx( '%s min read', '%s min read', $minutes, 'Time to read', 'aino' ), $minutes ); printf( '%2$s', esc_html( $datetime_attr ), esc_html( $read_time_text ) ); } endif; /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function aino_pingback_header() { if ( is_singular() && pings_open() ) { echo ' '; } } add_action( 'wp_head', 'aino_pingback_header' );