コード例 #1
0
 /**
  * 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
0
 /**
  * Get categories list from mapping data.
  * @since 4.5
  *
  * @return array
  */
 public function getCategories()
 {
     return WPBMap::getUserCategories();
 }
コード例 #3
0
ファイル: layouts.php プロジェクト: scottnkerr/eeco
 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
0
ファイル: layouts.php プロジェクト: unisexx/drtooth
 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;
 }