本文整理汇总了PHP中td_util::get_taxonomy_option方法的典型用法代码示例。如果您正苦于以下问题:PHP td_util::get_taxonomy_option方法的具体用法?PHP td_util::get_taxonomy_option怎么用?PHP td_util::get_taxonomy_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类td_util
的用法示例。
在下文中一共展示了td_util::get_taxonomy_option方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_header
<?php
/**
* the custom taxonomy template
* This file is loaded by WordPress on custom taxonomies. You can further customize this template
* for specific taxonomies by copying this file to taxonomy-yourTaxonomyName.php
*/
get_header();
global $loop_module_id, $loop_sidebar_position;
// get the current taxonomy object - note that it's note complete
$current_term_obj = get_queried_object();
//read the loop variables for this specific taxonomy
$loop_module_id = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_page_layout');
$loop_sidebar_position = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_sidebar_pos');
if (empty($loop_module_id)) {
$loop_module_id = 1;
// module_1 is the default
}
// sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
$td_sidebar_position = '';
if ($loop_sidebar_position == 'sidebar_left') {
$td_sidebar_position = 'td-sidebar-left';
}
?>
<div class="td-main-content-wrap">
<div class="td-container <?php
echo $td_sidebar_position;
?>
">
<div class="td-crumb-container">
示例2: dynamic_sidebar
/* ----------------------------------------------------------------------------
sidebar from page - set in the page setting
*/
dynamic_sidebar($td_page['td_sidebar']);
} else {
if (td_global::$current_template == 'woo') {
//woo commerce
td_util::show_sidebar('woo');
} elseif (td_global::$current_template == 'woo-single') {
td_util::show_sidebar('woo-single');
} elseif (td_global::$current_template == 'bbpress') {
td_util::show_sidebar('bbpress');
} elseif (is_tax()) {
// custom taxonomies
$current_term_obj = get_queried_object();
$tds_taxonomy_sidebar = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_sidebar');
if (!empty($tds_taxonomy_sidebar)) {
dynamic_sidebar($tds_taxonomy_sidebar);
} else {
//show default if available
if (!dynamic_sidebar(TD_THEME_NAME . ' default')) {
?>
<!-- no sidebar -->
<?php
}
}
} elseif (is_category()) {
// sidebar from category on category page
$curCategoryID = get_query_var('cat');
$tax_meta_sidebar = td_util::get_category_option($curCategoryID, 'tdc_sidebar_name');
////swich by RADU A, get_tax_meta($curCategoryID, 'tdc_sidebar_name');
示例3: read
/**
* Reads an individual setting - only one setting!
* @param $read_array -
* 'ds' => 'data source ID',
'item_id' = > 'the category id for example', - OPTIONAL category id or author id or page id
* 'option_id' => 'the option id ex: background'
* @return returns the value of the setting
*/
static function read($read_array)
{
switch ($read_array['ds']) {
case 'td_taxonomy':
return td_util::get_taxonomy_option($read_array['item_id'], $read_array['option_id']);
break;
case 'td_cpt':
return td_util::get_ctp_option($read_array['item_id'], $read_array['option_id']);
break;
case 'td_category':
return td_util::get_category_option($read_array['item_id'], $read_array['option_id']);
break;
case 'td_option':
return td_util::get_option($read_array['option_id']);
//htmlspecialchars()
break;
case 'wp_option':
return htmlspecialchars(get_option($read_array['option_id']));
break;
case 'td_homepage':
// here we get all the options for the homepage (including widgets?)
break;
case 'td_page_option':
break;
case 'td_widget':
break;
//author metadata
//author metadata
case 'td_author':
return get_the_author_meta($read_array['option_id'], $read_array['item_id']);
break;
//wordpress theme mod datasource
//wordpress theme mod datasource
case 'wp_theme_mod':
return htmlspecialchars(get_theme_mod($read_array['option_id']));
break;
//wordpress usermenu to menu spot datasource
//wordpress usermenu to menu spot datasource
case 'wp_theme_menu_spot':
$menu_spots_array = get_theme_mod('nav_menu_locations');
//check to see if there is a menu assigned to that particular option_id (menu id)
if (isset($menu_spots_array[$read_array['option_id']])) {
return $menu_spots_array[$read_array['option_id']];
} else {
return '';
}
break;
//translation data source
//translation data source
case 'td_translate':
//get all the translations (they are stored in the td_008 variable)
$translations = td_util::get_option('td_translation_map_user');
if (!empty($translations[$read_array['option_id']])) {
return $translations[$read_array['option_id']];
//htmlspecialchars()
} else {
return '';
}
//return td_util::get_option($read_array['option_id']);
break;
//read the ads parameters
//[ds] => td_ads [option_id] => current_ad_type [item_id] => header - has to become [item_id][option_id]
//read the ads parameters
//[ds] => td_ads [option_id] => current_ad_type [item_id] => header - has to become [item_id][option_id]
case 'td_ads':
//get all the ad spots (they are stored in the td_008 variable)
$ads = td_util::get_option('td_ads');
if (!empty($ads[$read_array['item_id']]) and !empty($ads[$read_array['item_id']][$read_array['option_id']])) {
return htmlspecialchars($ads[$read_array['item_id']][$read_array['option_id']]);
} else {
return '';
}
break;
//social networks
//social networks
case 'td_social_networks':
$social_array = td_util::get_option('td_social_networks');
if (!empty($social_array[$read_array['option_id']])) {
return $social_array[$read_array['option_id']];
} else {
return '';
}
break;
case 'td_fonts_user_insert':
$fonts_user_inserted = td_util::get_option('td_fonts_user_inserted');
if (!empty($fonts_user_inserted[$read_array['option_id']])) {
return $fonts_user_inserted[$read_array['option_id']];
}
break;
case 'td_fonts':
$fonts_user_inserted = td_util::get_option('td_fonts');
if (!empty($fonts_user_inserted[$read_array['item_id']][$read_array['option_id']])) {
//.........这里部分代码省略.........