Skip to content

Instantly share code, notes, and snippets.

View PMPro Filter member directory
* Plugin Name: My PMPro Directory Widget
* Description: Add widget to Member Directory page to filter results.
class My_PMPro_Directory_Widget extends WP_Widget {
* Sets up the widget
public function __construct() {
arvedsen / gist:d423cb83a6a8d53ca7de91bd4f5601bc
Created Feb 28, 2020
PMPro Filter member directory multiple select field error
View gist:d423cb83a6a8d53ca7de91bd4f5601bc
/* The field added via Register Helper. Field works fine in the checkout. */
$fields[] = new PMProRH_Field(
'category', // input name, will also be used as meta key
'select2', // type of field
'label' => 'Vælg interesser', // custom field label
'options' => array("model"=>"Model", "statist"=>"Statist", "actor_unex"=>"Skuespil (uøvet)", "actor_ex"=>"Skuespil (øvet)"), // input size
'class' => 'category', // custom class
'profile' => true, // show in user profile
'required' => true, // make this field required