芝麻web文件管理V1.00
';
$result_escaped = apply_filters( 'sway_get_search_form', $form );
if ( null === $result_escaped ) {
$result_escaped = $form;
}
// The $result_escaped variable has been safely escaped
if ( $echo ) {
echo "" . $result_escaped;
} else {
return $result_escaped;
}
}
}
/**
* Allowed HTML tags
*/
if ( ! function_exists( 'sway_allowed_html_tags' ) ) {
function sway_allowed_html_tags() {
$allowed_tags = array(
'a' => array(
'class' => array(),
'href' => array(),
'rel' => array(),
'title' => array(),
'target' => array(),
),
'b' => array(),
'br' => array(),
'div' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'em' => array(),
'h1' => array(),
'h2' => array(),
'h3' => array(),
'h4' => array(),
'h5' => array(),
'h6' => array(),
'i' => array(),
'img' => array(
'alt' => array(),
'class' => array(),
'height' => array(),
'src' => array(),
'width' => array(),
),
'p' => array(
'class' => array(),
),
'span' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'strong' => array(),
);
return $allowed_tags;
}
}
/**
* Remove parantheses with Blog Categories widget
*/
if ( ! function_exists( 'sway_postcount_filter' ) ) {
function sway_postcount_filter($variable) {
$variable = str_replace('(', '
', $variable);
$variable = str_replace(')', ' ', $variable);
return $variable;
}
}
add_filter('wp_list_categories','sway_postcount_filter');
/**
* Output social icons in topbar and footer areas
*/
if ( ! function_exists( 'sway_social_icons' ) ) {
function sway_social_icons( $echo = true ) {
$social_items = sway_get_option( 'tek-social-profiles' );
$output = $output_escaped = '';
if ( class_exists( 'ReduxFramework' ) ) {
$output = '
';
$output_escaped = $output;
}
// The $output_escaped variable has been safely escaped
if ( $echo ) {
echo "" . $output_escaped;
} else {
return $output_escaped;
}
}
}
if ( ! function_exists( 'sway_main_header_content' ) ) {
function sway_main_header_content() {
get_template_part( 'core/templates/header/content', 'header' );
}
}
add_action( 'sway_main_header', 'sway_main_header_content' );
if ( ! function_exists( 'sway_wrapper_classes' ) ) {
function sway_wrapper_classes( $classes ) {
$classes[] = '';
$page_showhide_title_section = get_post_meta( get_the_ID(), 'keydesign_page_showhide_title_section', true );
$page_hide_header = get_post_meta( get_the_ID(), 'keydesign_hide_header', true );
if ( $page_showhide_title_section && ! is_search() ) {
$classes[] = 'hide-title-section';
}
if ( $page_hide_header ) {
$classes[] = 'hide-header-bar';
}
if ( sway_get_option( 'tek-disable-animations' ) == true ) {
$classes[] = 'no-mobile-animation';
}
if ( '' != sway_get_option( 'tek-btn-effect' ) ) {
$classes[] = sway_get_option( 'tek-btn-effect' );
}
if ( sway_get_option( 'tek-single-post-template' ) && is_singular('post')) {
$classes[] = sway_get_option( 'tek-single-post-template' );
}
return $classes;
}
}
add_filter( 'sway_wrapper_class', 'sway_wrapper_classes' );
if ( ! function_exists( 'sway_navbar_classes' ) ) {
function sway_navbar_classes( $classes ) {
$classes[] = 'navbar';
$classes[] = 'navbar-default';
$classes[] = 'navbar-fixed-top';
if ( '' != sway_get_option( 'tek-btn-effect' ) ) {
$classes[] = sway_get_option( 'tek-btn-effect' );
}
if ( sway_get_option( 'tek-menu-style' ) == '2') {
$classes[] = 'full-width';
}
if ( sway_get_option( 'tek-menu-behaviour' ) == '2') {
$classes[] = 'fixed-menu';
}
if ( '' != sway_get_option( 'tek-logo-alignment' ) ) {
$classes[] = sway_get_option( 'tek-logo-alignment' );
}
if ( sway_get_option( 'tek-topbar' ) == '1') {
$classes[] = 'with-topbar';
}
if ( sway_get_option( 'tek-topbar' ) == '1' && sway_get_option( 'tek-topbar-mobile' ) == '1') {
$classes[] = 'with-topbar-mobile';
}
if ( sway_get_option( 'tek-topbar-sticky' ) == '1') {
$classes[] = 'with-topbar-sticky';
}
if ( sway_get_option( 'tek-sticky-nav-logo' ) == 'nav-secondary-logo') {
$classes[] = 'nav-secondary-logo';
}
if ( sway_get_option( 'tek-transparent-nav-logo' ) == 'nav-secondary-logo' ) {
$classes[] = 'nav-transparent-secondary-logo';
}
return $classes;
}
}
add_filter( 'sway_navbar_class', 'sway_navbar_classes' );
if ( ! function_exists( 'sway_main_menu_classes' ) ) {
function sway_main_menu_classes( $classes ) {
$classes[] = 'collapse';
$classes[] = 'navbar-collapse';
if ( '' != sway_get_option( 'tek-dropdown-nav-hover' ) ) {
$classes[] = sway_get_option( 'tek-dropdown-nav-hover' );
} else {
$classes[] = 'default-dropdown-effect';
}
if ( sway_get_option( 'tek-menu-transparency-hover' ) == false ) {
$classes[] = 'disable-menu-opacity-effect';
}
return $classes;
}
}
add_filter( 'sway_main_menu_class', 'sway_main_menu_classes' );
if ( ! function_exists( 'sway_page_header_content' ) ) {
function sway_page_header_content() {
get_template_part( 'core/templates/header/content', 'page-header' );
}
}
add_action( 'sway_page_header', 'sway_page_header_content' );
if ( ! function_exists( 'sway_wishlist_header_icon' ) ) {
function sway_wishlist_header_icon() {
if ( ! class_exists( 'YITH_WCWL' ) || ! class_exists( 'WooCommerce' ) || sway_get_option( 'tek-woo-display-wishlist-icon' ) == false ) {
return;
}
$wrapper_class = '';
$wishlist_url = YITH_WCWL()->get_wishlist_url();
$wishlist_count = yith_wcwl_count_products();
$count = ( $wishlist_count > 0 ) ? $wishlist_count : '';
?>
' !== $args->link_after ) {
$args->link_after = '';
}
if ( 0 === $depth && isset( $item->description ) && $item->description ) {
// The extra
element is here for styling purposes: Allows the description to not be underlined on hover.
$args->link_after = '';
}
return $args;
}
}
add_filter( 'nav_menu_item_args', 'sway_add_menu_description_args', 10, 3 );