本文整理汇总了PHP中SitePress::get_flag_url方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::get_flag_url方法的具体用法?PHP SitePress::get_flag_url怎么用?PHP SitePress::get_flag_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SitePress
的用法示例。
在下文中一共展示了SitePress::get_flag_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_metabox_status
public function get_metabox_status()
{
$result = '';
if ($this->got_package()) {
$result .= '<div id="wpml_package_status">';
if ($this->show_status && $this->metabox_data['statuses']) {
if ($this->status_container_tag) {
$result .= $this->get_tag($this->status_container_tag . ' ' . $this->status_container_attributes_html);
}
foreach ($this->metabox_data['statuses'] as $code => $status) {
$result .= $this->get_tag($this->status_element_tag);
$result .= '<img src="' . $this->sitepress->get_flag_url($code) . '"> ' . $status['name'] . ' : ' . $status['status'];
$result .= $this->get_tag($this->status_element_tag, 'closed');
}
if ($this->status_container_tag) {
$result .= $this->get_tag($this->status_container_tag, 'closed');
}
}
if ($this->show_link) {
if ($this->is_package_language_active()) {
$result .= '<p><a style="float:right" class="button-secondary" href="' . $this->dashboard_link . '" target="_blank">' . $this->metabox_data['translate_title'] . '</a></p>';
} else {
$result .= '<p><a style="float:right" class="button-secondary" href="' . $this->strings_link . '" target="_blank">' . $this->metabox_data['translate_title'] . '</a></p>';
}
}
$result .= '<br /><br /></div>';
}
return $result;
}
示例2: getFlagUrl
/**
* get flag url
*/
public static function getFlagUrl($code)
{
self::validateWpmlExists();
$wpml = new SitePress();
if (empty($code) || $code == "all") {
$url = ICL_PLUGIN_URL . '/res/img/icon16.png';
} else {
$url = $wpml->get_flag_url($code);
}
//default: show all
if (empty($url)) {
$url = ICL_PLUGIN_URL . '/res/img/icon16.png';
}
return $url;
}
示例3: wpml_get_table_taxonomies
public static function wpml_get_table_taxonomies(SitePress $sitepress)
{
$taxonomies = $sitepress->get_wp_api()->get_taxonomies(array(), 'objects');
$result = array("taxonomies" => array(), "activeLanguages" => array(), "allLanguages" => array());
$sitepress->set_admin_language();
$active_langs = $sitepress->get_active_languages();
$default_lang = $sitepress->get_default_language();
$result["activeLanguages"][$default_lang] = array("label" => $active_langs[$default_lang]['display_name'], "flag" => $sitepress->get_flag_url($default_lang));
foreach ($active_langs as $code => $lang) {
if ($code !== $default_lang) {
$result["activeLanguages"][$code] = array("label" => $lang['display_name'], "flag" => $sitepress->get_flag_url($code));
}
}
$all_languages = $sitepress->get_languages();
foreach ($all_languages as $code => $lang) {
$result["allLanguages"][$code] = array("label" => $lang['display_name'], "flag" => $sitepress->get_flag_url($code));
}
foreach ($taxonomies as $key => $tax) {
if ($sitepress->is_translated_taxonomy($key)) {
$result["taxonomies"][$key] = array("label" => $tax->label, "singularLabel" => $tax->labels->singular_name, "hierarchical" => $tax->hierarchical, "name" => $key);
}
}
return $result;
}
示例4: getFlagUrl
/**
* get flag url
*/
public static function getFlagUrl($code)
{
self::validateWpmlExists();
$wpml = new SitePress();
if (empty($code) || $code == "all") {
$url = RS_PLUGIN_URL . 'admin/assets/images/icon-all.png';
} else {
$url = $wpml->get_flag_url($code);
}
/* NEW:
if ( empty( $code ) || $code == "all" ) {
$url = ICL_PLUGIN_URL . '/res/img/icon16.png';
} else {
$active_languages = apply_filters( 'wpml_active_languages', array() );
$url = isset( $active_languages[$code]['country_flag_url'] ) ? $active_languages[$code]['country_flag_url'] : null;
}
*/
//default: show all
if (empty($url)) {
$url = RS_PLUGIN_URL . 'admin/assets/images/icon-all.png';
// NEW: $url = ICL_PLUGIN_URL . '/res/img/icon16.png';
}
return $url;
}