Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Plugins
    In reply to: [Listo] Custom lists?
    robbora

    (@robbora)

    As I had the same issue here an example code to add available categories in a checkbox list

    In yourtheme/functions.php add following code lines:

    
    add_filter('listo_list_types', 'listo_list_types_func');
    function listo_list_types_func($list_types){
    	$list_types['categories'] = 'Listo_Categories';
    	return $list_types;
    }
    
    class Listo_Categories implements Listo {
    
    	public static function items(){
    		$categories = get_categories(['hide_empty' => 0]);
    
    		foreach( $categories as $cat ){
    			$items [$cat->cat_ID] = $cat->name;
    		}
    
    		return $items;
    	}
    
    	public static function groups(){}
    }
    

    In your CF7 form add the following [shortcode]

    
    [checkbox categories data:categories]
    

    That’s it

    Hope this help

    • This reply was modified 6 years ago by robbora.
Viewing 1 replies (of 1 total)