/** * 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); }
/** * Get categories list from mapping data. * @since 4.5 * * @return array */ public function getCategories() { return WPBMap::getUserCategories(); }
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; }
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; }