} // if the user load a specific img for a language load it and add its configuration if (isset($new_img_file[$key]) && !empty($new_img_file[$key])) { // get width and height from image loaded list($width, $height) = getimagesize($new_img_file[$key]['file']); // this rule is for div content "tab_flag" $content_style = 'width:' . $width . 'px; height:' . $height . 'px;'; // create css rules $new_style = ''; $new_style .= 'margin-right:5px;'; $new_style .= 'background-image: none;'; $new_style .= $content_style; // create html tag for show this image $tagHtml = ' <img src="' . $new_img_file[$key]['url'] . '" style="' . $new_style . '" class="flag_32x32 flag-' . Codes::languageCode2CountryCode($value) . '" alt="' . $value . '" title="' . $key . '" /> '; } ?> <div class="tab_flag <?php echo $grayClass; ?> " style="<?php echo $content_style; ?> "><?php echo uls_get_link($postId, $value, $tagHtml); ?> </div> <?php } ?> </div>
function uls_link_shortcode($atts) { extract(shortcode_atts(array('id' => null, 'lang' => uls_get_user_language(), 'post_type' => 'page', 'title' => null, 'label' => null), $atts)); //get post if (null == $id && null != $title) { $post = get_page_by_title($title, 'OBJECT', $post_type); $id = $post->ID; } if (null != $id) { return uls_get_link($id, $lang, $label); } return null; }