' . esc_html__('Tagged %1$s', 'bloglex') . '', $tags_list); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
if ((!is_single() && !post_password_required() && (comments_open() || get_comments_number())) && $show_comment) {
echo '';
comments_popup_link(
sprintf(
wp_kses(
/* translators: %s: post title */
__('Leave a Comment on %s', 'bloglex'),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post(get_the_title())
)
);
echo '';
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__('Edit %s', 'bloglex'),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post(get_the_title())
),
'',
''
);
}
endif;
if (!function_exists('bloglex_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 bloglex_post_thumbnail($image_class = null, $image_size = null)
{
if (post_password_required() || is_attachment() || !has_post_thumbnail()) {
return;
}
if (is_singular()) :
?>
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 = bloglex_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 = '';
} else {
$args->after = '';
}
}
return $args;
}
add_filter('nav_menu_item_args', 'bloglex_add_sub_toggles_to_main_menu', 10, 2);
/**
* Displays SVG icons in social links menu.
*
* @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.
* @since Bloglex 1.0
*
*/
function bloglex_nav_menu_social_icons($item_output, $item, $depth, $args)
{
// Change SVG icon inside social links menu if there is supported URL.
if ('social' === $args->theme_location) {
$svg = Bloglex_SVG_Icons::get_social_link_svg($item->url);
if (empty($svg)) {
$svg = bloglex_get_theme_svg('link');
}
$item_output = str_replace($args->link_after, '' . $svg, $item_output);
}
return $item_output;
}
add_filter('walker_nav_menu_start_el', 'bloglex_nav_menu_social_icons', 10, 4);
/**
* Toggles animation duration in milliseconds.
*
* @return int Duration in milliseconds
* @since Bloglex 1.0
*
*/
function bloglex_toggle_duration()
{
/**
* Filters the animation duration/speed used usually for submenu toggles.
*
* @param int $duration Duration in milliseconds.
* @since Bloglex 1.0
*
*/
$duration = apply_filters('bloglex_toggle_duration', 250);
return $duration;
}