本文整理汇总了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;
}