Skip to content

Instantly share code, notes, and snippets.

@moskalukigor
Last active October 5, 2018 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moskalukigor/d86d48daa9eeee69b5bdf7d720d22e29 to your computer and use it in GitHub Desktop.
Save moskalukigor/d86d48daa9eeee69b5bdf7d720d22e29 to your computer and use it in GitHub Desktop.
Add shortcode in cf7 with plugin Listo
<?php
add_filter('listo_list_types', 'listo_list_types_func');
function listo_list_types_func($list_types){
$list_types['physicians'] = 'Listo_Physicians';
return $list_types;
}
class Listo_Physicians implements Listo {
public static function items(){
$args = array(
'post_type' => 'physicians',
'post_status' => 'publish',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
$userData = array();
$items[] = "Physicians";
foreach($query->posts as $item)
{
$items[$item->ID] = $item->post_title;
}
return $items;
}
public static function groups(){}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment