コード例 #1
1
ファイル: footer-functions.php プロジェクト: sergey-h/naman
 function wpex_footer_reveal_enabled($post_id = '')
 {
     // Disable on mobile
     if (wp_is_mobile()) {
         return false;
     }
     // Disable on 404
     if (is_404()) {
         return false;
     }
     // Disable on boxed style
     if ('boxed' == wpex_main_layout()) {
         return false;
     }
     // Get post id
     $post_id = $post_id ? $post_id : wpex_get_the_ID();
     // Meta check
     if ($post_id) {
         if ('on' == get_post_meta($post_id, 'wpex_footer_reveal', true)) {
             return true;
         } elseif ('off' == get_post_meta($post_id, 'wpex_footer_reveal', true)) {
             return false;
         }
     }
     // Theme option check
     if (get_theme_mod('footer_reveal', false)) {
         return true;
     }
 }
コード例 #2
1
ファイル: functions.php プロジェクト: jrialland/site-plr
function zAlive_add_mobile_device_class($classes)
{
    if (wp_is_mobile()) {
        $classes[] = 'is-mobile';
    }
    return $classes;
}
コード例 #3
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @since vantage 1.0
 */
function vantage_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    if (siteorigin_setting('layout_responsive')) {
        $classes[] = 'responsive';
    }
    $classes[] = 'layout-' . siteorigin_setting('layout_bound');
    $classes[] = 'no-js';
    $is_full_width_template = is_page_template('templates/template-full.php') || is_page_template('templates/template-full-notitle.php');
    if (!$is_full_width_template) {
        $wc_shop_sidebar = vantage_is_woocommerce_active() && is_shop() && is_active_sidebar('shop');
        if (!is_active_sidebar('sidebar-1') && !$wc_shop_sidebar) {
            $classes[] = 'no-sidebar';
        } else {
            $classes[] = 'has-sidebar';
        }
    }
    if (wp_is_mobile()) {
        $classes[] = 'so-vantage-mobile-device';
    }
    $mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
    if (siteorigin_setting('navigation_menu_search') && !$mega_menu_active) {
        $classes[] = 'has-menu-search';
    }
    if (siteorigin_setting('layout_force_panels_full')) {
        $classes[] = 'panels-style-force-full';
    }
    return $classes;
}
コード例 #4
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function siteorigin_north_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    $classes[] = 'no-js';
    $classes[] = 'css3-animations';
    $classes[] = 'responsive';
    if (is_page()) {
        $classes[] = 'page-layout-' . SiteOrigin_Settings_Page_Settings::get('layout');
        $classes[] = 'page-layout-menu-' . SiteOrigin_Settings_Page_Settings::get('menu');
        if (!SiteOrigin_Settings_Page_Settings::get('masthead_margin')) {
            $classes[] = 'page-layout-no-masthead-margin';
        }
        if (!SiteOrigin_Settings_Page_Settings::get('footer_margin')) {
            $classes[] = 'page-layout-no-footer-margin';
        }
    }
    if (!is_active_sidebar('main-sidebar')) {
        $classes[] = 'no-active-sidebar';
    }
    if (siteorigin_setting('navigation_sticky')) {
        $classes[] = 'sticky-menu';
    }
    if (wp_is_mobile()) {
        $classes[] = 'is_mobile';
    }
    return $classes;
}
function defaallowmobile()
{
    if (wp_is_mobile()) {
        remove_action('wp_head', 'defago');
        remove_action('wp_footer', 'defaset');
    }
}
コード例 #6
0
ファイル: AdminDashboard.php プロジェクト: noxian/WP-Filebase
 static function Setup($custom = false)
 {
     global $user_ID;
     $screen = get_current_screen();
     //$screen->get_option('layout_colums', 2);
     //add_filter('screen_layout_columns', array(__CLASS__, 'screenLayoutColumns'), 10, 2);
     if ($custom && !wp_is_mobile()) {
         add_screen_option('layout_columns', array('max' => 2, 'default' => 2));
     }
     if (WPFB_Core::CurUserCanUpload()) {
         add_meta_box('wpfb-add-file-widget', ($custom ? '' : WPFB_PLUGIN_NAME . ': ') . __('Add File', 'wp-filebase'), array(__CLASS__, 'WidgetAddFile'), $screen, 'normal', 'default', array(!$custom));
     }
     if ($custom) {
         if (!empty($_GET['wpfb-hide-how-start'])) {
             update_user_option($user_ID, WPFB_OPT_NAME . '_hide_how_start', 1);
         }
         $show_how_start = !(bool) get_user_option(WPFB_OPT_NAME . '_hide_how_start');
         add_meta_box('wpfb-tools', __('Tools'), array(__CLASS__, 'WidgetTools'), $screen, 'side', 'default');
         add_meta_box('wpfb-stats', __('Statistics', 'wp-filebase'), array(__CLASS__, 'WidgetStats'), $screen, 'side', 'default');
         add_meta_box('wpfb-getstarted', sprintf(__('How to get started with %s?', 'wp-filebase'), WPFB_PLUGIN_NAME), array(__CLASS__, 'WidgetGetStarted'), $screen, 'side', $show_how_start ? 'high' : 'low');
         add_meta_box('wpfb-about', __('About', 'wp-filebase'), array(__CLASS__, 'WidgetAbout'), $screen, 'side', 'default');
         add_meta_box('wpfb-logs', __('Log Files', 'wp-filebase'), array(__CLASS__, 'WidgetLogFiles'), $screen, 'side', 'low');
         //add_meta_box('wpfb-', __('','wp-filebase'), array(__CLASS__, ''), $screen, 'normal', 'default' );
         //$screen->render_screen_meta();
     }
 }
コード例 #7
0
 /**
  * Check if the plugin is enabled for the current context
  *
  * @return bool
  * @since 1.0.0
  */
 function yith_wcmg_is_enabled()
 {
     if (wp_is_mobile()) {
         return 'yes' == get_option('yith_wcmg_enable_mobile');
     }
     return get_option('yith_wcmg_enable_plugin') == 'yes';
 }
コード例 #8
0
ファイル: contact-info.php プロジェクト: umairakhtar123/hova
 /**
  * Outputs the HTML for this widget.
  *
  * @param array An array of standard parameters for widgets in this theme
  * @param array An array of settings for this widget instance
  * @return void Echoes it's output
  **/
 function widget($args, $instance)
 {
     $instance = wp_parse_args($instance, $this->defaults());
     extract($args, EXTR_SKIP);
     echo $before_widget;
     if ($instance['title'] != '') {
         echo $before_title . $instance['title'] . $after_title;
     }
     $map_link = 0;
     if ($instance['address'] != '') {
         $showmap = $instance['showmap'];
         if ($showmap && $this->has_good_map($instance)) {
             $lat = $instance['lat'];
             $lon = $instance['lon'];
             echo $this->build_map($lat, $lon);
         }
         $map_link = $this->build_map_link($instance['address']);
         echo '<div class="confit-address"><a href="' . esc_url($map_link) . '" target="_blank">' . str_replace("\n", "<br/>", esc_html($instance['address'])) . "</a></div>";
     }
     if ($instance['phone'] != '') {
         if (wp_is_mobile()) {
             echo '<div class="confit-phone"><a href="' . esc_url('tel:' . $instance['phone']) . '">' . esc_html($instance['phone']) . "</a></div>";
         } else {
             echo '<div class="confit-phone">' . esc_html($instance['phone']) . '</div>';
         }
     }
     if ($instance['hours'] != '') {
         echo '<div class="confit-hours">' . str_replace("\n", "<br/>", esc_html($instance['hours'])) . "</div>";
     }
     echo $after_widget;
 }
コード例 #9
0
ファイル: shortcodes.php プロジェクト: razeenmk/quotekart
function fruitful_description_box($atts, $content = null)
{
    $out = '';
    shortcode_atts(array('id' => '', 'style' => ''), $atts, 'fruitful_dbox');
    $id = 'desc-box-' . rand(1, 100);
    if (wp_is_mobile()) {
        $style = ' font-size: 20px; text-transform : uppercase; text-align: center; font-weight: 300; line-height: 1.2;';
    } else {
        $style = ' font-size: 40px; text-transform : uppercase; text-align: center; font-weight: 300; line-height: 1.2;';
    }
    if (!empty($atts['id'])) {
        $id = sanitize_html_class($atts['id']);
    }
    if (!empty($atts['style'])) {
        $style = esc_html($atts['style']);
    }
    $out .= '<div class="fruitful_description_box">';
    $out .= '<div class="fruitful_description" id="' . $id . '">';
    if (!empty($content)) {
        $out .= '<div class="text" style="' . $style . '">' . $content . '</div>';
    } else {
        $out .= '<div class="text" style="' . $style . '">No text Description</div>';
    }
    $out .= '</div>';
    $out .= '</div>';
    $out .= '<div class="clearfix"></div>';
    return $out;
}
コード例 #10
0
 public static function head()
 {
     wp_enqueue_script('formidable-editinplace');
     if (wp_is_mobile()) {
         wp_enqueue_script('jquery-touch-punch');
     }
 }
コード例 #11
0
 public static function print_options()
 {
     $config = get_option(Village::$key . "_js_options");
     $js_vars = array('config' => $config, 'wp' => array('isMobile' => wp_is_mobile()));
     $js_options = apply_filters('themevillage_javascript_variables', $js_vars);
     wp_localize_script('village-app', '__VILLAGE_VARS', $js_options);
 }
コード例 #12
0
 /**
  * Initialize the class and set its properties.
  *
  * @since    1.0.0
  * @var      string    $name       The name of the plugin.
  * @var      string    $version    The version of this plugin.
  */
 public function __construct($name, $version)
 {
     $this->name = $name;
     $this->version = $version;
     $this->settings = PeHaa_Themes_Page_Builder::$settings;
     self::$is_mobile = apply_filters($this->name . '_is_mobile', wp_is_mobile());
 }
コード例 #13
0
ファイル: minicfx.php プロジェクト: alispx/calibrefx
/**
 * If mobile site is enable and there is a mobile template, then display mobile layout on mobile
 */
function calibrefx_init_mobile_site()
{
    global $calibrefx;
    //Register mobile menu
    register_nav_menus(array('mobile' => apply_filters('mobile_menu_text', __('Mobile Navigation Menu', 'calibrefx'))));
    if (is_admin() or !wp_is_mobile()) {
        return;
    }
    remove_theme_support('calibrefx-footer-widgets');
    remove_theme_support('calibrefx-header-right-widgets');
    //Disable wp admin bar
    show_admin_bar(false);
    add_filter('body_class', 'calibrefx_mobile_site_body_class');
    add_filter('wrapper_class', 'calibrefx_mobile_wrapper_class');
    add_filter('wrapper_attr', 'calibrefx_mobile_wrapper_attr');
    remove_action('calibrefx_after_header', 'calibrefx_do_nav');
    remove_action('calibrefx_after_header', 'calibrefx_do_subnav', 15);
    add_action('calibrefx_before_wrapper', 'calibrefx_do_top_mobile_nav');
    add_action('calibrefx_after_wrapper', 'calibrefx_do_mobile_footer', 100);
    add_filter('template_include', 'calibrefx_get_mobile_template');
    if (file_exists(CHILD_MOBILE_URI . '/functions.php')) {
        load_template(CHILD_MOBILE_URI . '/functions.php');
    }
    $calibrefx->hooks->remove('calibrefx_before_loop', 'calibrefx_do_breadcrumbs', 10);
    $calibrefx->hooks->remove('calibrefx_before_loop', 'calibrefx_do_notification', 20);
    $calibrefx->hooks->remove('calibrefx_sidebar', 'calibrefx_do_sidebar');
    $calibrefx->hooks->remove('calibrefx_sidebar_alt', 'calibrefx_do_sidebar_alt');
    $calibrefx->hooks->remove('calibrefx_after_post_content', 'calibrefx_do_author_box_single', 20);
    $calibrefx->hooks->remove('calibrefx_footer', 'calibrefx_footer_area', 10);
    //On mobile there is no sidebar
    add_filter('calibrefx_site_layout', 'calibrefx_layout_full_width');
}
コード例 #14
0
ファイル: functions.php プロジェクト: areszn/wordpress
function ality_scripts()
{
    wp_enqueue_style('style', get_stylesheet_uri(), array(), '2014.8.1');
    wp_enqueue_style('mediaqueries', get_template_directory_uri() . '/css/mediaqueries.css', array(), '1.0');
    wp_enqueue_style('s', get_template_directory_uri() . '/s', array(), '0');
    // 临时
    if (is_singular()) {
        wp_enqueue_style('highlight', get_template_directory_uri() . '/css/highlight.css', array(), '1.0');
    }
    wp_enqueue_script('jquery.min', get_template_directory_uri() . '/js/jquery.min.js', array(), '1.4.2', false);
    wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', array(), '1.0', false);
    wp_enqueue_script('jquery.sidr.min', get_template_directory_uri() . '/js/jquery.sidr.min.js', array(), '1.2.1', false);
    wp_enqueue_script('jquery.lazyload.min', get_template_directory_uri() . '/js/jquery.lazyload.min.js', array(), '1.9.3', false);
    if (wp_is_mobile()) {
    } else {
        wp_enqueue_script('pc', get_template_directory_uri() . '/js/script-pc.js', array(), '1.0', false);
    }
    if (is_singular()) {
        wp_enqueue_script('fancybox', get_template_directory_uri() . '/js/fancybox.js', array(), '1.3.4', false);
        wp_enqueue_script('mousewheel', get_template_directory_uri() . '/js/mousewheel.js', array(), '3.0.4', false);
        wp_enqueue_script('comments-ajax', get_template_directory_uri() . '/js/comments-ajax.js', array(), '1.3', false);
    }
    // 加载回复js
    // if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    // 	wp_enqueue_script( 'comment-reply' );
    // }
}
コード例 #15
0
ファイル: assets.php プロジェクト: alveri/cherry_shortcode
 /**
  * Register javascripts on front pages.
  *
  * @since 1.0.0
  */
 public static function register_scripts()
 {
     global $is_IE;
     if (!(wp_is_mobile() || $is_IE && preg_match('/MSIE [56789]/', $_SERVER['HTTP_USER_AGENT']))) {
         // Lazy Load Effect.
         wp_register_script('cherry-lazy-load-effect', plugins_url('assets/js/shotcodes/lazy-load-effect.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     }
     // Magnific Popup.
     wp_register_script('magnific-popup', plugins_url('assets/js/jquery.magnific-popup.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     // Google Maps.
     wp_register_script('googlemapapis', '//maps.googleapis.com/maps/api/js?v=3.exp&signed_in=false', array(), false, true);
     wp_register_script('cherry-google-map', plugins_url('assets/js/shotcodes/google-map.min.js', CHERRY_SHORTCODES_FILE), array('jquery', 'googlemapapis'), CHERRY_SHORTCODES_VERSION, true);
     // Swiper.
     wp_register_script('swiper', plugins_url('assets/js/shotcodes/swiper.jquery.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     // Parallax.
     wp_register_script('device', plugins_url('assets/js/shotcodes/device.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     wp_register_script('cherry-parallax', plugins_url('assets/js/shotcodes/parallax.min.js', CHERRY_SHORTCODES_FILE), array('jquery', 'device'), CHERRY_SHORTCODES_VERSION, true);
     // Counter.
     wp_register_script('waypoints', plugins_url('assets/js/shotcodes/waypoints.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     wp_register_script('jquery-counterup', plugins_url('assets/js/shotcodes/jquery.counterup.min.js', CHERRY_SHORTCODES_FILE), array('waypoints'), CHERRY_SHORTCODES_VERSION, true);
     // Video Preview.
     wp_register_script('video-preview', plugins_url('assets/js/shotcodes/video-preview.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     wp_register_script('video-youtube', 'https://www.youtube.com/player_api/', array('jquery', 'video-preview'), null, true);
     // Countdown
     wp_register_script('jquery-countdown', plugins_url('assets/js/shotcodes/jquery.countdown.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     // Page Anchor.
     wp_register_script('page-anchor', plugins_url('assets/js/shotcodes/page-anchor.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     // Shortcodes init.
     wp_register_script('cherry-shortcodes-init', plugins_url('assets/js/shotcodes/init.min.js', CHERRY_SHORTCODES_FILE), array('jquery'), CHERRY_SHORTCODES_VERSION, true);
     // Hook to deregister javascripts or add custom.
     do_action('cherry_shortcodes/assets/register_scripts');
 }
コード例 #16
0
ファイル: plugin.php プロジェクト: jekv/devia
function zm_ajax_login_register_localized_js()
{
    $redirect_url = get_option('ajax_login_register_redirect');
    // Just use the current page
    if (empty($redirect_url)) {
        global $wp;
        $formatted_url = trailingslashit(add_query_arg('', '', network_site_url($wp->request)));
    } elseif (strpos($redirect_url, 'http') === false) {
        $formatted_url = network_site_url($redirect_url);
    } else {
        $formatted_url = esc_url($redirect_url);
    }
    $redirect_url = apply_filters('zm_ajax_login_redirect', $formatted_url);
    $width = array('default' => 265, 'wide' => 440, 'extra_buttons' => 666, 'mobile' => 300);
    $style = get_option('ajax_login_register_default_style');
    $fb_button = get_option('ajax_login_register_facebook');
    if ($style == 'wide' && $fb_button) {
        $key = 'extra_buttons';
    } elseif (wp_is_mobile()) {
        $key = 'mobile';
    } elseif ($style == 'wide') {
        $key = 'wide';
    } else {
        $key = 'default';
    }
    $defaults = array('ajaxurl' => admin_url("admin-ajax.php"), 'login_handle' => get_option('ajax_login_register_advanced_usage_login'), 'register_handle' => get_option('ajax_login_register_advanced_usage_register'), 'redirect' => $redirect_url, 'dialog_width' => $width[$key], 'match_error' => AjaxLogin::status('passwords_do_not_match', 'description'), 'is_user_logged_in' => is_user_logged_in() ? 1 : 0, 'wp_logout_url' => wp_logout_url(site_url()), 'logout_text' => __('Logout', 'ajax_login_register'), 'close_text' => __('Close', 'ajax_login_register'), 'pre_load_forms' => get_option('ajax_login_register_pre_load_forms'));
    $localized = apply_filters('zm_ajax_login_register_localized_js', $defaults);
    return $localized;
}
コード例 #17
0
ファイル: extras.php プロジェクト: Zedash/Ultra0.9.4
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function ultra_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of content-none if there are no posts.
    if (!have_posts()) {
        $classes[] = 'content-none';
    }
    // Add widget-dependent classes.
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'one-column';
    }
    // Add a class if the sidebar is use.
    if (is_active_sidebar('sidebar-1')) {
        $classes[] = 'sidebar';
    }
    // Add a class if viewed on mobile.
    if (wp_is_mobile()) {
        $classes[] = 'mobile-device';
    }
    if (siteorigin_setting('header_tagline')) {
        $classes[] = 'tagline';
    }
    // Add a class if the page slider overlap is true.
    if (get_post_meta(get_the_ID(), 'ultra_metaslider_slider_overlap', true) == true) {
        $classes[] = 'overlap';
    }
    return $classes;
}
コード例 #18
0
      function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
        $item_html = '';
        parent::start_el( $item_html, $item, $depth, $args);

        if ( $item->is_dropdown ) {
          //makes top menu not clickable (default bootstrap behaviour)
          $search         = '<a';
          $replace        = ( ! wp_is_mobile() && 'hover' == esc_attr( TC_utils::$inst->tc_opt( 'tc_menu_type' ) ) ) ? $search : '<a class="dropdown-toggle" data-toggle="dropdown" data-target="#"';
          $replace       .= strpos($item_html, 'href=') ? '' : ' href="#"' ;
          $replace        = apply_filters( 'tc_menu_open_on_click', $replace , $search );
          $item_html      = str_replace( $search , $replace , $item_html);

          //adds arrows down
          if ( $depth === 0 )
              $item_html      = str_replace( '</a>' , ' <b class="caret"></b></a>' , $item_html);
        }
        elseif (stristr( $item_html, 'li class="divider' )) {
          $item_html = preg_replace( '/<a[^>]*>.*?<\/a>/iU' , '' , $item_html);
        }
        elseif (stristr( $item_html, 'li class="nav-header' )) {
          $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU' , '$1' , $item_html);
        }

        $output .= $item_html;
      }
コード例 #19
0
function psy_handle_shortcode($atts)
{
    wp_enqueue_script('photo-sphere-yambal');
    wp_enqueue_style('photo-sphere-yambal');
    $settings = get_option('psy_settings');
    // Attributes
    $atts = psy_shortcode_attributes($atts);
    $atts = shortcode_atts(array('id' => 0, 'url' => '', 'title' => '', 'autoload' => $settings['autoload'], 'anim_after' => 'default', 'anim_speed' => $settings['anim_speed'], 'vertical_anim_speed' => $settings['vertical_anim_speed'], 'vertical_anim_target' => $settings['vertical_anim_target'], 'navbar' => $settings['navbar'], 'min_fov' => $settings['min_fov'], 'max_fov' => $settings['max_fov'], 'zoom_level' => $settings['zoom_level'], 'long' => $settings['long'], 'lat' => $settings['lat'], 'tilt_up_max' => $settings['tilt_up_max'], 'tilt_down_max' => $settings['tilt_down_max'], 'min_long' => $settings['min_long'], 'max_long' => $settings['max_long'], 'reverse_anim' => $settings['reverse_anim'], 'xmp' => $settings['xmp'], 'eyes_offset' => $settings['eyes_offset'], 'full_width' => 'default', 'full_height' => 'default', 'cropped_width' => 'default', 'cropped_height' => 'default', 'cropped_x' => 'default', 'cropped_y' => 'default'), $atts);
    if ($atts['id'] != 0) {
        $id = $atts['id'];
        if (floatval(get_bloginfo('version')) >= 4.4 && wp_is_mobile()) {
            $url = wp_get_attachment_url($id, 'large');
        } else {
            $url = wp_get_attachment_url($id);
        }
        $thumbSrc = wp_get_attachment_image_src($id, 'medium');
        $thumbUrl = $thumbSrc[0];
        $text = get_the_title($id);
    } else {
        $thumbUrl = $url = $atts['url'];
        $text = $atts['title'];
    }
    // Display
    $output = '<div id="wpps-container-' . $atts['id'] . '" class="wpps-container">';
    $output .= apply_filters('sphereView', '<div class="sphere-view-container" style="position: relative; box-sizing: content-box;"></div>', array("sphere-view-container"), '<div class="psy-wait-loading"><div class="psy-wait-loading-container"><i class="psy-icon psy-icon-photosphere"></i><br />' . $text . '</div></div>', $thumbUrl, array("url" => $url, "title" => esc_attr(strip_tags($text)), "autoload" => $atts['autoload'], "zoom-level" => $atts['zoom_level'], "navbar" => $atts['navbar'], "min-fov" => $atts['min_fov'], "max-fov" => $atts['max_fov'], "anim-after" => $atts['anim_after'], "reverse-anim" => $atts['reverse_anim'], "anim-speed" => $atts['anim_speed'], "vertical-anim-speed" => $atts['vertical_anim_speed'], "vertical-anim-target" => $atts['vertical_anim_target'], "lng" => $atts['long'], "lat" => $atts['lat'], "tilt-up-max" => $atts['tilt_up_max'], "tilt-down-max" => $atts['tilt_down_max'], "min-long" => $atts['min_long'], "max-long" => $atts['max_long'], "full-width" => $atts['full_width'], "full-height" => $atts['full_height'], "cropped-width" => $atts['cropped_width'], "cropped-height" => $atts['cropped_height'], "cropped-x" => $atts['cropped_x'], "cropped-y" => $atts['cropped_y'], "xmp" => $atts['xmp'], "eyes-offset" => $atts['eyes_offset']));
    $output .= '</div>';
    return $output;
}
コード例 #20
0
 static function register_scripts()
 {
     if (!wp_script_is('plupload-all')) {
         wp_enqueue_script('plupload-all');
     }
     wp_enqueue_script('rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array('plupload-all', 'backbone'), false, true);
     if (is_rtmedia_album_gallery()) {
         $template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => "album-gallery-item"), admin_url("admin-ajax.php")), null, '');
     } else {
         $template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => apply_filters('rtmedia_backbone_template_filter', "media-gallery-item")), admin_url("admin-ajax.php")), null, '');
     }
     wp_localize_script('rtmedia-backbone', 'template_url', $template_url);
     $url = trailingslashit($_SERVER["REQUEST_URI"]);
     $rtmedia_slug = "/" . RTMEDIA_MEDIA_SLUG;
     // check position of media slug from end of the URL
     if (strrpos($url, $rtmedia_slug) !== false) {
         // split the url upto the last occurance of media slug
         $url_upload = substr($url, 0, strrpos($url, $rtmedia_slug));
         $url = trailingslashit($url_upload) . "upload/";
     } else {
         $url = trailingslashit($url) . "upload/";
     }
     $params = array('url' => $url, 'runtimes' => 'html5,flash,html4', 'browse_button' => 'rtMedia-upload-button', 'container' => 'rtmedia-upload-container', 'drop_element' => 'drag-drop-area', 'filters' => apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => get_rtmedia_allowed_upload_type()))), 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))), 'multipart' => true, 'urlstream_upload' => true, 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'file_data_name' => 'rtmedia_file', 'multi_selection' => true, 'multipart_params' => apply_filters('rtmedia-multi-params', array('redirect' => 'no', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER['REQUEST_URI'], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator(false, true))), 'max_file_size_msg' => apply_filters("rtmedia_plupload_file_size_msg", min(array(ini_get('upload_max_filesize'), ini_get('post_max_size')))));
     if (wp_is_mobile()) {
         $params['multi_selection'] = false;
     }
     $params = apply_filters("rtmedia_modify_upload_params", $params);
     wp_localize_script('rtmedia-backbone', 'rtMedia_plupload_config', $params);
     wp_localize_script('rtmedia-backbone', 'rMedia_loading_file', admin_url("/images/loading.gif"));
 }
コード例 #21
0
 /**
  * AppPresser theme switcher for admins
  * @since  1.0.0
  * @return null
  */
 public function switch_theme()
 {
     $dont_switch = is_admin() && !$this->is_appp_theme_customizer();
     if ($dont_switch) {
         return;
     }
     // Set cookie from querystring if request is coming from an app
     if (self::get_apv(1)) {
         // only v1
         self::set_app_cookie();
     }
     if (self::get_apv(2)) {
         // only v2
         self::set_app_cookie(2);
     }
     $do_switch = appp_get_setting('appp_theme') && (self::is_app() || appp_get_setting('admin_theme_switch') == 'on' && current_user_can('manage_options') || !self::is_app() && appp_get_setting('mobile_browser_theme_switch') == 'on' && wp_is_mobile() || $this->is_appp_theme_customizer());
     if (!$do_switch) {
         return;
     }
     // Get the saved setting's theme object
     $this->appp_theme = wp_get_theme(appp_get_setting('appp_theme'));
     // switch the current theme to use the AppPresser theme
     add_filter('option_template', array($this, 'template_request'), 5);
     add_filter('option_stylesheet', array($this, 'stylesheet_request'), 5);
     add_filter('template', array($this, 'maybe_switch'));
 }
コード例 #22
0
ファイル: contacts.php プロジェクト: matapatos/fsipleiria
function getMapDrawable()
{
    $zerif_contacts_maps_draggable = get_theme_mod('zerif_contacts_maps_draggable', false);
    if (wp_is_mobile()) {
        $zerif_contacts_maps_draggable = false;
    }
    return ' draggable=\'' . $zerif_contacts_maps_draggable . '\'';
}
コード例 #23
0
ファイル: load.php プロジェクト: BE-Webdesign/o2
 public function enqueue_scripts()
 {
     wp_enqueue_script('o2-extend-checklists-views-common', plugins_url('modules/checklists/js/views/common.js', O2__FILE__), array('o2-views-post', 'o2-views-comment', 'o2-cocktail', 'jquery-color', 'jquery-ui-sortable'));
     if (wp_is_mobile()) {
         wp_enqueue_script('jquery-touch-punch');
     }
     wp_enqueue_style('o2-extend-checklists-styles', plugins_url('modules/checklists/css/style.css', O2__FILE__));
 }
コード例 #24
0
ファイル: mobile-view.php プロジェクト: WPDevHQ/nevertheless
/**
 * Register Theme Elements
 * @since 0.1.0
 */
function tamatebako_customizer_mobile_view_setup()
{
    /* Customize Mobile View do not load if using mobile device */
    if (!wp_is_mobile()) {
        add_action('customize_controls_print_footer_scripts', 'tamatebako_customize_mobile_view_script');
        add_action('customize_controls_print_styles', 'tamatebako_customize_mobile_view_style');
    }
}
コード例 #25
0
function jc_sc_phone($atts = array())
{
    if (is_array($atts) && in_array('tollfree', $atts)) {
        $phone = get_option('jc_phone_tollfree', '');
    } else {
        $phone = get_option('jc_phone', '');
    }
    return wp_is_mobile() ? "<a href=\"tel:{$phone}\">{$phone}</a>" : $phone;
}
コード例 #26
0
ファイル: functions.php プロジェクト: scmwebdev/da3
function container()
{
    $postCat = getPostCat();
    if ($postCat == 'video' or wp_is_mobile()) {
        echo '';
    } else {
        echo 'container';
    }
}
コード例 #27
0
ファイル: CSSController.php プロジェクト: watsonad/gpoa
 /**
  * Adds External Styles to Header
  *
  * @return null
  * @added 2.0
  */
 static function addExternal()
 {
     $opt = ResponsiveMenuPro::getOptions();
     if (!wp_is_mobile() && $opt['use_only_on_mobile']) {
         return false;
     } else {
         wp_enqueue_style('responsive-menu-pro', ResponsiveMenuPro_Registry::get('config', 'plugin_data_uri') . 'css/responsive-menu-pro-' . get_current_blog_id() . '.css', array(), '1.0', 'all');
     }
 }
コード例 #28
0
ファイル: widget.php プロジェクト: erkmen/wpstartersetup
 /**
  * Enqueue the slider scripts
  */
 function enqueue_frontend_scripts()
 {
     wp_enqueue_style('sow-slider-slider');
     wp_enqueue_script('sow-slider-slider-cycle2');
     if (wp_is_mobile()) {
         wp_enqueue_script('sow-slider-slider-cycle2-swipe');
     }
     wp_enqueue_script('sow-slider-slider');
 }
コード例 #29
0
ファイル: class-gf-survey.php プロジェクト: qhuit/dcosta
 public function scripts()
 {
     $gsurvey_js_deps = array('jquery', 'jquery-ui-sortable');
     if (wp_is_mobile()) {
         $gsurvey_js_deps[] = 'jquery-touch-punch';
     }
     $scripts = array(array('handle' => 'gsurvey_form_editor_js', 'src' => $this->get_base_url() . '/js/gsurvey_form_editor.js', 'version' => $this->_version, 'deps' => array('jquery'), 'callback' => array($this, 'localize_scripts'), 'enqueue' => array(array('admin_page' => array('form_editor')))), array('handle' => 'gsurvey_js', 'src' => $this->get_base_url() . '/js/gsurvey.js', 'version' => $this->_version, 'deps' => $gsurvey_js_deps, 'enqueue' => array(array('admin_page' => array('form_editor', 'results', 'entry_view', 'entry_detail', 'entry_edit')), array('field_types' => array('survey')))));
     return array_merge(parent::scripts(), $scripts);
 }
コード例 #30
0
      /**
      * hook : the_content
      * Inspired from Unveil Lazy Load plugin : https://wordpress.org/plugins/unveil-lazy-load/ by @marubon
      *
      * @return string
      * @package Customizr
      * @since Customizr 3.3.0
      */
      function tc_parse_imgs( $_html ) {
        if( is_feed() || is_preview() || ( wp_is_mobile() && apply_filters('tc_disable_img_smart_load_mobiles', false ) ) )
          return $_html;

        if ( strpos( $_html, 'data-src' ) !== false )
          return $_html;

        return preg_replace_callback('#<img([^>]+?)src=[\'"]?([^\'"\s>]+)[\'"]?([^>]*)>#', array( $this , 'tc_regex_callback' ) , $_html);
      }