%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', 'aytias' ), '' . $time_string . '' ); echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'aytias_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function aytias_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'aytias' ), '' . esc_html( get_the_author() ) . '' ); echo ' ' . $byline . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'aytias_get_single_post_metas' ) ) : /** * Get allowed single post meta based on post meta/customizer */ function aytias_get_single_post_metas($post_id) { // Check if the metas are overridden in post meta $override_post_metas = get_post_meta($post_id, 'aytias_override_post_metas', true ); if($override_post_metas){ $enabled_post_meta = get_post_meta($post_id, 'aytias_single_post_metas', true ); }else{ $enabled_post_meta = aytias_get_option('single_post_meta'); } // Return an empty array if all options are unchecked if($enabled_post_meta){ return $enabled_post_meta; }else{ return array(); } } endif; if ( ! function_exists( 'aytias_show_author_info' ) ) : /** * Get if author info is enabled based on post meta/customizer */ function aytias_show_author_info($post_id) { $show_author_info = get_post_meta($post_id, 'aytias_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 = aytias_get_option('show_author_info'); } return $show_author_info; } endif; if ( ! function_exists( 'aytias_show_related_posts' ) ) : /** * Get if related posts are enabled based on post meta/customizer */ function aytias_show_related_posts($post_id) { $show_related_posts = get_post_meta($post_id, 'aytias_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 = aytias_get_option('show_related_posts'); } return $show_related_posts; } endif; if ( ! function_exists( 'aytias_show_author_posts' ) ) : /** * Get if author posts are enabled based on post meta/customizer */ function aytias_show_author_posts($post_id) { $show_author_posts = get_post_meta($post_id, 'aytias_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 = aytias_get_option('show_author_posts'); } return $show_author_posts; } endif; if ( ! function_exists( 'aytias_post_meta_info' ) ) : /** * Display post meta info. * * @param boolean $author Show author * @param boolean $comment Show read time * @param boolean $date Show date * * @since 1.0.0 */ function aytias_post_meta_info( $enabled_post_meta = array() ) { ?> ' ); } } edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'aytias' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), ''.aytias_get_theme_svg( 'edit' ), '' ); } endif; if ( ! function_exists( 'aytias_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. */ function aytias_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>
theme_location && ( isset( $args->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 = '.aytias-modal-menu .menu-item-' . $item->ID . ' > .sub-menu'; // Add the sub menu toggle. $args->after .= ''; } // Close the wrapper. $args->after .= '
'; // Add sub menu icons to the primary menu without toggles. } elseif ( 'primary-menu' === $args->theme_location ) { if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { $args->link_after = ''.aytias_get_theme_svg( 'chevron-down' ).''; } else { $args->link_after = ''; } } return $args; } add_filter( 'nav_menu_item_args', 'aytias_add_sub_toggles_to_main_menu', 10, 3 ); /** * Displays SVG icons in social links menu. * * @since Aytias 1.0 * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string The menu item output with social icon. */ function aytias_nav_menu_social_icons( $item_output, $item, $depth, $args ) { // Change SVG icon inside social links menu if there is supported URL. if ( 'social-menu' === $args->theme_location ) { $svg = Aytias_SVG_Icons::get_social_link_svg( $item->url ); if ( empty( $svg ) ) { $svg = aytias_get_theme_svg( 'link' ); } $item_output = str_replace( $args->link_after, '' . $svg, $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'aytias_nav_menu_social_icons', 10, 4 ); /** * Checks if the specified comment is written by the author of the post commented on. * * @since Aytias 1.0 * * @param object $comment Comment data. * @return bool */ function aytias_is_comment_by_post_author( $comment = null ) { if ( is_object( $comment ) && $comment->user_id > 0 ) { $user = get_userdata( $comment->user_id ); $post = get_post( $comment->comment_post_ID ); if ( ! empty( $user ) && ! empty( $post ) ) { return $comment->user_id === $post->post_author; } } return false; }