Hauptmenü

Werkzeuge

Kategorien

Archiv

Composer Element mit Kategorieauswahl

Erstellt in Wordpress am 28. Februar 2019 vom Daschmi

$categories_array = [];

foreach (\get_categories() as $category ) {

   $categories_array[html_entity_decode($category->name)] = $category->term_id;

} 

\vc_map([
   'name' => __('Beitragsfilteransicht 2', 'lhw'),
   'base' => 'm1_postfilter',
   'class' => '',
   'category' => 'M1',
   'params' => [
      [
         'param_name' => 'category_id',
         'type' => 'dropdown',
         'value' => $categories_array,
         'heading' => __('Category filter:', 'lhw'),
         'description' => '',
         'holder' => 'div',
         'class' => ''
      ]
   ]
]);