芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/ebpt.pulsehost.co.uk/wp-content/plugins/lte-ext/inc/shortcodes.php
'black'], $atts ); $body_color_ = lte_get_option( 'body-bg' ); $body_color_page = lte_get_meta( 'body-bg', $wp_query->get_queried_object_id() ); if ( !empty($body_color_page) AND $body_color_page != 'default' ) { $body_color = $body_color_page; } if ( (!empty($body_color) AND $body_color == 'main') OR $atts['color'] == 'white' ) { return tofit_get_the_logo('white'); } else { return tofit_get_the_logo('black'); } } } add_shortcode( 'lte-logo', 'lte_sc_logo' ); /** * Shortcode to display navbar icons */ function lte_navbar_icons_sc( $atts ) { return tofit_get_the_navbar_icons(); } add_shortcode( 'lte-navbar-icons', 'lte_navbar_icons_sc' ); /** * Page header social icons */ function lte_nav_social_shortcode( $atts ) { $atts = shortcode_atts( array( 'color' => 'second', 'type' => '', 'text' => '', 'text-before' => '', ), $atts, 'tofit-social' ); if ( function_exists( 'LTE' ) ) { $tofit_social_icons = lte_get_option( 'social-icons' ); $tofit_social_target = lte_get_option( 'target-social' ); if ( $tofit_social_target == 'self') { $target = "_self"; } else { $target = "_blank"; } $html = ''; if ( !empty($tofit_social_icons) ) { $html .= '
'; if ( !empty($atts['text-before']) ) { $html .= '
'.esc_html($atts['text-before']).'
'; } $html .= '
'; foreach ($tofit_social_icons as $item ) { if ( !empty($atts['type']) AND $atts['type'] == 'titles') { $html .= '
'. esc_html( $item['text'] ) .'
'; } else if ( !empty($item['icon_v2']['icon-class']) ) { $html .= '
'; } else if ( !empty($item['icon_v2']['url']) ){ $html .= '
'; } } $html .= '
'; if ( !empty($atts['text']) ) { $html .= '
'.esc_html($atts['text']).'
'; } $html .= '
'; } return $html; } } add_shortcode( 'lte-social', 'lte_nav_social_shortcode' ); add_shortcode( 'lte-navbar-icons', 'tofit_get_the_navbar_icons' ); /** * Sharing buttons */ if ( !function_exists( 'lte_share_buttons_conf' ) ) { function lte_share_buttons_conf() { $links = array( 'facebook' => array( 'header' => 'Facebook', 'link' => 'http://www.facebook.com/sharer.php?u={link}', 'icon' => 'fa-facebook-f', 'active' => 1, ), 'twitter' => array( 'header' => 'Twitter', 'link' => 'https://twitter.com/intent/tweet?link={link}&text={title}', 'icon' => 'fa-twitter', 'active' => 1, ), 'gplus' => array( 'header' => 'Google+', 'link' => 'https://plus.google.com/share?url={link}', 'icon' => 'fa-google-plus', 'active' => 1, ), 'linkedin' => array( 'header' => 'Linkedin', 'link' => 'http://www.linkedin.com/shareArticle?mini=true&url={link}', 'icon' => 'fa-linkedin', 'active' => 1, ), 'email' => array( 'header' => 'E-mail', 'link' => 'mailto:?subject={title}&body={link}', 'icon' => 'fa-envelope', 'active' => 0, ), ); if ( function_exists('LTE') ) { foreach ( $links as $key => &$item ){ $state = lte_get_option( 'share_icon_' . $key ); if ( !is_null($state) ) { if ( $state === true ) { $item['active'] = 1; } else { $item['active'] = 0; } } } } return $links; } function lte_the_share_buttons( $args ) { if ( function_exists('LTE') ) { $hide = lte_get_option( 'share_icons_hide' ); $custom = lte_get_option( 'share-add' ); if ( !empty($hide) ) { return false; } } $links = lte_share_buttons_conf(); $html = ''; if ( !empty($args['header']) ) { $html .= '
' . esc_html($args['header']) .'
'; } $html .= '
'; if ( !empty($links) ) { foreach ( $links as $header => $item ) { if ( $item['active'] == 1 ) { $link = str_replace( array('{title}', '{link}'), array(get_the_title(), get_permalink()), $item['link'] ); $html .= '
'; } } } if ( !empty($custom) ) { foreach ( $custom as $item ) { $link = str_replace( array('{title}', '{link}'), array(get_the_title(), get_permalink()), $item['link'] ); $color_style = ''; if ( !empty($item['color']) ) { $color_style = ' style="background-color: '.esc_attr($item['color']).'" '; } $html .= '
'; } } $html .= '
'; return $html; } add_shortcode( 'lte-share-icons', 'lte_the_share_buttons' ); } /** * Display current team image for single page */ if ( !function_exists( 'lte_team_image' ) ) { function lte_team_image() { global $wp_query; return '
'.wp_get_attachment_image( get_post_thumbnail_id( get_the_ID() ), 'full', false ).'
'; } } add_shortcode( 'lte-team-image', 'lte_team_image' ); /** * Team Shortcodes */ if ( !function_exists( 'lte_team_header' ) ) { function lte_team_header() { global $wp_query; return '
'.get_the_title().'
'; } } add_shortcode( 'lte-team-header', 'lte_team_header' ); if ( !function_exists( 'lte_team_subheader' ) ) { function lte_team_subheader() { global $wp_query; $item_cats = wp_get_post_terms( get_the_ID(), 'team-category' ); $cats = ''; if ( !empty($item_cats) ) { foreach ($item_cats as $cat) { $cats = $cat->name; break; } } return '
'.esc_html($cats).'
'; } } add_shortcode( 'lte-team-subheader', 'lte_team_subheader' ); /** * Display header tagline */ if ( !function_exists( 'lte_header_tagline' ) ) { function lte_header_tagline( $args ) { if ( function_exists( 'LTE' ) ) { $type = ''; if ( !empty($args['type']) AND $args['type'] == 'short' ) { $tagline = lte_get_option( 'tagline-short' ); } else { $tagline = lte_get_option( 'tagline' ); } if ( !empty($tagline) ) { return '
'.esc_html($tagline).'
'; } } } } add_shortcode( 'lte-header-tagline', 'lte_header_tagline' ); /** * Display overlay */ if ( !function_exists( 'lte_overlay_lines' ) ) { function lte_overlay_lines() { return '
'; } } add_shortcode( 'lte-overlay-lines', 'lte_overlay_lines' ); /** * Display overlay */ if ( !function_exists( 'lte_overlay_border' ) ) { function lte_overlay_border() { return '
'; } } add_shortcode( 'lte-overlay-border', 'lte_overlay_border' ); if ( !function_exists( 'lte_button_sc' ) ) { function lte_button_sc( $args ) { $btn_color = ''; if ( !empty($args['color']) ) { $btn_color .= ' btn-'.$args['color']; } if ( !empty($args['hover']) ) { $btn_color .= ' color-hover-'.$args['hover']; } if ( !empty($args['size']) ) { $btn_color .= ' btn-'.$args['size']; } if ( empty($args['href']) ) { $args['href'] = '#'; } $out = '
'; $out .= '
'; $out .= '
'; $out .= esc_html( $args['header'] ); $out .= '
'; $out .= '
'; $out .= '
'; return $out; } } add_shortcode( 'lte-button', 'lte_button_sc' ); if ( !function_exists( 'lte_hover_dot_sc' ) ) { function lte_hover_dot_sc( $args ) { $out = '
'; $out .= '
'; $out .= '
'; if ( !empty($args['header']) ) $out .= '
'.esc_html($args['header']).'
'; $out .= '
'; return $out; } } add_shortcode( 'lte-hover-dot', 'lte_hover_dot_sc' ); //add_action( 'save_post_lte-schedule', 'lte_schedule_save_postdata', 10, 3 ); function lte_schedule_save_postdata( $post_id, $post, $update ) { global $wp_locale; if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( $update && 'trash' != get_post_status( $post_id ) ) { $item = lte_get_meta(); remove_action( 'save_post_lte-schedule', 'lte_schedule_save_postdata' ); /* $teams = []; $list = get_categories( [ 'taxonomy' => 'lte-football-club', 'orderby' => 'title', 'hide_empty' => 0 ] ); */ if ( !empty($list) ) { foreach ( $list as $i ) { $teams[$i->term_id] = $i->cat_name; } } $title_ = explode(' / ', get_the_title()); $title = []; $title[] = $title_[0]; $title[] = $wp_locale->get_weekday($item['weekday']); $title[] = $item['date-start'].':00 - ' . $item['date-end'].':00'; wp_update_post( array( 'ID' => $post_id, 'post_title' => esc_html(implode(' / ', $title)), // 'post_date' => esc_html(date('Y-m-d H:i', strtotime($item['booking-date']))) ) ); // add_action( 'save_post_lte-schedule', 'lte_schedule_save_postdata', 10, 3 ); } }