本文整理匯總了PHP中WPBMap::getUserCategories方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPBMap::getUserCategories方法的具體用法?PHP WPBMap::getUserCategories怎麽用?PHP WPBMap::getUserCategories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPBMap
的用法示例。
在下文中一共展示了WPBMap::getUserCategories方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: contentCategories
/**
* Get list of categories allowed for user.
*
* Categories list depends on user policies for shortcodes. If none of allowed shortcodes are in the category, this
* category not displayed.
*
* @return string
*/
public function contentCategories()
{
$output = '<ul class="isotope-filter vc_filter-content-elements"><li class="active"><a href="#" data-filter="*">' . __('Show all', "js_composer") . '</a></li>';
$_other_category_index = 0;
$show_other = false;
foreach (WPBMap::getUserCategories() as $key => $name) {
if ($name === '_other_category_') {
$_other_category_index = $key;
$show_other = true;
} else {
$output .= '<li><a href="#" data-filter=".category-' . md5($name) . '">' . __($name, "js_composer") . '</a></li>';
}
}
if ($show_other) {
$output .= '<li><a href="#" data-filter=".category-' . $_other_category_index . '">' . __('Other', "js_composer") . '</a></li>';
}
$output .= '</ul>';
return apply_filters('vc_add_element_box_categories', $output);
}
示例2: getCategories
/**
* Get categories list from mapping data.
* @since 4.5
*
* @return array
*/
public function getCategories()
{
return WPBMap::getUserCategories();
}
示例3: getContentCategoriesLayouts
public function getContentCategoriesLayouts()
{
$output = '<li><ul class="isotope-filter"><li class="active"><a href="#" data-filter="*">' . __('Show all', LANGUAGE_ZONE) . '</a></li>';
// $output .= '<li><a href="#" data-filter=".category-layout" class="category-layout-filer">'
// .__('Layout', LANGUAGE_ZONE).'</a></li>';
$_other_category_index = 0;
$show_other = false;
foreach (WPBMap::getUserCategories() as $key => $name) {
if ($name === '_other_category_') {
$_other_category_index = $key;
$show_other = true;
} else {
$output .= '<li><a href="#" data-filter=".category-' . md5($name) . '">' . __($name, LANGUAGE_ZONE) . '</a></li>';
}
}
if ($show_other) {
$output .= '<li><a href="#" data-filter=".category-' . $_other_category_index . '">' . __('Other', LANGUAGE_ZONE) . '</a></li>';
}
//$output .= '<li class="name_filter"><input id="vc_elements_name_filter" type="text" name="vc_content_filter" placeholder="'.__('Search by element name', LANGUAGE_ZONE).'"/></li>';
$output .= '</ul></li>';
return $output;
}
示例4: getContentCategoriesLayouts
public function getContentCategoriesLayouts()
{
$output = '<li><ul class="isotope-filter"><li class="active"><a href="#" data-filter="*">' . __('Show all', 'js_composer') . '</a></li>';
// $output .= '<li><a href="#" data-filter=".category-layout" class="category-layout-filer">'
// .__('Layout', 'js_composer').'</a></li>';
$_other_category_index = 0;
$show_other = false;
foreach (WPBMap::getUserCategories() as $key => $name) {
if ($name === '_other_category_') {
$_other_category_index = $key;
$show_other = true;
} else {
$output .= '<li><a href="#" data-filter=".category-' . $key . '">' . __($name, "js_composer") . '</a></li>';
}
}
if ($show_other) {
$output .= '<li><a href="#" data-filter=".category-' . $_other_category_index . '">' . __('Other', 'js_composer') . '</a></li>';
}
$output .= '</ul></li>';
return $output;
}