function merge_comment_count($count, $post_ID)
{
    // get all the languages for which this post exists
    $languages = icl_get_languages('skip_missing=1');
    $post = get_post($post_ID);
    $type = $post->post_type;
    foreach ($languages as $l) {
        // in $count is already the count from the current language
        if (!$l['active']) {
            $otherID = icl_object_id($post_ID, $type, false, $l['language_code']);
            if ($otherID) {
                // cannot use call_user_func due to php regressions
                if ($type == 'page') {
                    $otherpost = get_page($otherID);
                } else {
                    $otherpost = get_post($otherID);
                }
                if ($otherpost) {
                    // increment comment count using translation post comment count.
                    $count = $count + $otherpost->comment_count;
                }
            }
        }
    }
    return $count;
}
Пример #2
0
function stormbringer_languages_switcher(){
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    $inactives='';
    $actives='';
    if(!empty($languages)){
        echo '<div id="langswitcher"><div class="btn-group">';
        foreach($languages as $l) :
          if($l['active'])
            $actives='
              <button data-toggle="dropdown" class="btn dropdown-toggle">
              '.$l['language_code'].' <span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
            ';
          else
            $inactives.= '
              <li>
                <a href="'.$l['url'].'" data-lang="'.$l['language_code'].'">'.$l['language_code'].'</a>
              </li>
            ';
        endforeach;
            
        echo $actives.$inactives;
        echo '</ul></div></div>';
    }
}
Пример #3
0
/**
 * Update to default settings
 */
function st_update_default_settings($check = false)
{
    $option_name = '_' . ST_NAME . '_is_import_default';
    if ($check === true) {
        if (get_option($option_name) == 'y') {
            return false;
        }
    }
    // default setting options
    $default = 'a:74:{s:6:"layout";s:1:"2";s:9:"site_logo";s:85:"http://demo.smooththemes.com/exposed/wp-content/themes/Exposed/assets/images/logo.png";s:12:"site_favicon";s:0:"";s:9:"body_font";a:8:{s:9:"font-size";s:2:"14";s:14:"font-size-unit";s:2:"px";s:11:"line-height";s:2:"24";s:16:"line-height-unit";s:2:"px";s:5:"color";s:0:"";s:11:"font-family";s:145:"http://fonts.googleapis.com/css?family=Lato:100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C700%2C700italic%2C900%2C900italic&subset=latin";s:10:"font-style";s:6:"normal";s:11:"font-weight";s:6:"normal";}s:13:"headings_font";a:1:{s:11:"font-family";s:145:"http://fonts.googleapis.com/css?family=Lato:100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C700%2C700italic%2C900%2C900italic&subset=latin";}s:9:"heading_1";a:2:{s:9:"font-size";s:2:"32";s:14:"font-size-unit";s:2:"px";}s:9:"heading_2";a:2:{s:9:"font-size";s:2:"30";s:14:"font-size-unit";s:2:"px";}s:9:"heading_3";a:2:{s:9:"font-size";s:2:"18";s:14:"font-size-unit";s:2:"px";}s:9:"heading_4";a:2:{s:9:"font-size";s:2:"18";s:14:"font-size-unit";s:2:"px";}s:9:"heading_5";a:2:{s:9:"font-size";s:2:"16";s:14:"font-size-unit";s:2:"px";}s:9:"heading_6";a:2:{s:9:"font-size";s:2:"14";s:14:"font-size-unit";s:2:"px";}s:17:"select_theme_skin";s:4:"dark";s:25:"enable_custom_global_skin";s:1:"n";s:18:"custom_global_skin";s:6:"fff200";s:12:"container_bg";s:0:"";s:20:"container_bg_opacity";s:0:"";s:12:"border_color";s:6:"343434";s:26:"gallery_item_hover_opacity";s:3:"0.6";s:7:"bg_type";s:7:"default";s:10:"defined_bg";s:12:"pattern3.png";s:16:"defined_bg_color";s:6:"c71c77";s:8:"bg_color";s:0:"";s:6:"bg_img";s:0:"";s:10:"bg_positon";s:2:"cc";s:10:"bg_repreat";s:1:"y";s:8:"bg_fixed";s:1:"y";s:21:"disable_header_custom";s:1:"y";s:17:"header_link_color";s:6:"ffffff";s:23:"header_link_hover_color";s:6:"ffffff";s:15:"header_bg_color";s:6:"000000";s:13:"header_bg_img";s:0:"";s:17:"header_bg_positon";s:0:"";s:17:"header_bg_repreat";s:0:"";s:15:"header_bg_fixed";s:0:"";s:13:"blog_toptitle";s:8:"The Blog";s:19:"s_show_featured_img";s:1:"y";s:16:"s_show_post_meta";s:1:"y";s:15:"s_show_post_tag";s:1:"y";s:18:"enable_author_desc";s:1:"y";s:15:"s_show_comments";s:1:"y";s:8:"facebook";s:2:"#f";s:7:"twitter";s:2:"#t";s:11:"google_plus";s:0:"";s:4:"digg";s:0:"";s:9:"pinterest";s:0:"";s:6:"flickr";s:7:"#flickr";s:16:"footer_copyright";s:115:"&copy; 2012. All Rights Reserved. Created with love by <a href=\\"http://www.smooththemes.com\\">SmoothThemes.Com</a>";s:14:"flex_animation";s:4:"fade";s:17:"flex_directionNav";s:1:"y";s:18:"flex_animationLoop";s:1:"y";s:14:"flex_slideshow";s:1:"y";s:19:"flex_slideshowSpeed";s:4:"7000";s:19:"flex_animationSpeed";s:3:"600";s:18:"flex_pauseOnAction";s:4:"true";s:17:"flex_pauseOnHover";s:1:"y";s:15:"flex_controlNav";s:1:"y";s:14:"flex_randomize";s:1:"n";s:20:"fixed_slideshowSpeed";s:4:"7000";s:20:"fixed_animationSpeed";s:3:"600";s:12:"fsc_autoplay";s:1:"y";s:13:"fsc_slideshow";s:1:"y";s:12:"fsc_interval";s:4:"6000";s:20:"fsc_transition_speed";s:3:"800";s:11:"gif_horizon";s:3:"0.6";s:8:"gif_size";s:3:"0.2";s:10:"gif_border";s:1:"0";s:21:"gkb_frames_per_second";s:2:"60";s:16:"gkb_display_time";s:4:"5000";s:13:"gkb_fade_time";s:4:"1000";s:8:"gkb_zoom";s:3:"1.2";s:18:"gflip_directionnav";s:1:"y";s:15:"gflip_thumbnail";s:1:"y";s:21:"headder_tracking_code";s:0:"";s:20:"footer_tracking_code";s:0:"";}';
    $translate = 'YTo1OTp7czo2OToiVGhpcyBwb3N0IGlzIHBhc3N3b3JkIHByb3RlY3RlZC4gRW50ZXIgdGhlIHBhc3N3b3JkIHRvIHZpZXcgY29tbWVudHMuIjtzOjA6IiI7czoxMjoiTm8gUmVzcG9uc2VzIjtzOjA6IiI7czoxMjoiT25lIFJlc3BvbnNlIjtzOjA6IiI7czoxMToiJSBSZXNwb25zZXMiO3M6MDoiIjtzOjE0OiJPbGRlciBDb21tZW50cyI7czowOiIiO3M6MTQ6Ik5ld2VyIENvbW1lbnRzIjtzOjA6IiI7czoyOiJ0byI7czowOiIiO3M6MjA6IkNvbW1lbnRzIGFyZSBjbG9zZWQuIjtzOjA6IiI7czoxOToiTGVhdmUgYSBSZXBseSB0byAlcyI7czowOiIiO3M6MTE6IllvdSBtdXN0IGJlIjtzOjA6IiI7czoxODoidG8gcG9zdCBhIGNvbW1lbnQuIjtzOjA6IiI7czoyOToiUmVxdWlyZWQgZmllbGRzIGFyZSBtYXJrZWQgJXMiO3M6MDoiIjtzOjEzOiJMZWF2ZSBhIFJlcGx5IjtzOjA6IiI7czoxMjoiQ2FuY2VsIFJlcGx5IjtzOjA6IiI7czoxMjoiUG9zdCBDb21tZW50IjtzOjA6IiI7czo3OiJDb21tZW50IjtzOjA6IiI7czo1NzoiWW91IG11c3QgYmUgPGEgaHJlZj0iJXMiPmxvZ2dlZCBpbjwvYT4gdG8gcG9zdCBhIGNvbW1lbnQuIjtzOjA6IiI7czo0MToiWW91ciBlbWFpbCBhZGRyZXNzIHdpbGwgbm90IGJlIHB1Ymxpc2hlZC4iO3M6MDoiIjtzOjQ6Ik5hbWUiO3M6MDoiIjtzOjU6IkVtYWlsIjtzOjA6IiI7czo3OiJXZWJzaXRlIjtzOjA6IiI7czoyMToidHlwZSBhbmQgaGl0IGVudGVyLi4uIjtzOjA6IiI7czo2OiJTZWFyY2giO3M6MDoiIjtzOjc6IlBhZ2UgJXMiO3M6MDoiIjtzOjE1OiJQZXJtYWxpbmsgdG8gJXMiO3M6MDoiIjtzOjM6IkFsbCI7czowOiIiO3M6OToiTG9hZGluZy4uIjtzOjA6IiI7czo5OiJMb2FkIG1vcmUiO3M6MDoiIjtzOjg6IkRhdGU6ICVzIjtzOjA6IiI7czo4OiJUYWdzOiAlcyI7czowOiIiO3M6MzoiLi4uIjtzOjA6IiI7aTo0MDQ7czowOiIiO3M6MTU6IkdvIHRvIEhvbWUgcGFnZSI7czowOiIiO3M6MTk6Im9yIHNlYXJjaCB0aGlzIHNpdGUiO3M6MDoiIjtzOjE5OiJBdXRob3IgQXJjaGl2ZXM6ICVzIjtzOjA6IiI7czoxMToiU2VhY2ggZm9yIDoiO3M6MDoiIjtzOjE4OiJEYWlseSBBcmNoaXZlczogJXMiO3M6MDoiIjtzOjIwOiJNb250aGx5IEFyY2hpdmVzOiAlcyI7czowOiIiO3M6MzoiRiBZIjtzOjA6IiI7czoxOToiWWVhcmx5IEFyY2hpdmVzOiAlcyI7czowOiIiO3M6MToiWSI7czowOiIiO3M6MTM6IkJsb2cgQXJjaGl2ZXMiO3M6MDoiIjtzOjIxOiJPb3BzLCBQYWdlIG5vdCBmb3VuZC4iO3M6MDoiIjtzOjY6IlBhZ2VzOiI7czowOiIiO3M6OToiTmV4dCBwYWdlIjtzOjA6IiI7czoxMzoiUHJldmlvdXMgcGFnZSI7czowOiIiO3M6NToiVGFnczoiO3M6MDoiIjtzOjk6IjAgQ29tbWVudCI7czowOiIiO3M6OToiMSBDb21tZW50IjtzOjA6IiI7czoxMDoiJSBDb21tZW50cyI7czowOiIiO3M6NToiU2hhcmUiO3M6MDoiIjtzOjE4OiJBdXRob3IgRGVzY3JpcHRpb24iO3M6MDoiIjtzOjk6IllvdXIgTmFtZSI7czowOiIiO3M6ODoicmVxdWlyZWQiO3M6MDoiIjtzOjE5OiJZb3VyIEUtTWFpbCBBZGRyZXNzIjtzOjA6IiI7czo3OiJTdWJqZWN0IjtzOjA6IiI7czo4OiJNZXNzYWdlOiI7czowOiIiO3M6MTA6IlN1Ym1pdCBOb3ciO3M6MDoiIjtzOjEzOiJSZWFkIG1vcmUg4oaSIjtzOjA6IiI7fQ==';
    $default = str_replace("'", "\\'", $default);
    $default = maybe_unserialize($default);
    $default['site_logo'] = st_img('logo.png');
    update_option(ST_SETTINGS_OPTION, $default);
    if (st_is_wpml()) {
        $langs = icl_get_languages('skip_missing=0&orderby=KEY&order=asc');
        foreach ($langs as $l) {
            update_option(ST_SETTINGS_OPTION . '_' . $l['language_code'], $default);
        }
    }
    // update translate options
    $translate = str_replace("'", "\\'", base64_decode($translate));
    $translate = maybe_unserialize($translate);
    update_option(ST_TRANSLATE_OPTION, $translate);
    update_option($option_name, 'y');
}
Пример #4
0
 public static function get_languages($skip_missing = 0)
 {
     if (!self::exists()) {
         return;
     }
     return icl_get_languages('skip_missing=' . $skip_missing);
 }
 public function set_all_post_notices()
 {
     //$this->get_all_search_forms_wlang();
     if (Search_Filter_Helper::has_wpml() && defined('ICL_LANGUAGE_CODE')) {
         if (ICL_LANGUAGE_CODE == "all") {
             //this means a user has selected "all languages" - so loop loop through each language and check for errors - appending lang code
             $langs = icl_get_languages('skip_missing=0&orderby=KEY&order=DIR&link_empty_to=str');
             foreach ($langs as $lang) {
                 if (isset($lang['code'])) {
                     $search_form_ids = $this->get_all_search_forms_wlang($lang['code']);
                     $this->set_all_post_notices_wlang($search_form_ids, $lang['code']);
                 }
             }
             //reset current language - should be "all"
             global $sitepress;
             if (!empty($sitepress)) {
                 $sitepress->switch_lang(ICL_LANGUAGE_CODE);
             }
         } else {
             //user must be on a specifc language, let wpml filter the rest
             $search_form_ids = $this->get_all_search_forms_wlang();
             $this->set_all_post_notices_wlang($search_form_ids);
         }
     } else {
         $search_form_ids = $this->get_all_search_forms_wlang();
         $this->set_all_post_notices_wlang($search_form_ids);
     }
 }
Пример #6
0
/**
 * Theme Mode demo code of all the available option types.
 *
 * @return    void
 *
 * @access    private
 * @since     2.0
 */
function _custom_theme_options()
{
    global $google_fonts;
    global $layers;
    /**
     * Get a copy of the saved settings array.
     */
    $saved_settings = get_option('option_tree_settings', array());
    /**
     * Create a custom settings array that we pass to
     * the OptionTree Settings API Class.
     */
    $custom_settings = array('contextual_help' => array('content' => array(array('id' => 'general_help', 'title' => 'General', 'content' => '<p>Help content goes here!</p>')), 'sidebar' => '<p>Sidebar content goes here!</p>'), 'sections' => array(array('title' => 'Slider', 'id' => 'slider'), array('title' => 'Header', 'id' => 'header'), array('title' => 'General', 'id' => 'general_default'), array('title' => 'WooCommerce', 'id' => 'woocommerce'), array('title' => 'Blog options', 'id' => 'blog'), array('title' => 'Portfolio options', 'id' => 'portfolio'), array('id' => 'typo', 'title' => 'Typography'), array('id' => 'twitter', 'title' => 'Twitter OAuth'), array('id' => 'sidebars', 'title' => 'Sidebars'), array('id' => 'update', 'title' => 'Update')), 'settings' => array(array('label' => 'Enable slider', 'id' => 'pp_slider_on', 'type' => 'select', 'desc' => 'Show slider on homepage', 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider'), array('label' => 'Choose Revolution Slider for homepage', 'id' => 'pp_revo_slider', 'type' => 'select', 'desc' => '', 'choices' => $layers, 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider'), array('label' => 'Header type', 'id' => 'pp_header_menu', 'type' => 'select', 'desc' => 'Select header type', 'choices' => array(array('label' => 'Standard header', 'value' => 'standard'), array('label' => 'Alternative header', 'value' => 'full')), 'std' => 'true', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Header height', 'id' => 'pp_header_height', 'type' => 'numeric-slider', 'desc' => 'Default 86px, type just a number.', 'std' => '86', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'min_max_step' => '50,400,1', 'section' => 'header'), array('label' => 'Mobile menu breakpoint', 'id' => 'pp_menu_breakpoint', 'type' => 'numeric-slider', 'desc' => 'Set width after menu should switch to mobile version (use if you have exceptionaly wide menu).', 'std' => '767', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'min_max_step' => '767,1200,1', 'section' => 'header'), array('label' => 'Sticky header status', 'id' => 'pp_sticky_menu', 'type' => 'select', 'desc' => 'Enable/disable menu while scrolling', 'choices' => array(array('label' => 'Disable', 'value' => 'disable'), array('label' => 'Enable', 'value' => 'enable')), 'std' => 'true', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Upload logo', 'id' => 'pp_logo_upload', 'type' => 'upload', 'desc' => 'For best effect logo image should be transparent png, logo from live preview has 114x24px but you can use bigger, you will probably need to adjust some margins using options below ', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Logo area width', 'id' => 'pp_logo_area_width', 'type' => 'select', 'desc' => 'Full width of top area is 16 columns. Logo area by default is 9 columns, while icons and contact details area is 6 columns wide. If you want to have bigger logo, please change here number of columns for logo. ', 'choices' => array(array('label' => '1 column', 'value' => '1'), array('label' => '2 columns', 'value' => '2'), array('label' => '3 columns', 'value' => '3'), array('label' => '4 columns', 'value' => '4'), array('label' => '5 columns', 'value' => '5'), array('label' => '6 columns', 'value' => '6'), array('label' => '7 columns', 'value' => '7'), array('label' => '8 columns', 'value' => '8'), array('label' => '9 columns', 'value' => '9'), array('label' => '10 columns', 'value' => '10'), array('label' => '11 columns', 'value' => '11'), array('label' => '12 columns', 'value' => '12')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Logo top margin', 'id' => 'pp_logo_top_margin', 'type' => 'measurement', 'desc' => 'Set top margin for logo image', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Logo top margin in compact header', 'id' => 'pp_logo_top_margin_sticky', 'type' => 'measurement', 'desc' => 'Set top margin for logo image when sticky header is enabled', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Logo bottom margin', 'id' => 'pp_logo_bottom_margin', 'type' => 'measurement', 'desc' => 'Set bottom margin for logo image', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Search form in menu', 'id' => 'pp_search', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Enable', 'value' => 'enable'), array('label' => 'Disable', 'value' => 'disable')), 'std' => 'disable', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Favicon ', 'id' => 'pp_favicon_upload', 'type' => 'upload', 'desc' => 'Upload favicon here (16x16)', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Enable contact details in header', 'id' => 'pp_contact_details', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Contact details email', 'id' => 'pp_cdetails_email', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Contact details phone', 'id' => 'pp_cdetails_phone', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'header'), array('label' => 'Footer social icons', 'id' => 'pp_headericons', 'type' => 'list-item', 'desc' => 'Manage socials icons on header.', 'settings' => array(array('id' => 'icons_service', 'label' => 'Choose service', 'desc' => '', 'std' => '', 'type' => 'select', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'choices' => array(array('value' => 'twitter', 'label' => 'Twitter', 'src' => ''), array('value' => 'facebook', 'label' => 'Facebook', 'src' => ''), array('value' => 'delicious', 'label' => 'Delicious', 'src' => ''), array('value' => 'paypal', 'label' => 'PayPal', 'src' => ''), array('value' => 'gplus', 'label' => 'Google Plus', 'src' => ''), array('value' => 'stumbleupon', 'label' => 'StumbleUpon', 'src' => ''), array('value' => 'fivehundredpx', 'label' => '500px', 'src' => ''), array('value' => 'pinterest', 'label' => 'Pinterest', 'src' => ''), array('value' => 'forrst', 'label' => 'Forrst', 'src' => ''), array('value' => 'digg', 'label' => 'Digg', 'src' => ''), array('value' => 'spotify', 'label' => 'Spotify', 'src' => ''), array('value' => 'reddit', 'label' => 'Reddit', 'src' => ''), array('value' => 'appstore', 'label' => 'AppStore', 'src' => ''), array('value' => 'blogger', 'label' => 'Blogger', 'src' => ''), array('value' => 'dribbble', 'label' => 'Dribbble', 'src' => ''), array('value' => 'evernote', 'label' => 'Evernote', 'src' => ''), array('value' => 'flickr', 'label' => 'Flickr', 'src' => ''), array('value' => 'linkedin', 'label' => 'LinkedIN', 'src' => ''), array('value' => 'rss', 'label' => 'RSS', 'src' => ''), array('value' => 'youtube', 'label' => 'YouTube', 'src' => ''), array('value' => 'vimeo', 'label' => 'Vimeo', 'src' => ''), array('value' => 'xing', 'label' => 'Xing', 'src' => ''), array('value' => 'yahoo', 'label' => 'Yahoo', 'src' => ''), array('value' => 'amazon', 'label' => 'Amazon', 'src' => ''), array('value' => 'steam', 'label' => 'Steam', 'src' => ''), array('value' => 'dropbox', 'label' => 'Dropbox', 'src' => ''), array('value' => 'github', 'label' => 'GitHub', 'src' => ''), array('value' => 'lastfm', 'label' => 'LastFM', 'src' => ''), array('value' => 'tumblr', 'label' => 'Tumblr', 'src' => ''), array('value' => 'wordpress', 'label' => 'WordPress', 'src' => ''), array('value' => 'linkedin-rect', 'label' => 'LinkedIn', 'src' => ''), array('value' => 'instagram', 'label' => 'Instagram', 'src' => ''))), array('label' => 'URL to profile page', 'id' => 'icons_url', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Enable breadcrumbs', 'id' => 'pp_breadcrumbs', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Flexslider slideshow speed (in milliseconds)', 'id' => 'pp_flex_slideshowspeed', 'type' => 'numeric-slider', 'min_max_step' => '1000,20000,500', 'desc' => 'This setting is global, it will affect all sliders. Be sure to put here only number!.', 'std' => '7000', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Flexslider animation speed (in milliseconds)', 'id' => 'pp_flex_animationspeed', 'type' => 'numeric-slider', 'min_max_step' => '100,2000,100', 'desc' => 'This setting is global, it will affect all sliders. Be sure to put here only number!.', 'std' => '600', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Flexslider animation type', 'id' => 'pp_flex_animationtype', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Fade', 'value' => 'fade'), array('label' => 'Slide', 'value' => 'slide')), 'std' => 'fade', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Enable AJAX loaded portfolio', 'id' => 'pp_ajax_pf', 'type' => 'select', 'desc' => 'Portfolio items are loaded on the same page instead of opening new page', 'choices' => array(array('label' => 'Disable', 'value' => 'no'), array('label' => 'Enable', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Recent items on single portfolio view', 'id' => 'pp_related_pf', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Show', 'value' => 'show'), array('label' => 'Hide', 'value' => 'hide')), 'std' => 'show', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Show recent items on single portfolio view only from the same category as the current item', 'id' => 'pp_samefilter_pf', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'All elements', 'value' => 'all'), array('label' => 'Only the same category (filter)', 'value' => 'same')), 'std' => 'show', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Recent Work text', 'id' => 'pp_recenttext_pf', 'type' => 'text', 'desc' => 'Title of recent work secion on single portfolio view', 'std' => 'Recent Work', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Shop sidebar side', 'id' => 'pp_woo_layout', 'type' => 'radio-image', 'desc' => 'Choose sidebar side on shop page.', 'std' => 'right-sidebar', 'rows' => '', 'post_type' => '', 'choices' => array(array('value' => 'left-sidebar', 'label' => 'Left Sidebar', 'src' => OT_URL . '/assets/images/layout/left-sidebar.png'), array('value' => 'right-sidebar', 'label' => 'Right Sidebar', 'src' => OT_URL . '/assets/images/layout/right-sidebar.png')), 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'WooCommerce number of items per page', 'id' => 'pp_wooitems', 'type' => 'select', 'desc' => 'Select how many products you want to display on shop page', 'std' => '9', 'rows' => '', 'choices' => array(array('label' => '3', 'value' => '3'), array('label' => '4', 'value' => '4'), array('label' => '5', 'value' => '5'), array('label' => '6', 'value' => '6'), array('label' => '7', 'value' => '7'), array('label' => '8', 'value' => '8'), array('label' => '9', 'value' => '9'), array('label' => '10', 'value' => '10'), array('label' => '11', 'value' => '11'), array('label' => '12', 'value' => '12'), array('label' => '13', 'value' => '13'), array('label' => '14', 'value' => '14'), array('label' => '15', 'value' => '15'), array('label' => '16', 'value' => '16'), array('label' => '20', 'value' => '20'), array('label' => '32', 'value' => '32'), array('label' => '40', 'value' => '40'), array('label' => '99', 'value' => '99')), 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'WooCommerce Catalog mode ', 'id' => 'pp_woo_catalog', 'type' => 'select', 'desc' => 'Removes all "add to cart" buttons to just showcase your products.', 'choices' => array(array('label' => 'Disable', 'value' => 'no'), array('label' => 'Enable', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'WooCommerce Mini Cart in header', 'id' => 'pp_woo_header_cart', 'type' => 'select', 'desc' => 'Removes all "add to cart" buttons to just showcase your products.', 'choices' => array(array('label' => 'Disable', 'value' => 'no'), array('label' => 'Enable', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'Enable slider on shop page', 'id' => 'pp_shop_slider_on', 'type' => 'select', 'desc' => 'Show slider on homepage', 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'Choose Revolution Slider for shop page', 'id' => 'pp_shop_revo_slider', 'type' => 'select', 'desc' => '', 'choices' => $layers, 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'Number of columns on shop page', 'id' => 'pp_woocolumns', 'type' => 'select', 'desc' => '', 'std' => '3', 'rows' => '', 'choices' => array(array('label' => '3', 'value' => '3'), array('label' => '4', 'value' => '4')), 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'woocommerce'), array('label' => 'Copyrights text', 'id' => 'pp_copyrights', 'type' => 'text', 'desc' => 'Text in footer', 'std' => '&copy; Theme by <a href="http://themeforest.net/user/purethemes/portfolio?ref=purethemes">Purethemes.net</a>. All Rights Reserved.', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Blog layout', 'id' => 'pp_blog_layout', 'type' => 'radio-image', 'desc' => 'Choose sidebar side on blog.', 'std' => 'right-sidebar', 'rows' => '', 'post_type' => '', 'choices' => array(array('value' => 'left-sidebar', 'label' => 'Left Sidebar', 'src' => OT_URL . '/assets/images/layout/left-sidebar.png'), array('value' => 'right-sidebar', 'label' => 'Right Sidebar', 'src' => OT_URL . '/assets/images/layout/right-sidebar.png')), 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Blog thumbs style', 'id' => 'pp_blog_thumbs', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Large', 'value' => 'large'), array('label' => 'Small', 'value' => 'small')), 'std' => 'large', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Post meta informations on single post view', 'id' => 'pp_meta_single', 'type' => 'checkbox', 'desc' => 'Set which elements of posts meta data you want to display.', 'choices' => array(array('label' => 'Author', 'value' => 'author'), array('label' => 'Date', 'value' => 'date'), array('label' => 'Tags', 'value' => 'tags'), array('label' => 'Categories', 'value' => 'cat'), array('label' => 'Comments', 'value' => 'com')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Post meta informations on blog and archive pages', 'id' => 'pp_meta_blog', 'type' => 'checkbox', 'desc' => 'Set which elements of posts meta data you want to display.', 'choices' => array(array('label' => 'Author', 'value' => 'author'), array('label' => 'Date', 'value' => 'date'), array('label' => 'Tags', 'value' => 'tags'), array('label' => 'Categories', 'value' => 'cat'), array('label' => 'Comments', 'value' => 'com')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Blog page title', 'id' => 'pp_blog_page', 'type' => 'text', 'desc' => '', 'std' => 'The Blog', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Portfolio columns layout', 'id' => 'pp_portfolio_layout', 'type' => 'select', 'desc' => 'Choose number of columns for portfolio archive page', 'choices' => array(array('label' => '3 columns', 'value' => '3'), array('label' => '4 columns', 'value' => '4')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio page title', 'id' => 'pp_portfolio_page', 'type' => 'text', 'desc' => '', 'std' => 'Portfolio', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'For "video portfolio" items show image thumbnail or video in archive and /portfolio page', 'id' => 'pp_portfolio_videothumb', 'type' => 'select', 'desc' => 'Choose if you want to display thumbnails as image or as small embeded video', 'choices' => array(array('label' => 'Video', 'value' => 'video'), array('label' => 'Image thumbnail', 'value' => 'thumb')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Number of items to display on portfolio page', 'id' => 'pp_portfolio_showpost', 'type' => 'select', 'desc' => 'Choose how many items to display on portfolio page', 'choices' => array(array('label' => '3', 'value' => '3'), array('label' => '4', 'value' => '4'), array('label' => '5', 'value' => '5'), array('label' => '6', 'value' => '6'), array('label' => '7', 'value' => '7'), array('label' => '8', 'value' => '8'), array('label' => '9', 'value' => '9'), array('label' => '10', 'value' => '10'), array('label' => '11', 'value' => '11'), array('label' => '12', 'value' => '12'), array('label' => '13', 'value' => '13'), array('label' => '14', 'value' => '14'), array('label' => '15', 'value' => '15'), array('label' => '16', 'value' => '16'), array('label' => '20', 'value' => '20'), array('label' => '32', 'value' => '32'), array('label' => '40', 'value' => '40'), array('label' => '99', 'value' => '99')), 'std' => '9', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('id' => 'sidebars_text', 'label' => 'About sidebars', 'desc' => 'All sidebars that you create here will appear both in the Appearance > Widgets, and then you can choose them for specific pages or posts.', 'std' => '', 'type' => 'textblock', 'section' => 'sidebars', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Create Sidebars', 'id' => 'incr_sidebars', 'type' => 'list-item', 'desc' => 'Choose a unique title for each sidebar', 'section' => 'sidebars', 'settings' => array(array('label' => 'ID', 'id' => 'id', 'type' => 'text', 'desc' => 'Write a lowercase single world as ID (it can\'t start with a number!), without any spaces', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''))), array('id' => 'pp_custom_css', 'label' => 'Custom CSS', 'desc' => 'To prevent problems with theme update, write here any custom css (or use child themes)', 'std' => '', 'type' => 'textarea-simple', 'section' => 'general_default', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Enable custom fonts', 'id' => 'pp_fonts_on', 'type' => 'select', 'desc' => 'Note that this is experimental feature, not all fonts might work properly.', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Body font', 'id' => 'pp_body_font', 'desc' => 'Choose font for body (We recommend Open Sans).', 'std' => 'Open+Sans', 'type' => 'select', 'section' => 'typo', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'choices' => $google_fonts), array('label' => 'Body font size', 'id' => 'pp_body_size', 'type' => 'measurement', 'desc' => 'Set font-size for texts', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Headings font', 'id' => 'pp_h_font', 'desc' => 'Choose font for headers h1-h6.', 'std' => '', 'type' => 'select', 'section' => 'typo', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'choices' => $google_fonts), array('label' => 'Enable custom typography for logo', 'id' => 'pp_logofonts_on', 'type' => 'select', 'desc' => 'Select "Yes" to enable custom typo', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Logo typography', 'id' => 'pp_logo_typo', 'type' => 'typography', 'desc' => 'If you are using text logo here you can set font options.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('id' => 'update_info', 'label' => 'About Update', 'desc' => 'Fill fields below to get notification about new version of theme. To get your API key go to ThemeForest - your profile -> Settings -> Api Keys and Generate API Key.', 'std' => '', 'type' => 'textblock', 'section' => 'update', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Your ThemeForest username', 'id' => 'pp_username', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'update'), array('label' => 'Your ThemeForest API key', 'id' => 'pp_api_key', 'type' => 'text', 'desc' => 'To get your API key go to ThemeForest - your profile -> Settings -> Api Keys and Generate API Key.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'update'), array('id' => 'twitter_info', 'label' => 'Twitter OAuth keys', 'desc' => 'From March 2013 Twitter requires authentication to access your tweets. Here are fields you need to fill if you want to use Nevia Twitter Widgets. How to do it you can find in documentation and on https://dev.twitter.com .', 'std' => '', 'type' => 'textblock', 'section' => 'twitter', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Twitter Consumer Key', 'id' => 'pp_twitter_ck', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Consumer Secret', 'id' => 'pp_twitter_cs', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Access Token', 'id' => 'pp_twitter_at', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Access Token Secret', 'id' => 'pp_twitter_ts', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter')));
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            foreach ($languages as $l) {
                $custom_settings['settings'][] = array('label' => 'Revolution Slider for homepage in ' . $l['native_name'] . ' language', 'id' => 'pp_revo_slider' . $l['language_code'], 'type' => 'select', 'desc' => '', 'choices' => $layers, 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider');
            }
        }
    }
    /* settings are not the same update the DB */
    if ($saved_settings !== $custom_settings) {
        update_option('option_tree_settings', $custom_settings);
    }
}
 function so_language_menu()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('orderby=name&order=ASC');
         // you can change the parameters
         $counter = 0;
         if (!empty($languages)) {
             echo '<ul class="lang-nav">';
             foreach ($languages as $l) {
                 $counter += 1;
                 if ($l['active']) {
                     continue;
                 }
                 echo '<li id="' . $l['language_code'] . '">';
                 echo '<a href="' . $l['url'] . '">';
                 if ($l['language_code'] == 'en') {
                     echo 'EN';
                 } elseif ($l['language_code'] == 'zh-hans') {
                     echo urldecode('%E4%B8%AD%E6%96%87');
                 }
                 // Change this into any other language
                 echo '</a>';
                 if ($counter < sizeof($languages)) {
                     echo '&nbsp;|&nbsp;';
                 }
                 // optional line as a separator between languages
                 echo '</li>';
             }
             echo '</ul>';
         }
     }
 }
function wpml_languages_list($skip_missing = 0, $div_id = "footer_language_list")
{
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=' . intval($skip_missing));
        if (!empty($languages)) {
            echo '<div id="' . $div_id . '"><ul>';
            foreach ($languages as $l) {
                echo '<li>';
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['language_code'] . '" />';
                if (!$l['active']) {
                    echo '</a>';
                }
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo $l['native_name'];
                if (!$l['active']) {
                    echo ' (' . $l['translated_name'] . ')';
                }
                if (!$l['active']) {
                    echo '</a>';
                }
                echo '</li>';
            }
            echo '</ul></div>';
        }
    }
}
Пример #9
0
    function gdlr_get_wpml_nav()
    {
        if (function_exists('icl_get_languages')) {
            ?>
<li class="gdlr-mega-menu">
	<a href="#"><i class="icon-globe"></i><?php 
            echo ICL_LANGUAGE_NAME;
            ?>
</a>
	<div class="sf-mega">
		<div class="sf-mega-section gdlr-wpml-language-selector">
		<?php 
            $languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
            foreach ($languages as $language) {
                echo '<div class="sub-menu-item">';
                echo '<img src="' . $language['country_flag_url'] . '" alt="" />';
                echo '<a href="' . $language['url'] . '" >' . $language['translated_name'] . '</a>';
                echo '</div>';
            }
            ?>
		</div>
	</div>
</li>
<?php 
        }
    }
Пример #10
0
function display_language_menu_accordion()
{
    $menu = "";
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    if (!empty($languages)) {
        $menu .= '<div class="ui inverted accordion">';
        $menu .= '<div class="active title">';
        $menu .= '<i class="dropdown icon"></i>';
        $menu .= __('Languages', 'sage');
        $menu .= '<i class="translate icon"></i>';
        $menu .= '</div>';
        $menu .= '<div class="active content">';
        foreach ($languages as $l) {
            if (!$l['active']) {
                $menu .= "<a class=\"item\" href=\"" . $l['url'] . "\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            } else {
                $menu .= "<a class=\"item\" href=\"#\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            }
        }
        $menu .= "</div>";
        $menu .= "</div>";
    }
    echo $menu;
}
Пример #11
0
function pm_ln_icl_post_languages_mobile()
{
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=1');
        if (1 < count($languages)) {
            echo '<div class="pm-micro-nav-lang-selector mobile">';
            echo '<div class="pm-dropdown pm-language-selector-menu">';
            echo '<div class="pm-dropmenu">';
            echo '<p class="pm-menu-title">' . __('Language', 'viennatheme') . '</p>';
            echo '<i class="fa fa-angle-down"></i>';
            echo '</div>';
            echo '<div class="pm-dropmenu-active">';
            echo '<ul>';
            foreach ($languages as $l) {
                if (!$l['active']) {
                    echo '<li><a href="' . $l['url'] . '">' . $l['translated_name'] . '</a></li>';
                }
            }
            echo '</ul>';
            echo '</div>';
            echo '</div>';
            echo '</div>';
            //echo join(', ', $langs);
        }
    }
    //end of check function
}
    public function add_htaccess_redirects($rules)
    {
        if (Load_Me_Quickly::get_option('plugin_activated') == 1) {
            $new_rules = '';
            //Check if WPML is installed and activated
            if (function_exists('icl_object_id')) {
                global $sitepress;
                $languages = icl_get_languages('skip_missing=1');
                foreach ($languages as $l) {
                    $sitepress->switch_lang($l['code'], true);
                    $new_rules .= self::add_htaccess_redirects_loop(true);
                }
            } else {
                $new_rules .= self::add_htaccess_redirects_loop(false);
            }
            if ($new_rules != '') {
                $rules = '

# Load Me Quickly
<IfModule mod_rewrite.c>
RewriteEngine on' . $new_rules . '
</IfModule>
# /Load Me Quickly

' . $rules;
            }
        }
        return $rules;
    }
Пример #13
0
 function languages_list_header()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=0&orderby=code');
         if (!empty($languages)) {
             echo '<div class="language"><ul>';
             echo '<li>' . __('Language: ', 'sptheme') . '</li>';
             foreach ($languages as $l) {
                 echo '<li class="' . $l['language_code'] . '">';
                 if (!$l['active']) {
                     echo '<a href="' . $l['url'] . '" title="' . $l['native_name'] . '">';
                 }
                 echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['native_name'] . '" />';
                 if (!$l['active']) {
                     echo '</a>';
                 }
                 echo '</li>';
             }
             echo '</ul></div>';
         }
     } else {
         return null;
         // Activate WMPL plugin
     }
 }
Пример #14
0
    /**
     * Widget dropdown.
     *
     * Add a dropdown to every widget.
     */
    public function ww_widget_dropdown($widget, $form, $instance)
    {
        $languages = icl_get_languages();
        ?>
<p><label for='wpml_language'><?php 
        _e('Display on language:', 'wpml-widgets');
        ?>
 </label>
		<select id='wpml_language' name='wpml_language'><?php 
        foreach ($languages as $language) {
            $selected = $language['language_code'] == $instance['wpml_language'] ? 'SELECTED' : null;
            ?>
<option <?php 
            echo $selected;
            ?>
 value='<?php 
            echo $language['language_code'];
            ?>
'><?php 
            echo $language['native_name'];
            ?>
</option><?php 
        }
        $selected = 'all' == $instance['wpml_language'] || !isset($instance['wpml_language']) ? 'SELECTED' : null;
        ?>
			<option <?php 
        echo $selected;
        ?>
 value='all'><?php 
        _e('All Languages', 'wpml-widgets');
        ?>
</option>
		</select></p>
		<?php 
    }
Пример #15
0
 /**
  * WPML
  *
  * @since   1.0.0
  */
 function language_switcher()
 {
     $languages = icl_get_languages('skip_missing=0&orderby=id');
     if (is_array($languages) && !empty($languages)) {
         $html = '<div class="wpml-language-switcher">';
         foreach ($languages as $lang) {
             if ($lang['active']) {
                 $html .= '<div class="actived-language">';
                 $html .= '<a href="' . $lang['url'] . '">';
                 $html .= '<span class="language-flag"><img title="' . $lang['native_name'] . '" src="' . $lang['country_flag_url'] . '" /></span>';
                 //$html .= '<span class="language-native">'.$lang['native_name'].'</span>';
                 $html .= '<span class="language-translated">' . $lang['translated_name'] . '</span>';
                 $html .= '</a>';
                 $html .= '</div>';
             }
         }
         $html .= '<ul class="wpml-language-list">';
         foreach ($languages as $lang) {
             if (!$lang['active']) {
                 $html .= '<li class="language-' . $lang['language_code'] . '">';
                 $html .= '<a href="' . $lang['url'] . '">';
                 $html .= '<span class="language-flag"><img title="' . $lang['native_name'] . '" src="' . $lang['country_flag_url'] . '" /></span>';
                 //$html .= '<span class="language-native">'.$lang['native_name'].'</span>';
                 $html .= '<span class="language-translated">' . $lang['translated_name'] . '</span>';
                 $html .= '</a>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
         $html .= '</div>';
         return $html;
     }
 }
Пример #16
0
 function wpsp_languageswitcherer()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=1');
         if (1 < count($languages)) {
             echo '<nav class="language col-sm-4"><ul>';
             //echo '<li>' . __('Language: ', 'sptheme') . '</li>';
             foreach ($languages as $l) {
                 echo '<li class="' . $l['language_code'] . '">';
                 if (!$l['active']) {
                     echo '<a href="' . $l['url'] . '" title="' . $l['native_name'] . '">';
                 }
                 echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['native_name'] . '" />';
                 if (!$l['active']) {
                     echo '</a>';
                 }
                 echo '</li>';
             }
             echo '</ul></nav>';
         }
     } else {
         return null;
         // Activate WMPL plugin
     }
 }
function mbdmaster_languages_list()
{
    if (function_exists(icl_get_languages)) {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            echo '<div id="language-selector"><ul>';
            foreach ($languages as $l) {
                if (!$l['active']) {
                    echo '<li class="active">';
                } else {
                    echo '<li class="inactive">';
                }
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo icl_disp_language($l['native_name'], $l['translated_name']);
                if (!$l['active']) {
                    echo '</a>';
                }
                echo '</li>';
            }
            echo '</ul></div>';
        }
    }
}
Пример #18
0
function jobman_flush_rewrite_rules()
{
    global $wp_rewrite;
    $wp_rewrite->feeds[] = 'jobman';
    $options = get_option('jobman_options');
    $root = get_page($options['main_page']);
    $url = get_page_uri($root->ID);
    if (!$url) {
        return;
    }
    $lang = '';
    // Hack to support WPML languages in the nice URL
    if (defined('ICL_SITEPRESS_VERSION') && function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=0');
        if (!empty($languages)) {
            $lang_arr = array();
            foreach ($languages as $language) {
                $lang_arr[] = $language['language_code'];
            }
            $lang = '(' . implode('|', $lang_arr) . ')/';
        }
    }
    if (empty($lang)) {
        $new_rules = array("{$url}/?([page]*/(\\d+)/?)?\$" => "index.php?jobman_root_id={$root->ID}" . '&page=$matches[2]', "{$url}/apply(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&jobman_page=apply&jobman_data=$matches[2]', "{$url}/register(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&jobman_page=register&jobman_data=$matches[2]', "{$url}/feed/?\$" => "index.php?feed=jobman", "{$url}/([^/]+)/?(page/(\\d+)/?)?\$" => 'index.php?jobman_data=$matches[1]' . '&page=$matches[3]');
    } else {
        $new_rules = array("({$lang})?{$url}/?([page]*/(\\d+)/?)?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&page=$matches[3]', "({$lang})?{$url}/apply(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&jobman_page=apply&jobman_data=$matches[3]', "({$lang})?{$url}/register(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&jobman_page=register&jobman_data=$matches[3]', "({$lang})?{$url}/feed/?\$" => 'index.php?feed=jobman&lang=$matches[1]', "({$lang})?{$url}/([^/]+)/?(page/(\\d+)/?)?\$" => 'index.php?jobman_data=$matches[1]' . '&lang=$matches[2]' . '&page=$matches[4]');
    }
    if (array_key_exists('rewrite_rules', $options) && $options['rewrite_rules'] == $new_rules) {
        return;
    }
    $options['rewrite_rules'] = $new_rules;
    update_option('jobman_options', $options);
    $wp_rewrite->flush_rules(false);
}
Пример #19
0
/**
 * Theme Mode demo code of all the available option types.
 *
 * @return    void
 *
 * @access    private
 * @since     2.0
 */
function _custom_theme_options()
{
    global $layers;
    /**
     * Get a copy of the saved settings array.
     */
    $saved_settings = get_option('option_tree_settings', array());
    /**
     * Create a custom settings array that we pass to
     * the OptionTree Settings API Class.
     */
    $custom_settings = array('contextual_help' => array('content' => array(array('id' => 'general_help', 'title' => 'General', 'content' => '<p>Help content goes here!</p>')), 'sidebar' => '<p>Sidebar content goes here!</p>'), 'sections' => array(array('title' => 'Slider', 'id' => 'slider'), array('title' => 'General', 'id' => 'general_default'), array('title' => 'General II', 'id' => 'general2_default'), array('title' => 'Blog options', 'id' => 'blog'), array('title' => 'Portfolio options', 'id' => 'portfolio'), array('id' => 'typo', 'title' => 'Typography'), array('id' => 'sidebars', 'title' => 'Sidebars'), array('id' => 'twitter', 'title' => 'Twitter oAuth')), 'settings' => array(array('label' => 'Enable slider', 'id' => 'slider_on', 'type' => 'select', 'desc' => 'Show slider on homepage', 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider'), array('label' => 'Select slider for homepage', 'id' => 'incr_slider_home', 'type' => 'select', 'desc' => 'Select slider for homepage', 'choices' => array(array('label' => 'Flexslider', 'value' => 'flex'), array('label' => 'Revolution Slider', 'value' => 'revolution')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider', 'condition' => 'slider_on:is(yes)'), array('label' => 'Alias of Revolution Slider for homepage', 'id' => 'incr_revo_slider', 'type' => 'select', 'desc' => '', 'choices' => $layers, 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider', 'condition' => 'incr_slider_home:is(revolution),slider_on:is(yes)'), array('id' => 'slider_text', 'label' => 'About Slider', 'desc' => 'Below you can create slides for Flexslider.', 'std' => '', 'type' => 'textblock', 'section' => 'slider', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'incr_slider_home:is(flex),slider_on:is(yes)'), array('label' => 'Homepage Flexslider', 'id' => 'mainslider', 'type' => 'list-item', 'desc' => 'Add slides for homepage slider.', 'settings' => array(array('label' => 'Content of slide', 'id' => 'slider_description', 'type' => 'textarea', 'desc' => 'You can use shortcodes here.', 'std' => '', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Empty slide?', 'id' => 'slider_empty', 'type' => 'select', 'desc' => 'Show just image', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Upload Image', 'id' => 'slider_image_upload', 'type' => 'upload', 'desc' => 'Upload image for slide', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider', 'condition' => 'incr_slider_home:is(flex),slider_on:is(yes)'), array('label' => 'Upload logo', 'id' => 'logo_upload', 'type' => 'upload', 'desc' => 'For best effect logo image should be transparent png, logo from live preview has 114x24px but you can use bigger, you will probably need to adjust some margins using options below ', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Logo area width', 'id' => 'logo_area_width', 'type' => 'select', 'desc' => 'Full width of top area is 16 columns. Logo area by default is 9 columns, while icons and contact details area is 6 columns wide. If you want to have bigger logo, please change here number of columns for logo. ', 'choices' => array(array('label' => '1 column', 'value' => '1'), array('label' => '2 columns', 'value' => '2'), array('label' => '3 columns', 'value' => '3'), array('label' => '4 columns', 'value' => '4'), array('label' => '5 columns', 'value' => '5'), array('label' => '6 columns', 'value' => '6'), array('label' => '7 columns', 'value' => '7'), array('label' => '8 columns', 'value' => '8'), array('label' => '9 columns', 'value' => '9'), array('label' => '10 columns', 'value' => '10'), array('label' => '11 columns', 'value' => '11'), array('label' => '12 columns', 'value' => '12'), array('label' => '16 columns (full width)', 'value' => '16')), 'std' => '8', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Logo top margin', 'id' => 'logo_top_margin', 'type' => 'measurement', 'desc' => 'Set top margin for logo image', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Logo bottom margin', 'id' => 'logo_bottom_margin', 'type' => 'measurement', 'desc' => 'Set bottom margin for logo image', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Favicon ', 'id' => 'incr_favicon_upload', 'type' => 'upload', 'desc' => 'Upload favicon here (16x16)', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Tagline top margin', 'id' => 'tagline_margin', 'type' => 'measurement', 'desc' => 'Set top margin for tagline to position it correctly (Tagline is set in Settings -> General -> Tagline).', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Header social icons', 'id' => 'headericons', 'type' => 'list-item', 'desc' => 'Manage socials icons on header.', 'settings' => array(array('id' => 'icons_service', 'label' => 'Choose service', 'desc' => '', 'std' => '', 'type' => 'select', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'choices' => array(array('value' => 'amazon', 'label' => 'Amazon', 'src' => ''), array('value' => 'behance', 'label' => 'Behance', 'src' => ''), array('value' => 'blogger', 'label' => 'Blogger', 'src' => ''), array('value' => 'deviantart', 'label' => 'DeviantArt', 'src' => ''), array('value' => 'dribbble', 'label' => 'Dribbble', 'src' => ''), array('value' => 'dropbox', 'label' => 'Dropbox', 'src' => ''), array('value' => 'evernote', 'label' => 'Evernote', 'src' => ''), array('value' => 'facebook', 'label' => 'Facebook', 'src' => ''), array('value' => 'forrst', 'label' => 'Forrst', 'src' => ''), array('value' => 'github', 'label' => 'Github', 'src' => ''), array('value' => 'googleplus', 'label' => 'Google+', 'src' => ''), array('value' => 'jolicloud', 'label' => 'JoliCloud', 'src' => ''), array('value' => 'last-fm', 'label' => 'LastFM', 'src' => ''), array('value' => 'linkedin', 'label' => 'LinkedIN', 'src' => ''), array('value' => 'picasa', 'label' => 'Picasa', 'src' => ''), array('value' => 'pintrest', 'label' => 'Pinterest', 'src' => ''), array('value' => 'rss', 'label' => 'RSS', 'src' => ''), array('value' => 'skype', 'label' => 'Skype', 'src' => ''), array('value' => 'spotify', 'label' => 'Spotify', 'src' => ''), array('value' => 'stumbleupon', 'label' => 'StumbleUpon', 'src' => ''), array('value' => 'tumblr', 'label' => 'Tumblr', 'src' => ''), array('value' => 'twitter', 'label' => 'Twitter', 'src' => ''), array('value' => 'vimeo', 'label' => 'Vimeo', 'src' => ''), array('value' => 'wordpress', 'label' => 'WordPress', 'src' => ''), array('value' => 'xing', 'label' => 'Xing', 'src' => ''), array('value' => 'yahoo', 'label' => 'Yahoo', 'src' => ''), array('value' => 'youtube', 'label' => 'YouTube', 'src' => ''))), array('label' => 'URL to profile page', 'id' => 'icons_url', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Search form in menu', 'id' => 'centum_search', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Enable', 'value' => 'enable'), array('label' => 'Disable', 'value' => 'disable')), 'std' => 'disable', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_default'), array('label' => 'Enable breadcrumbs', 'id' => 'centum_breadcrumbs', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Enable WPML language switcher in header', 'id' => 'centum_wpml_switcher', 'type' => 'select', 'desc' => 'Be sure to have installed <a href="http://wpml.org/?aid=27926&affiliate_key=LikrvB9gJOkU">WPML</a> plugin', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Enable contact details in header', 'id' => 'centum_contact_details', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Header minimum height', 'id' => 'centum_minhh', 'type' => 'text', 'desc' => '', 'std' => '100', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Contact details email', 'id' => 'centum_cdetails_email', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Contact details phone', 'id' => 'centum_cdetails_phone', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Disable comments on pages', 'id' => 'centum_page_comments', 'type' => 'on_off', 'desc' => '', 'std' => 'off', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Copyrights text', 'id' => 'copyrights', 'type' => 'text', 'desc' => 'Text in footer', 'std' => '&copy; Copyright 2012 by <a href="http://themeforest.net/user/purethemes/portfolio?ref=purethemes">Purethemes.net</a>. All Rights Reserved.', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general2_default'), array('label' => 'Blog layout', 'id' => 'blog_layout', 'type' => 'radio-image', 'desc' => 'Choose sidebar side on blog.', 'std' => 'right-sidebar', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'choices' => array(array('value' => 'left-sidebar', 'label' => 'Left Sidebar', 'src' => OT_URL . '/assets/images/layout/left-sidebar.png'), array('value' => 'right-sidebar', 'label' => 'Right Sidebar', 'src' => OT_URL . '/assets/images/layout/right-sidebar.png')), 'class' => '', 'section' => 'blog'), array('label' => 'Blog posts icons', 'id' => 'centum_blog_icons', 'type' => 'select', 'desc' => 'Enable/disable "post types" icons', 'choices' => array(array('label' => 'Enable', 'value' => 'enable'), array('label' => 'Disable', 'value' => 'disable')), 'std' => 'enable', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('label' => 'Blog page title', 'id' => 'incr_blog_page', 'type' => 'text', 'desc' => '', 'std' => 'The Blog', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'blog'), array('id' => 'flext_comments', 'label' => 'Disable comments for all posts', 'desc' => '', 'std' => 'no', 'section' => 'blog', 'type' => 'select', 'desc' => 'Enable/disable "post types" icons', 'choices' => array(array('label' => 'No', 'value' => 'no'), array('label' => 'Yes', 'value' => 'yes'))), array('label' => 'Portfolio columns layout', 'id' => 'portfolio_layout', 'type' => 'select', 'desc' => 'Choose number of columns for portfolio archive page', 'choices' => array(array('label' => '2 columns', 'value' => '2'), array('label' => '3 columns', 'value' => '3'), array('label' => '4 columns', 'value' => '4')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio page title', 'id' => 'incr_portfolio_page', 'type' => 'text', 'desc' => '', 'std' => 'Portfolio', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio thumbnail behaviour', 'id' => 'portfolio_thumb', 'type' => 'select', 'desc' => 'Choose if you want to display thumbnails in portfolio as a link or in a lightbox', 'choices' => array(array('label' => 'Link', 'value' => 'link'), array('label' => 'Lightbox', 'value' => 'lightbox')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'For "video portfolio" items show image thumbnail or video in archive and /portfolio page', 'id' => 'portfolio_videothumb', 'type' => 'select', 'desc' => 'Choose if you want to display thumbnails as image or as small embeded video', 'choices' => array(array('label' => 'Video', 'value' => 'video'), array('label' => 'Image thumbnail', 'value' => 'thumb')), 'std' => '3', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio number of items to display', 'id' => 'portfolio_showpost', 'type' => 'select', 'desc' => 'Choose how many items to display on portfolio page', 'choices' => array(array('label' => '3', 'value' => '3'), array('label' => '4', 'value' => '4'), array('label' => '5', 'value' => '5'), array('label' => '6', 'value' => '6'), array('label' => '7', 'value' => '7'), array('label' => '8', 'value' => '8'), array('label' => '9', 'value' => '9'), array('label' => '10', 'value' => '10'), array('label' => '11', 'value' => '11'), array('label' => '12', 'value' => '12'), array('label' => '13', 'value' => '13'), array('label' => '14', 'value' => '14'), array('label' => '15', 'value' => '15'), array('label' => '16', 'value' => '16'), array('label' => '32', 'value' => '32'), array('label' => '48', 'value' => '48'), array('label' => '99', 'value' => '99')), 'std' => '9', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio text control', 'id' => 'centum_portfolio_text', 'type' => 'select', 'desc' => 'Choose "excerpt" to show content filled in excerpt field in portfolio item editor, or choose "limit words" to show only few
                    words from the content of portfolio item (the number of words can be changed in source code. More info on <a href="http://www.docs.purethemes.net/centum/">documentation</a>', 'choices' => array(array('label' => 'Limit words', 'value' => 'limit'), array('label' => 'Excerpt', 'value' => 'excerpt')), 'std' => 'limit', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('label' => 'Portfolio meta informations', 'id' => 'centum_pf_meta', 'type' => 'list-item', 'desc' => 'Manage meta information below portfolio.', 'settings' => array(array('label' => 'Type of field', 'id' => 'type', 'type' => 'select', 'desc' => '', 'choices' => array(array('label' => 'Text', 'value' => 'text'), array('label' => 'Filters', 'value' => 'filters'), array('label' => 'Date of publication', 'value' => 'dateofp'), array('label' => 'Link to project (as a button)', 'value' => 'link')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'portfolio'), array('id' => 'sidebars_text', 'label' => 'About sidebars', 'desc' => 'All sidebars that you create here will appear both in the Appearance > Widgets, and then you can choose them for specific pages or posts.', 'std' => '', 'type' => 'textblock', 'section' => 'sidebars', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Create Sidebars', 'id' => 'incr_sidebars', 'type' => 'list-item', 'desc' => 'Choose a unique title for each sidebar', 'section' => 'sidebars', 'settings' => array(array('label' => 'ID', 'id' => 'id', 'type' => 'text', 'desc' => 'Write a lowercase single world as ID (or number), without any spaces', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''))), array('id' => 'incr_custom_css', 'label' => 'Custom CSS', 'desc' => 'To prevent problems with theme update, write here any custom css (or use child themes)', 'std' => '', 'type' => 'textarea-simple', 'section' => 'general2_default', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Fonts stack', 'id' => 'phantom_font', 'type' => 'googlefonts', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('id' => 'fonts_info', 'label' => 'Fonts stack info', 'desc' => 'You need to Save Changes after adding new fonts to your Google Fonts Stack to be able to select them in the typography fields below', 'std' => '', 'type' => 'textblock', 'section' => 'typo', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Body Font', 'id' => 'centum_body_font', 'type' => 'typography', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Menu Font', 'id' => 'centum_menu_font', 'type' => 'typography', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Logo Font', 'id' => 'centum_logo_font', 'type' => 'typography', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('label' => 'Headers (h1..h6) Font', 'id' => 'centum_headers_font', 'type' => 'typography', 'desc' => 'Size and related to it settings will be ignored here.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typo'), array('id' => 'twitter_info', 'label' => 'Twitter OAuth keys', 'desc' => 'From March 2013 Twitter requires authentication to access your tweets. Here are fields you need to fill if you want to use Nevia Twitter Widgets. How to do it you can find in documentation and on https://dev.twitter.com .', 'std' => '', 'type' => 'textblock', 'section' => 'twitter', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Twitter Consumer Key', 'id' => 'pp_twitter_ck', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Consumer Secret', 'id' => 'pp_twitter_cs', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Access Token', 'id' => 'pp_twitter_at', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter'), array('label' => 'Twitter Access Token Secret', 'id' => 'pp_twitter_ts', 'type' => 'text', 'desc' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'twitter')));
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if (!empty($languages)) {
            foreach ($languages as $l) {
                $custom_settings['settings'][] = array('label' => 'Alias of Revolution Slider for homepage with ' . $l['native_name'] . ' language', 'id' => 'incr_revo_slider' . $l['language_code'], 'type' => 'text', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'slider');
            }
        }
    }
    /*echo '<pre>';
    print_r( $custom_settings['settings']);
    echo '</pre>';*/
    /* settings are not the same update the DB */
    if ($saved_settings !== $custom_settings) {
        update_option('option_tree_settings', $custom_settings);
    }
}
Пример #20
0
	function woo_ce_tags_filter_by_language() {

		if( !woo_ce_is_wpml_activated() )
			return;

		$languages = ( function_exists( 'icl_get_languages' ) ? icl_get_languages( 'skip_missing=N' ) : array() );

		ob_start(); ?>
<p><label><input type="checkbox" id="tags-filters-language" /> <?php _e( 'Filter Tags by Language', 'woo_ce' ); ?></label></p>
<div id="export-tags-filters-language" class="separator">
	<ul>
		<li>
<?php if( !empty( $languages ) ) { ?>
			<select data-placeholder="<?php _e( 'Choose a Language...', 'woo_ce' ); ?>" name="tag_filter_language[]" multiple class="chzn-select" style="width:95%;">
	<?php foreach( $languages as $key => $language ) { ?>
				<option value="<?php echo $key; ?>"><?php echo $language['native_name']; ?> (<?php echo $language['translated_name']; ?>)</option>
	<?php } ?>
			</select>
<?php } else { ?>
			<?php _e( 'No Languages were found.', 'woo_ce' ); ?></li>
<?php } ?>
		</li>
	</ul>
	<p class="description"><?php _e( 'Select the Language\'s you want to filter exported Tags by. Default is to include all Language\'s.', 'woo_ce' ); ?></p>
</div>
<!-- #export-tags-filters-language -->

<?php
		ob_end_flush();

	}
Пример #21
0
function autorent_wpml_languages()
{
    global $autorent_option_data;
    $languages = icl_get_languages('skip_missing=0');
    $wpml_select = $autorent_option_data['autorent-wpml-select'];
    echo '<div class="header-language">';
    if ($wpml_select === 'name') {
        foreach ($languages as $language) {
            if ($language['active']) {
                echo '<a class="header-btn" href="' . $language['url'] . '">';
                echo '<span>' . $language['translated_name'] . '</span>';
                echo '<i class="fa fa-angle-down"></i>';
                echo '</a>';
            }
        }
        echo '<ul class="custom-list">';
        foreach ($languages as $language) {
            if (!$language['active']) {
                echo '<li><a href="' . $language['url'] . '">' . $language['translated_name'] . '</a></li>';
            }
        }
        echo '</ul>';
    } elseif ($wpml_select === 'code') {
        foreach ($languages as $language) {
            if ($language['active']) {
                echo '<a class="header-btn" href="' . $language['url'] . '">';
                echo '<span>' . $language['language_code'] . '</span>';
                echo '<i class="fa fa-angle-down"></i>';
                echo '</a>';
            }
        }
        echo '<ul class="custom-list">';
        foreach ($languages as $language) {
            if (!$language['active']) {
                echo '<li><a href="' . $language['url'] . '">' . $language['language_code'] . '</a></li>';
            }
        }
        echo '</ul>';
    } else {
        foreach ($languages as $language) {
            if ($language['active']) {
                echo '<a class="header-btn" href="' . $language['url'] . '">';
                echo '<span><img src="' . $language['country_flag_url'] . '"></span>';
                echo '<i class="fa fa-angle-down"></i>';
                echo '</a>';
            }
        }
        echo '<ul class="custom-list">';
        foreach ($languages as $language) {
            if (!$language['active']) {
                echo '<li><a href="' . $language['url'] . '"><img src="' . $language['country_flag_url'] . '"></a></li>';
            }
        }
        echo '</ul>';
    }
    echo '</div>';
}
 /**
  * Search all Grids and change the term IDs set in the selected terms if needed
  * @since: 2.1.0
  **/
 static function split_terms_fix($old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy)
 {
     $base = new Essential_Grid_Base();
     $lang = array();
     if (Essential_Grid_Wpml::is_wpml_exists()) {
         $lang = icl_get_languages();
     }
     $grids = Essential_Grid::get_essential_grids();
     if (!empty($grids)) {
         foreach ($grids as $grid) {
             $selected = json_decode($grid->postparams, true);
             $post_category = $base->getVar($selected, 'post_category');
             $cat_tax = $base->getCatAndTaxData($post_category);
             $cats = array();
             if (!empty($cat_tax['cats'])) {
                 $cats = explode(',', $cat_tax['cats']);
             }
             $taxes = array('post_tag');
             if (!empty($cat_tax['tax'])) {
                 $taxes = explode(',', $cat_tax['tax']);
             }
             $cont = false;
             if (!empty($cats)) {
                 foreach ($cats as $cat) {
                     if ($old_term_id == $cat && in_array($taxonomy, $taxes)) {
                         //ID needs to be changed
                         foreach ($taxes as $t) {
                             //replace all occuring old term id with the new term id and then Save the Grid
                             $post_category = str_replace($t . '_' . $old_term_id, $t . '_' . $new_term_id, $post_category);
                         }
                         $selected['post_category'] = $post_category;
                         $grid->postparams = $selected;
                         $grid->params = json_decode($grid->params, true);
                         $grid->layers = json_decode($grid->layers, true);
                         $new_grid = (array) $grid;
                         //cast to array as update_create_grid expects an array
                         Essential_Grid_Admin::update_create_grid($new_grid);
                         //now delete cache of the Grid so that changes take effect immediately
                         if (!empty($lang)) {
                             foreach ($lang as $code => $val) {
                                 delete_transient('ess_grid_trans_query_' . $grid->id . $val['language_code']);
                                 delete_transient('ess_grid_trans_full_grid_' . $grid->id . $val['language_code']);
                             }
                         } else {
                             delete_transient('ess_grid_trans_query_' . $grid->id);
                             delete_transient('ess_grid_trans_full_grid_' . $grid->id);
                         }
                         $cont = true;
                     }
                     if ($cont == true) {
                         break;
                     }
                 }
             }
         }
     }
 }
Пример #23
0
 function ebor_language_selector_flags()
 {
     $languages = icl_get_languages('skip_missing=0&orderby=code');
     if (!empty($languages)) {
         foreach ($languages as $l) {
             echo '<a href="' . $l['url'] . '" class="language"><img src="' . $l['country_flag_url'] . '" height="12" alt="' . $l['language_code'] . '" width="18" /></a>';
         }
     }
 }
Пример #24
0
        function widget($args, $instance)
        {
            // add custom class contact box
            extract($args);
            if (strpos($before_widget, 'class') === false) {
                $before_widget = str_replace('>', 'class="' . 'contact-box' . '"', $before_widget);
            } else {
                $before_widget = str_replace('class="', 'class="' . 'contact-box' . ' ', $before_widget);
            }
            global $ct_options;
            echo wp_kses_post($before_widget);
            if (!empty($instance['title'])) {
                echo wp_kses_post($before_title . apply_filters('widget_title', $instance['title']) . $after_title);
            }
            ?>

		<?php 
            if (ct_get_lang_count() > 1) {
                ?>

			<div class="styled-select">
			<select class="form-control cl-switcher" name="lang" id="lang">
				<?php 
                $languages = icl_get_languages('skip_missing=1');
                foreach ($languages as $l) {
                    $selected = $l['active'] ? 'selected' : '';
                    echo '<option ' . $selected . ' data-url="' . esc_url($l['url']) . '">' . esc_html($l['translated_name']) . '</option>';
                }
                ?>
			</select>
			</div>

		<?php 
            }
            ?>

		<?php 
            if (ct_is_multi_currency()) {
                ?>
			<div class="styled-select">
			<select class="form-control cl-switcher" name="currency" id="currency">
				<?php 
                $all_currencies = ct_get_all_available_currencies();
                foreach (array_filter($ct_options['site_currencies']) as $key => $content) {
                    $selected = ct_get_user_currency() == $key ? 'selected' : '';
                    $params = $_GET;
                    $params['selected_currency'] = $key;
                    $paramString = http_build_query($params, '', '&amp;');
                    echo '<option ' . $selected . ' data-url="' . esc_url(strtok($_SERVER['REQUEST_URI'], '?') . '?' . $paramString) . '">' . esc_html(strtoupper($key)) . '</option>';
                }
                ?>
			</select>
			</div>
		<?php 
            }
            echo wp_kses_post($after_widget);
        }
Пример #25
0
 function icl_post_languages()
 {
     $languages = icl_get_languages('skip_missing=0');
     foreach ($languages as $l) {
         if (!$l['active']) {
             $langs[] = '<a href="' . $l['url'] . '">' . $l['native_name'] . '</a>';
         }
     }
     echo join(', ', $langs);
 }
Пример #26
0
 function gdlr_get_wpml_nav()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
         $count = 0;
         foreach ($languages as $language) {
             echo empty($count) ? '' : '<span class="sep">|</span>';
             echo '<a href="' . $language['url'] . '" >' . $language['translated_name'] . '</a>';
             $count++;
         }
     }
 }
Пример #27
0
function wpml_wp_rest_api_init($server)
{
    global $sitepress;
    $default = $sitepress->get_default_language();
    $langs = array_keys(icl_get_languages('skip_missing=0&orderby=KEY&order=DIR&link_empty_to=str'));
    //Get all available langauges (only the keys, en,ja,fr, etc).
    $cur_lang = isset($_GET['lang']) ? $_GET['lang'] : $default;
    if (!in_array($cur_lang, $langs)) {
        $cur_lang = $default;
    }
    $sitepress->switch_lang($cur_lang);
}
Пример #28
0
 /**
  * Get languages
  *
  * @since  1.0
  * @param  array $args
  * @return array 
  */
 protected function _get_content($args = array())
 {
     $langs = array();
     if (function_exists('icl_get_languages')) {
         foreach (icl_get_languages('skip_missing=N') as $lng) {
             $langs[$lng['language_code']] = $lng['native_name'];
         }
     }
     if (isset($args['include'])) {
         $langs = array_intersect_key($langs, array_flip($args['include']));
     }
     return $langs;
 }
Пример #29
0
function language_selector_flags()
{
    $languages = icl_get_languages('skip_missing=1&orderby=custom');
    if (!empty($languages)) {
        foreach ($languages as $l) {
            if ($l['active']) {
                echo '<li><a href="' . $l['url'] . '"><img src="<?php bloginfo(\'template_directory\'); ?>/css/img/drapeau/' . $l['language_code'] . '.png" alt="' . $l['language_code'] . '"></a><ul>';
            } elseif (!$l['active']) {
                echo '<li><a href="' . $l['url'] . '" title="' . $l['native_name'] . '"><img src="' . $l['country_flag_url'] . '" alt="' . $l['language_code'] . '"></a></li>';
            }
        }
        echo '</ul></li>';
    }
}
Пример #30
0
 function dfd_language_selector_flags()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=0&orderby=code');
         if (!empty($languages)) {
             foreach ($languages as $l) {
                 echo '<li>';
                 echo '<a href="' . $l['url'] . '">';
                 echo $l['translated_name'];
                 echo '</a>';
                 echo '</li>';
             }
         }
     }
 }