private function build_label_array($singular_label, $label, $str_lang, $corrections) { global $sitepress; $return = array('en' => array('singular' => $singular_label, 'general' => $label, 'original' => true)); $str_lang = $str_lang ? $str_lang : 'en'; $str_name_singular = 'taxonomy singular name: ' . $singular_label; $return['id_singular'] = icl_get_string_id($singular_label, 'WordPress', $str_name_singular); if (!$return['id_singular'] && ($str_lang == 'en' || $corrections == 2)) { $return['id_singular'] = icl_register_string('WordPress', $str_name_singular, $singular_label); } $str_name_general = 'taxonomy general name: ' . $label; $return['id_general'] = icl_get_string_id($label, 'WordPress', $str_name_general); if (!$return['id_general'] && ($str_lang === 'en' || $corrections == 2)) { $return['id_general'] = icl_register_string('WordPress', $str_name_general, $label); } $active_lang_codes = array_keys($sitepress->get_active_languages(true)); foreach ($active_lang_codes as $language) { if ($language == 'en') { continue; } $exists_singular = null; $translated_label = icl_translate('WordPress', $str_name_singular, $singular_label, false, $exists_singular, $language); if ($exists_singular) { $return[$language]['singular'] = $translated_label; } $exists_plural = null; $translated_label = icl_translate('WordPress', $str_name_general, $label, false, $exists_plural, $language); if ($exists_plural) { $return[$language]['general'] = $translated_label; } } return $return; }
function wcml_wc_2_0_backward_compatibility_register_shipping_methods($available_methods) { foreach ($available_methods as $method) { $method->label = icl_translate('woocommerce', $method->label . '_shipping_method_title', $method->label); } return $available_methods; }
/** * Front-end display of widget **/ public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', isset($instance['title']) ? esc_attr($instance['title']) : ''); $hide_title = isset($instance['hide_title']) ? $instance['hide_title'] : false; if (function_exists('icl_translate')) { // If WPML is installed $banner_code = icl_translate('themetext', "banner_code_string", $instance['banner_code']); } else { $banner_code = $instance['banner_code']; } echo $before_widget; if (!$hide_title) { if ($title) { echo $before_title . $title . $after_title; } } ?> <?php echo $banner_code; ?> <?php echo $after_widget; }
private function build_label_array($singular_label, $label) { global $sitepress, $wpdb; $return = array(); $str_name_singular = 'taxonomy singular name: ' . $singular_label; $return['id_singular'] = icl_get_string_id($singular_label, 'WordPress', $str_name_singular); if (!$return['id_singular']) { $return['id_singular'] = icl_register_string('WordPress', $str_name_singular, $singular_label); } $str_name_general = 'taxonomy general name: ' . $label; $return['id_general'] = icl_get_string_id($label, 'WordPress', $str_name_general); if (!$return['id_general']) { $return['id_general'] = icl_register_string('WordPress', $str_name_general, $label); } $active_lang_codes = array_keys($sitepress->get_active_languages(true)); foreach ($active_lang_codes as $language) { $exists_singular = null; $translated_label = icl_translate('WordPress', $str_name_singular, $singular_label, false, $exists_singular, $language); if ($exists_singular) { $return[$language]['singular'] = $translated_label; } $exists_plural = null; $translated_label = icl_translate('WordPress', $str_name_general, $label, false, $exists_plural, $language); if ($exists_plural) { $return[$language]['general'] = $translated_label; } } $string = new WPML_ST_String($return['id_singular'], $wpdb); $return[$string->get_language()] = array('singular' => $singular_label, 'general' => $label, 'original' => true); $return['st_default_lang'] = $string->get_language(); return $return; }
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', isset($instance['title']) ? esc_attr($instance['title']) : 'About The Site'); $new_window = isset($instance['new_window']) ? 'target="_blank"' : false; $center_icons = isset($instance['center_icons']) ? ' social-center' : false; $logo_url = isset($instance['logo_url']); if (function_exists('icl_translate')) { // If WPML is installed $free_text = icl_translate('themetext', "free_text", $instance['free_text']); } else { $free_text = $instance['free_text']; } echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } // Display the Logo if (!empty($instance['logo_url'])) { printf('<img src="%s" alt="%s" />', esc_url($instance['logo_url']), get_bloginfo('name')); } // Text about the site if (!empty($free_text)) { printf('%s', wpautop($free_text)); } // Display the social links echo '<ul class="social' . $center_icons . ' clearfix">'; foreach ($this->ti_sp_array($instance) as $key => $data) { if (!empty($instance[$key])) { printf('<li><a href="%s" aria-hidden="true" class="icomoon-%s" %s></a></li>', esc_url($instance[$key]), esc_attr($data['class']), $new_window); } } echo '</ul>'; echo $after_widget; }
function translate_date_format($format) { if (function_exists('icl_translate')) { icl_register_string('Formats', 'Date Format', $format); $format = icl_translate('Formats', 'Date Format', $format); } return $format; }
/** * Get rating items * * @param array $params rating_item_entry_id and post_id * @return rating items */ public static function get_rating_items($params = array()) { $rating_item_ids = isset($params['rating_item_ids']) ? $params['rating_item_ids'] : null; $rating_entry_id = isset($params['rating_item_entry_id']) ? esc_sql($params['rating_item_entry_id']) : null; $post_id = isset($params['post_id']) ? esc_sql($params['post_id']) : null; global $wpdb; // base query $rating_items_query = 'SELECT ri.rating_item_id, ri.rating_id, ri.description, ri.default_option_value, ' . 'ri.max_option_value, ri.weight, ri.active, ri.type FROM ' . $wpdb->prefix . Multi_Rating::RATING_ITEM_TBL_NAME . ' as ri'; if ($rating_entry_id || $post_id) { $rating_items_query .= ', ' . $wpdb->prefix . Multi_Rating::RATING_ITEM_ENTRY_TBL_NAME . ' AS rie, ' . $wpdb->prefix . Multi_Rating::RATING_ITEM_ENTRY_VALUE_TBL_NAME . ' AS riev'; } $added_to_query = false; if ($rating_entry_id || $post_id) { $rating_items_query .= ' WHERE'; $rating_items_query .= ' riev.rating_item_entry_id = rie.rating_item_entry_id AND ri.rating_item_id = riev.rating_item_id'; $added_to_query = true; } // rating_item_entry_id if ($rating_entry_id) { if ($added_to_query == true) { $rating_items_query .= ' AND'; $added_to_query = false; } $rating_items_query .= ' rie.rating_item_entry_id = ' . $rating_entry_id; $added_to_query = true; } // post_id if ($post_id) { if ($added_to_query == true) { $rating_items_query .= ' AND'; $added_to_query = false; } $rating_items_query .= ' rie.post_id = ' . $post_id; $added_to_query = true; //$post_type = get_post_type( $params['post_id'] ); } $rating_items_query .= ' GROUP BY ri.rating_item_id'; $rating_item_rows = $wpdb->get_results($rating_items_query); // construct rating items array $rating_items = array(); foreach ($rating_item_rows as $rating_item_row) { $rating_item_id = $rating_item_row->rating_item_id; $weight = $rating_item_row->weight; $description = $rating_item_row->description; $default_option_value = $rating_item_row->default_option_value; $max_option_value = $rating_item_row->max_option_value; $type = $rating_item_row->type; // WPML translate string if (function_exists('icl_translate') && strlen($description) > 0) { $description = icl_translate('multi-rating', 'rating-item-' . $rating_item_id . '-description', $description); } $rating_items[$rating_item_id] = array('max_option_value' => intval($max_option_value), 'weight' => floatval($weight), 'rating_item_id' => intval($rating_item_id), 'description' => stripslashes($description), 'default_option_value' => intval($default_option_value), 'type' => $type); } return $rating_items; }
function grunion_contact_form_field_html_filter($r, $field_label, $id) { global $sitepress; if (function_exists('icl_translate')) { if ($sitepress->get_current_language() !== $sitepress->get_default_language()) { $label_translation = icl_translate('jetpack ', $field_label . '_label', $field_label); $r = str_replace($field_label, $label_translation, $r); } } return $r; }
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ public function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $text = wpautop($instance['text']); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if ($text) { if (function_exists('icl_translate')) { $text = icl_translate('Widgets', 'widget_quick_contact_' . sanitize_title($text), $text); } echo $text; } echo do_shortcode('[contact_form name="' . $instance['id_form'] . '" button_style="' . $instance['button_style'] . '"]'); echo $after_widget; }
function widget($args, $instance) { global $yith_woocompare; /** * WPML Support */ $lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : false; extract($args); $localized_widget_title = function_exists('icl_translate') ? icl_translate('Widget', 'widget_yit_compare_title_text', $instance['title']) : $instance['title']; echo $before_widget . $before_title . $localized_widget_title . $after_title; ?> <ul class="products-list" data-lang="<?php echo $lang; ?> "> <?php echo $yith_woocompare->obj->list_products_html(); ?> </ul> <a href="<?php echo $yith_woocompare->obj->remove_product_url('all'); ?> " data-product_id="all" class="clear-all"><?php _e('Clear all', 'yit'); ?> </a> <a href="<?php echo add_query_arg(array('iframe' => 'true'), $yith_woocompare->obj->view_table_url()); ?> " class="compare button"><?php _e('Compare', 'yit'); ?> </a> <?php echo $after_widget; }
function tb_add_compare_link($product_id = false, $args = array()) { extract($args); if (!class_exists('YITH_Woocompare_Frontend')) { return false; } $YITH_Woocompare_Frontend = new YITH_Woocompare_Frontend(); if (!$product_id) { global $product; $product_id = isset($product->id) ? $product->id : 0; } // return if product doesn't exist if (empty($product_id) || apply_filters('yith_woocompare_remove_compare_link_by_cat', false, $product_id)) { return; } $is_button = !isset($button_or_link) || !$button_or_link ? get_option('yith_woocompare_is_button') : $button_or_link; if (!isset($button_text) || $button_text == 'default') { $button_text = get_option('yith_woocompare_button_text', __('Compare', 'yith-woocommerce-compare')); $button_text = function_exists('icl_translate') ? icl_translate('Plugins', 'plugin_yit_compare_button_text', $button_text) : $button_text; } printf('<a href="%s" class="%s" data-product_id="%d">%s</a>', $YITH_Woocompare_Frontend->add_product_url($product_id), 'compare' . ($is_button == 'button' ? ' button' : ''), $product_id, '<i class="fa fa-exchange"></i>'); }
function media_center_display_add_to_wishlist_button() { global $yith_wcwl, $product; $label_option = get_option('yith_wcwl_add_to_wishlist_text'); $icon_option = get_option('yith_wcwl_add_to_wishlist_icon') != 'none' ? '<i class="fa ' . get_option('yith_wcwl_add_to_wishlist_icon') . '"></i>' : ''; $localize_label = function_exists('icl_translate') ? icl_translate('Plugins', 'plugin_yit_wishlist_button', $label_option) : $label_option; $label = apply_filters('yith_wcwl_button_label', $localize_label); $icon = apply_filters('yith_wcwl_button_icon', $icon_option); $classes = apply_filters('yith_wcwl_add_to_wishlist_button_classes', get_option('yith_wcwl_use_button') == 'yes' ? 'add_to_wishlist single_add_to_wishlist button alt' : 'add_to_wishlist'); $wishlist_url = $yith_wcwl->get_wishlist_url(); $default_wishlists = is_user_logged_in() ? $yith_wcwl->get_wishlists(array('is_default' => true)) : false; if (!empty($default_wishlists)) { $default_wishlist = $default_wishlists[0]['ID']; } else { $default_wishlist = false; } $exists = $yith_wcwl->is_product_in_wishlist($product->id, $default_wishlist); $product_type = $product->product_type; $add_to_wishlist_url = esc_url(add_query_arg('add_to_wishlist', $product->id)); $wishlist_url = $yith_wcwl->get_wishlist_url(); $product_type = $product->product_type; $exists = $yith_wcwl->is_product_in_wishlist($product->id); $label = apply_filters('yith_wcwl_button_label', get_option('yith_wcwl_add_to_wishlist_text')); $browse_wishlist = get_option('yith_wcwl_browse_wishlist_text'); $already_in_wishlist = get_option('yith_wcwl_already_in_wishlist_text'); $product_added = get_option('yith_wcwl_product_added_text'); $html = '<div class="yith-wcwl-add-to-wishlist">'; $html .= '<div class="yith-wcwl-add-button'; // the class attribute is closed in the next row $html .= $exists ? ' hide" style="display:none;"' : ' show"'; $html .= '><a href="' . $add_to_wishlist_url . '" data-product-id="' . $product->id . '" data-product-type="' . $product_type . '" class="add_to_wishlist btn-add-to-wishlist"><i class="fa fa-heart"></i>' . $label . '</a>'; $html .= '</div>'; $html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><a href="' . esc_url($wishlist_url) . '" class="btn-add-to-wishlist"><i class="fa fa-check"></i> ' . $product_added . '</a></div>'; $html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ($exists ? 'show' : 'hide') . '" style="display:' . ($exists ? 'block' : 'none') . '"><a href="' . esc_url($wishlist_url) . '" class="btn-add-to-wishlist"><i class="fa-th-list fa"></i> ' . $browse_wishlist . '</a></div>'; $html .= '<div class="yith-wcwl-wishlistaddresponse"></div>'; $html .= '</div>'; return apply_filters('mc_yith_wcwl_add_to_wishlisth_button_html', $html, $wishlist_url, $product_type, $exists); }
/** @see WP_Widget::widget */ function widget($args, $instance) { extract($args); $booking_widget_title = apply_filters('widget_title', $instance['booking_widget_title']); if (function_exists('icl_translate')) { $booking_widget_title = icl_translate('wpml_custom', 'wpbc_custom_widget_booking_title1', $booking_widget_title); } $booking_widget_show = $instance['booking_widget_show']; $booking_widget_type = $instance['booking_widget_type']; if (empty($booking_widget_type)) { $booking_widget_type = 1; } $booking_widget_calendar_count = $instance['booking_widget_calendar_count']; $booking_widget_last_field = $instance['booking_widget_last_field']; echo $before_widget; if (isset($_GET['booking_hash'])) { _e('You need to use special shortcode [bookingedit] for booking editing.', 'wpdev-booking'); echo $after_widget; return; } if ($booking_widget_title != '') { echo $before_title . htmlspecialchars_decode($booking_widget_title) . $after_title; } echo "<div class='widget_wpdev_booking months_num_in_row_1'>"; if ($booking_widget_show == 'booking_form') { // do_action('wpdev_bk_add_form', $booking_widget_type , $booking_widget_calendar_count); $my_booking_form_name = apply_bk_filter('wpdev_get_default_booking_form_for_resource', 'standard', $booking_widget_type); make_bk_action('wpdevbk_add_form', $booking_widget_type, $booking_widget_calendar_count, true, $my_booking_form_name); } else { do_action('wpdev_bk_add_calendar', $booking_widget_type, $booking_widget_calendar_count); } if ($booking_widget_last_field !== '') { echo '<br/>' . htmlspecialchars_decode($booking_widget_last_field); } echo "</div>"; echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); // DEFAULTS if (empty($instance)) { $widget_title = __('Find us at', "loc_sport_widgets_plugin"); $content = '<ul> <li><a href="#">facebook.com/sport</a></li> <li><a href="#">dribbble.com/sport</a></li> <li><a href="#">Twitter.com/sport</a></li> <li>PO Box 4356, Melbourne 4000 Victoria, Australia</li> </ul> '; } // WPML if (function_exists('icl_translate')) { $widget_title = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[widget_title]", $widget_title); } if (function_exists('icl_translate')) { $content = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[content]", $content); } ?> <?php echo $before_widget; ?> <?php echo $before_title . $widget_title . $after_title; ?> <?php echo $content; ?> <?php echo $after_widget; ?> <?php }
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { extract($args); $is_wpml = function_exists('icl_translate'); $title = apply_filters('widget_title', $instance['title']); $subtitle = $instance['subtitle']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if ($is_wpml) { $subtitle = icl_translate('Widgets', 'widget_contact_info_subititle_' . sanitize_title($subtitle), $subtitle); } if ($subtitle) { echo "<h2>" . $subtitle . "</h2>"; } $address_image = isset($instance['address_image']) && $instance['address_image'] != '' ? '<div class="icon-container"><img src="' . $instance['address_image'] . '" alt="' . __('Location', 'yit') . '" /></div>' : ''; $phone_image = isset($instance['phone_image']) && $instance['phone_image'] != '' ? '<div class="icon-container"><img src="' . $instance['phone_image'] . '" alt="' . __('Phone', 'yit') . '" /></div>' : ''; $mobile_image = isset($instance['mobile_image']) && $instance['mobile_image'] != '' ? '<div class="icon-container"><img src="' . $instance['mobile_image'] . '" alt="' . __('Mobile', 'yit') . '" /></div>' : ''; $fax_image = isset($instance['fax_image']) && $instance['fax_image'] != '' ? '<div class="icon-container"><img src="' . $instance['fax_image'] . '" alt="' . __('Fax', 'yit') . '" /></div>' : ''; $email_image = isset($instance['email_image']) && $instance['email_image'] != '' ? '<div class="icon-container"><img src="' . $instance['email_image'] . '" alt="' . __('Email', 'yit') . '" /></div>' : ''; $text = '<div class="sidebar-nav">'; $text .= ' <ul>'; $text .= !empty($instance['address']) ? '<li>' . $address_image . '<div class="info-container"><strong>' . __('Location', 'yit') . ':</strong>' . do_shortcode($instance['address']) . '</div></li>' : ''; $text .= !empty($instance['phone']) ? '<li>' . $phone_image . '<div class="info-container"><strong>' . __('Phone', 'yit') . ':</strong> ' . do_shortcode($instance['phone']) . '</div></li>' : ''; $text .= !empty($instance['mobile']) ? '<li>' . $mobile_image . '<div class="info-container"><strong>' . __('Mobile', 'yit') . ':</strong> ' . do_shortcode($instance['mobile']) . '</div></li>' : ''; $text .= !empty($instance['fax']) ? '<li>' . $fax_image . '<div class="info-container"><strong>' . __('Fax', 'yit') . ':</strong> ' . do_shortcode($instance['fax']) . '</div></li>' : ''; $text .= !empty($instance['email']) ? '<li>' . $email_image . '<div class="info-container"><strong>' . __('Email', 'yit') . ':</strong> ' . do_shortcode($instance['email']) . '</div></li>' : ''; $text .= ' </ul>'; $text .= '</div>'; if ($is_wpml) { $text = icl_translate('Widgets', 'widget_contact_info_text_' . sanitize_title($text), $text); } echo $text . $after_widget; }
function icl_st_translate_author_fields($field, $value, $user_id) { global $sitepress_settings, $sitepress; $current_user = $sitepress->get_current_user(); if (empty($user_id)) { $user_id = $current_user->ID; } if (!isset($sitepress_settings['st']['translated-users'])) { $sitepress_settings['st']['translated-users'] = array(); } $user = new WP_User($user_id); if (is_array($user->roles) && is_array($sitepress_settings['st']['translated-users']) && array_intersect($user->roles, (array) $sitepress_settings['st']['translated-users'])) { $value = icl_translate('Authors', $field . '_' . $user_id, $value, true); } return $value; }
*/ // remove the style of woocommerce if (defined('WOOCOMMERCE_USE_CSS') && WOOCOMMERCE_USE_CSS) { wp_dequeue_style('woocommerce_frontend_styles'); } $is_iframe = (bool) (isset($_REQUEST['iframe']) && $_REQUEST['iframe']); wp_enqueue_script('jquery-fixedheadertable', YITH_WOOCOMPARE_ASSETS_URL . '/js/jquery.dataTables.min.js', array('jquery'), '1.3', true); wp_enqueue_script('jquery-fixedcolumns', YITH_WOOCOMPARE_ASSETS_URL . '/js/FixedColumns.min.js', array('jquery', 'jquery-fixedheadertable'), '1.3', true); $widths = array(); foreach ($products as $product) { $widths[] = '{ "sWidth": "205px", resizeable:true }'; } /** FIX WOO 2.1 */ $wc_get_template = function_exists('wc_get_template') ? 'wc_get_template' : 'woocommerce_get_template'; $table_text = get_option('yith_woocompare_table_text'); $localized_table_text = function_exists('icl_translate') ? icl_translate('Plugins', 'plugin_yit_compare_table_text', $table_text) : $table_text; ?> <!DOCTYPE html> <!--[if IE 6]> <html id="ie6" class="ie"<?php language_attributes(); ?> > <![endif]--> <!--[if IE 7]> <html id="ie7" class="ie"<?php language_attributes(); ?> > <![endif]--> <!--[if IE 8]>
function widget($args, $instance) { extract($args); extract($instance); // DEFAULTS if (empty($instance)) { $widget_title = __('Toggle', "loc_sport_widgets_plugin"); $toggle = array(0 => array('title' => "Toggle Trigger", 'content' => "")); } // WPML if (function_exists('icl_translate')) { $widget_title = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[widget_title]", $widget_title); } ?> <?php echo $before_widget; ?> <?php echo $before_title . $widget_title . $after_title; ?> <ul class="toggle"> <?php for ($i = 0; $i < count($toggle); $i++) { // WPML if (function_exists('icl_translate')) { $toggle[$i]['title'] = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[{$i}][title]", $toggle[$i]['title']); } if (function_exists('icl_translate')) { $toggle[$i]['content'] = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[{$i}][content]", $toggle[$i]['content']); } ?> <li> <a href='#' class='toggle-btn<?php if ($i === 0) { echo " active"; } ?> '><?php echo $toggle[$i]['title']; ?> </a> <div class='toggle-content<?php if ($i === 0) { echo " active"; } ?> '> <p><?php echo $toggle[$i]['content']; ?> </p> </div> </li> <?php } ?> </ul> <?php echo $after_widget; ?> <?php }
public function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $gallery_ids = $instance['gallery_ids']; $link = $instance['link']; if (function_exists('icl_translate')) { $link_text = empty($instance['link_text']) ? ' ' : icl_translate('wpml_custom', 'wpml_custom_' . sanitize_title(substr($instance['link_text'], 0, 6)), $instance['link_text']); } else { $link_text = empty($instance['link_text']) ? ' ' : apply_filters('widget_text', $instance['link_text']); } echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } if (!empty($gallery_ids)) { echo do_shortcode('[random max="4" template="sidebar" show_slideshow_link="0" number_of_columns="2" id="' . $gallery_ids . '"]'); } if ($link_text) { if (!empty($link)) { echo '<p><a href="' . $link . '" title="Link to ' . $title . '">'; } echo '<button class="btn btn-default">' . $link_text . ' <i class="fa fa-chevron-right"></i></button>'; if (!empty($link)) { echo '</a></p>'; } } echo $args['after_widget']; }
<div class="member-details"> <div class="member-details-inner"> <?php if (!empty($parallax_one_team_member->title)) { if (function_exists('icl_translate')) { echo '<h5 class="colored-text">' . icl_translate('Team', $parallax_one_team_member->id . '_team_title', esc_attr($parallax_one_team_member->title)) . '</h5>'; } else { echo '<h5 class="colored-text">' . esc_attr($parallax_one_team_member->title) . '</h5>'; } } if (!empty($parallax_one_team_member->subtitle)) { ?> <div class="small-text"> <?php if (function_exists('icl_translate')) { echo icl_translate('Team', $parallax_one_team_member->id . '_team_subtitle', esc_attr($parallax_one_team_member->subtitle)); } else { echo esc_attr($parallax_one_team_member->subtitle); } ?> </div> <?php } ?> </div><!-- .member-details-inner --> </div><!-- .member-details --> <?php } ?>
public static function get_label_translations($taxonomy) { global $sitepress, $wpdb; $return = false; $taxonomy_object = get_taxonomy($taxonomy); // Careful index checking here, otherwise some of those private taxonomies used by WooCommerce will result in errors here. if (defined('WPML_ST_FOLDER') && $taxonomy_object && isset($taxonomy_object->label) && isset($taxonomy_object->labels) && isset($taxonomy_object->labels->singular_name)) { $label = $taxonomy_object->label; $singular_label = $taxonomy_object->labels->singular_name; $str_lang = $sitepress->get_user_admin_language($sitepress->get_current_user()->ID); $corrections = 0; if ($str_lang != 'en') { $label_translations_sql = "\n\t\t\t\t\t\t\t\t\t\tSELECT s.value as original, t.value as translation\n\t\t\t\t\t\t\t\t\t\tFROM {$wpdb->prefix}icl_strings s\n\t\t\t\t\t\t\t\t\t\tJOIN {$wpdb->prefix}icl_string_translations t ON t.string_id = s.id\n\t\t\t\t\t\t\t\t\t\tAND s.name LIKE 'taxonomy%%name:%%'\n\t\t\t\t\t\t\t"; $label_translations = $wpdb->get_results($label_translations_sql); foreach ($label_translations as $label_translation) { if ($label_translation->translation == $singular_label) { $singular_label = $label_translation->original; $corrections++; } elseif ($label_translation->translation == $label) { $label = $label_translation->original; $corrections++; } } } $return = array('en' => array('singular' => $singular_label, 'general' => $label, 'original' => true)); $return['id_singular'] = icl_get_string_id($singular_label, 'WordPress'); if (!$return['id_singular'] && ($str_lang == 'en' || $corrections == 2)) { $return['id_singular'] = icl_register_string('WordPress', 'taxonomy singular name: ' . $singular_label, $singular_label); } $return['id_general'] = icl_get_string_id($label, 'WordPress'); if (!$return['id_general'] && ($str_lang == 'en' || $corrections == 2)) { $return['id_general'] = icl_register_string('WordPress', 'taxonomy general name: ' . $label, $label); } $active_lang_codes = array_keys($sitepress->get_active_languages(true)); foreach ($active_lang_codes as $language) { if ($language == 'en') { continue; } $exists_singular = null; $translated_label = icl_translate('WordPress', 'taxonomy singular name: ' . $singular_label, $singular_label, false, $exists_singular, $language); if ($exists_singular) { $return[$language]['singular'] = $translated_label; } $exists_plural = null; $translated_label = icl_translate('WordPress', 'taxonomy general name: ' . $label, $label, false, $exists_plural, $language); if ($exists_plural) { $return[$language]['general'] = $translated_label; } } } $return['st_default_lang'] = 'en'; return $return; }
function translate_woocommerce_rate_label($label) { if (function_exists('icl_translate')) { $label = icl_translate('woocommerce taxes', $label, $label); } return $label; }
/** * Print custom compare link * * @since 1.0.0 * @return void|null */ public function custom_compare_link() { global $product; $product_id = isset($product->id) ? $product->id : 0; // return if product doesn't exist if (empty($product_id) || apply_filters('yith_woocompare_remove_compare_link_by_cat', false, $product_id)) { return null; } $is_button = get_option('yith_woocompare_is_button', 'button'); if (!isset($button_text) || 'default' == $button_text) { $button_text = get_option('yith_woocompare_button_text', __('Compare', 'cherry-woocommerce-package')); $button_text = function_exists('icl_translate') ? icl_translate('Plugins', 'plugin_yit_compare_button_text', $button_text) : $button_text; } $action_add = 'yith-woocompare-add-product'; $url_args = array('action' => $action_add, 'id' => $product_id); $url = apply_filters('yith_woocompare_add_product_url', wp_nonce_url(esc_url_raw(add_query_arg($url_args)), $action_add)); global $wp_query; $wp_query->query_vars['cherry_wc_compare_button'] = array('url' => $url, 'is_button' => $is_button, 'product_id' => $product_id, 'button_text' => $button_text); cherry_wc_templater()->get_template_part('compare-button'); unset($wp_query->query_vars['cherry_wc_compare_button']); }
function apg_sms_procesa_notas($datos) { global $configuracion, $wpml_activo; $pedido = new WC_Order($datos['order_id']); $telefono = apg_sms_procesa_el_telefono($pedido, $pedido->billing_phone, $configuracion['servicio']); $telefono_envio = apg_sms_procesa_el_telefono($pedido, $pedido->{$configuracion['campo_envio']}, $configuracion['servicio'], false, true); $enviar_envio = $telefono != $telefono_envio && $configuracion['envio'] == 1 ? true : false; $internacional = $pedido->billing_country && WC()->countries->get_base_country() != $pedido->billing_country ? true : false; $internacional_envio = $pedido->shipping_country && WC()->countries->get_base_country() != $pedido->shipping_country ? true : false; //WPML if (function_exists('icl_register_string') || !$wpml_activo) { //Versión anterior a la 3.2 $mensaje_nota = $wpml_activo ? icl_translate('apg_sms', 'mensaje_nota', $configuracion['mensaje_nota']) : $configuracion['mensaje_nota']; } else { if ($wpml_activo) { //Versión 3.2 o superior $mensaje_nota = apply_filters('wpml_translate_single_string', $configuracion['mensaje_nota'], 'apg_sms', 'mensaje_nota'); } } //Envía el SMS if (!$internacional || isset($configuracion['internacional']) && $configuracion['internacional'] == 1) { apg_sms_envia_sms($configuracion, $telefono, apg_sms_procesa_variables($mensaje_nota, $pedido, $configuracion['variables'], wptexturize($datos['customer_note']))); //Mensaje para el teléfono de facturación } if ((!$internacional_envio || isset($configuracion['internacional']) && $configuracion['internacional'] == 1) && $enviar_envio) { apg_sms_envia_sms($configuracion, $telefono_envio, apg_sms_procesa_variables($mensaje_nota, $pedido, $configuracion['variables'], wptexturize($datos['customer_note']))); //Mensaje para el teléfono de envío } }
private function performance_row($performance, $type, $loop_cnt) { global $bridgehouse_theme; ob_start(); $fund_td = $bench_td = $fund_th = ""; if ($loop_cnt % 2) { $strip_row_class = 'bh_stripe_odd'; $benchmark_row_class = 'bh_benchmark_odd'; $fund_label_first_row_class = 'bh_fund_label_first_row_odd'; $fund_label_second_row_class = 'bh_fund_label_second_row_odd'; } else { $strip_row_class = 'bh_stripe_even'; $benchmark_row_class = 'bh_benchmark_even'; $fund_label_first_row_class = 'bh_fund_label_first_row_even'; $fund_label_second_row_class = 'bh_fund_label_second_row_even'; } if ('annualized' == $type) { if ($_REQUEST['show_bechmarks_radio'] == "true" || $_REQUEST['show_bechmarks_radio'] == NULL) { $bench_count = count(array_filter(array_keys(get_object_vars($performance->annual_labels)), create_function('$a', 'return preg_match("/benchmark.*/", $a);'))); } // added these to track the Sionna Opportunies Fund - hope it works // Added 11/03/14 $performance_count = 0; // $show_sionna_op_fund = true; $col_cnt = $this->_count_obj_para_number($performance->annual_data); $col_width = 'width="%' . self::REMAIN_COL_WIDTH / ($col_cnt + 1.5) . '"'; $col_date_width = 'width="%' . self::REMAIN_COL_WIDTH * 1.5 / ($col_cnt + 1.5) . '"'; foreach ($performance->annual_data as $key => $value) { $fund_td .= sprintf('<td %s class="%s">%s</td>', $col_width, $strip_row_class, $bridgehouse_theme->format_number($value->fund)); // used to set a marker if we should display this Fund // Added 11/03/14 // if ($performance->annual_labels->fund == 'Sionna Opportunities Fund' && !is_user_logged_in()) { // // I'm sure there is a better way to do this // $performance_count += 1; // if ($performance_count == 4 && $value->fund == '-') { // // set a false marker so as not to display this fund data if user is logged out // $show_sionna_op_fund = false; // } // } for ($i = 0; $i < $bench_count; $i++) { if ($i == $bench_count - 1) { $bench_td[$i] .= sprintf('<td class="%s">%s</td>', $benchmark_row_class, $bridgehouse_theme->format_number($value->{benchmark . $i})); } else { $bench_td[$i] .= sprintf('<td class="%s">%s</td>', $strip_row_class, $bridgehouse_theme->format_number($value->{benchmark . $i})); } } } if (isset($performance->annual_labels->footnote)) { $this->footnotes[] = $performance->annual_labels->footnote; } //$diff = round((strtotime($performance->inception_date) - strtotime('1 year ago')) / 31557000); $diff = round((strtotime($performance->inception_date) - strtotime('1 year ago')) / 31557000); if ($diff < 0 || is_user_logged_in()) { // Added 11/03/14 // if ($show_sionna_op_fund != false) { ?> <tr> <td class="<?php echo $fund_label_first_row_class; ?> "><?php // echo _e($performance->annual_labels->fund,'bridgehouse') $annual_performance_label = icl_translate('wpml_custom', 'wpml_custom_' . $performance->annual_labels->fund, $performance->annual_labels->fund); echo _e(apply_filters('fund_label', $annual_performance_label), 'bridgehouse'); ?> </td> <?php echo $fund_td; ?> <td <?php echo $col_date_width; ?> class="<?php echo $fund_label_first_row_class; ?> "><?php echo ucfirst(date_i18n('d/m/Y', strtotime($performance->inception_date))); ?> </td> </tr> <?php for ($i = 0; $i < $bench_count; $i++) { if ($i == $bench_count - 1) { echo '<tr><td class="' . $fund_label_second_row_class . '">'; } else { echo '<tr><td class="' . $fund_label_first_row_class . '">'; } // echo _e(apply_filters('fund_label', $performance->annual_labels->{benchmark.$i}),'bridgehouse'); //as issue #305 $annual_performance_benchmark = icl_translate('wpml_custom', 'wpml_custom_' . $performance->annual_labels->{benchmark . $i}, $performance->annual_labels->{benchmark . $i}); echo _e(apply_filters('fund_label', $annual_performance_benchmark), 'bridgehouse'); echo '</td>'; echo $bench_td[$i]; if ($i == $bench_count - 1) { echo '<td ' . $col_date_width . ' class="' . $fund_label_second_row_class . '"> </td></tr>'; } else { echo '<td ' . $col_date_width . ' class="' . $fund_label_first_row_class . '"> </td></tr>'; } } } } elseif ('calendar' == $type) { $col_cnt = $this->_count_obj_para_number($performance->calendar_data); $col_width = 'width="%' . self::REMAIN_COL_WIDTH / ($col_cnt + 1.5) . '"'; $col_date_width = 'width="%' . self::REMAIN_COL_WIDTH * 1.5 / ($col_cnt + 1.5) . '"'; if ($_REQUEST['show_bechmarks_radio'] == "true" || $_REQUEST['show_bechmarks_radio'] == NULL) { $bench_count = count(array_filter(array_keys(get_object_vars($performance->calendar_labels)), create_function('$a', 'return preg_match("/benchmark.*/", $a);'))); } foreach ($performance->calendar_data as $key => $value) { $fund_th .= sprintf('<th %s class="%s">%s</th>', $col_width, $strip_row_class, $value->label); $fund_td .= sprintf('<td %s class="%s">%s</td>', $col_width, $strip_row_class, $bridgehouse_theme->format_number($value->fund)); for ($i = 0; $i < $bench_count; $i++) { if ($i == $bench_count - 1) { $bench_td[$i] .= sprintf('<td class="%s">%s</td>', $benchmark_row_class, $bridgehouse_theme->format_number($value->{benchmark . $i})); } else { $bench_td[$i] .= sprintf('<td class="%s">%s</td>', $strip_row_class, $bridgehouse_theme->format_number($value->{benchmark . $i})); } } } if (isset($performance->calendar_labels->footnote)) { $this->footnotes[] = $performance->calendar_labels->footnote; } $diff = round((strtotime($performance->inception_date) - strtotime('1 year ago')) / 31557000); if ($diff < 0 || is_user_logged_in()) { ?> <tr> <td class="<?php echo $fund_label_first_row_class; ?> "><?php // _e($performance->calendar_labels->fund,'bridgehouse') $calendar_performance_label = icl_translate('wpml_custom', 'wpml_custom_' . $performance->calendar_labels->fund, $performance->calendar_labels->fund); echo _e(apply_filters('fund_label', $calendar_performance_label), 'bridgehouse'); ?> </td> <?php echo $fund_td; ?> <td <?php echo $col_date_width; ?> class="<?php echo $fund_label_first_row_class; ?> "><?php echo ucfirst(date_i18n('d/m/Y', strtotime($performance->inception_date))); ?> </td> </tr> <?php for ($i = 0; $i < $bench_count; $i++) { if ($i == $bench_count - 1) { echo '<tr><td class="' . $fund_label_second_row_class . '">'; } else { echo '<tr><td class="' . $fund_label_first_row_class . '">'; } // echo apply_filters('fund_label', $performance->calendar_labels->{benchmark.$i}); //as issue #305 $calendar_performance_benchmark = icl_translate('wpml_custom', 'wpml_custom_' . $performance->calendar_labels->{benchmark . $i}, $performance->calendar_labels->{benchmark . $i}); echo _e(apply_filters('fund_label', $calendar_performance_benchmark), 'bridgehouse'); echo '</td>'; echo $bench_td[$i]; if ($i == $bench_count - 1) { echo '<td ' . $col_date_width . ' class="' . $fund_label_second_row_class . '"> </td></tr>'; } else { echo '<td ' . $col_date_width . ' class="' . $fund_label_first_row_class . '"> </td></tr>'; } } } } return ob_get_clean(); }
function mfn_wpml_date_format($format) { if (function_exists('icl_translate')) { $format = icl_translate('Formats', $format, $format); } return $format; }
function translate_string($string_value, $sanitized_string_name) { $package_id = $this->get_package_id(); if ($package_id) { $sanitized_string_name = $this->sanitize_string_name($sanitized_string_name); $string_context = $this->get_string_context_from_package(); $string_name = $sanitized_string_name; return icl_translate($string_context, $string_name, $string_value); } else { return $string_value; } }
class=" <?php echo $footer_back_class; ?> "> <div id="footer-widget-area" class="row"> <?php get_sidebar('footer'); ?> </div><!-- #footer-widget-area --> <div class="sub_footer"> <div class="sub_footer_content"> <span class="copyright"> <?php if (function_exists('icl_translate')) { print $property_copy_text = icl_translate('wpestate', 'wp_estate_property_copyright_text', esc_html(get_option('wp_estate_copyright_message'))); } else { print esc_html(get_option('wp_estate_copyright_message', '')); } ?> </span> <div class="subfooter_menu"> <?php wp_nav_menu(array('theme_location' => 'footer_menu', 'depth' => 1)); ?> </div> </div> </div> </footer><!-- #colophon -->
/** * Support for i18n with wpml, polyglot or qtrans * * @param string $in * @param string $name (optional) required for wpml to determine the type of translation * @return string $in localized */ static function i18n($in, $name = null) { if (function_exists('langswitch_filter_langs_with_message')) { $in = langswitch_filter_langs_with_message($in); } if (function_exists('polyglot_filter')) { $in = polyglot_filter($in); } if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) { $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in); } if (is_string($name) && !empty($name) && function_exists('icl_translate')) { $in = icl_translate('plugin_ngg', $name, $in, true); } $in = apply_filters('localization', $in); return $in; }
/** * Shows the Edit Rating screen */ function mr_edit_rating_screen() { ?> <div class="wrap"> <h2><?php _e('Edit Rating', 'multi-rating'); ?> </h2> <?php // get the entry id $entry_id = null; if (isset($_GET['entry-id'])) { $entry_id = $_GET['entry-id']; } else { if (isset($_POST['entry-id'])) { $entry_id = $_POST['entry-id']; } } if ($entry_id == null) { echo '<p>Invalid entry Id</p>'; echo '</div>'; return; } $rating_items = Multi_Rating_API::get_rating_items(array('rating_item_entry_id' => $entry_id)); global $wpdb; // get the rating entry values $entry_values = array(); if ($entry_id != null) { $entry_values_query = 'SELECT riev.value AS value, riev.rating_item_entry_id AS rating_item_entry_id, riev.rating_item_id AS rating_item_id' . ' FROM ' . $wpdb->prefix . Multi_Rating::RATING_ITEM_ENTRY_VALUE_TBL_NAME . ' AS riev' . ' WHERE riev.rating_item_entry_id = ' . intval($entry_id); $entry_values = $wpdb->get_results($entry_values_query); } if (count($entry_values) == 0) { echo '<p>No rating exists for Entry Id ' . $entry_id . '</p>'; } else { $selected_option_lookup = array(); foreach ($entry_values as $entry_value) { $selected_option_lookup[$entry_value->rating_item_id] = $entry_value->value; } ?> <form name="edit-rating-form" id="edit-rating-form" method="post" action="#"> <table class="form-table"> <?php // rating items foreach ($rating_items as $rating_item) { $description = $rating_item['description']; $rating_item_id = $rating_item['rating_item_id']; // WPML translate string if (function_exists('icl_translate') && strlen($description) > 0) { $description = icl_translate('multi-rating', 'rating-item-' . $rating_item_id . '-description', $description); } ?> <tr class="form-field"> <th scope="row"><label for="rating-item-<?php echo $rating_item_id; ?> "><?php echo $description; ?> </label></td> <td> <?php echo '<select name="rating-item-' . $rating_item_id . '" id="rating-item-' . $rating_item_id . '">'; $index = 0; for ($index; $index <= $rating_item['max_option_value']; $index++) { $is_selected = false; if ($selected_option_lookup[$rating_item_id] == $index) { $is_selected = true; } echo '<option value="' . $index . '"'; if ($is_selected) { echo ' selected="selected"'; } echo '>' . $index . '</option>'; } echo '</select>'; ?> </td> </tr> <?php } ?> </table> <input type="hidden" name="entry-id" id="entry-id" value="<?php echo $entry_id; ?> " /> <input type="hidden" name="edit-rating" id="edit-rating" value="true" /> <?php submit_button(__('Update', 'multi-rating'), 'primary', 'update-rating-btn', true, null); ?> </form> <?php } ?> </div> <?php }