Skip to content

Instantly share code, notes, and snippets.

/**
* 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
arvedsen / gist:d423cb83a6a8d53ca7de91bd4f5601bc
Created February 28, 2020 11:52
PMPro Filter member directory multiple select field error
/* 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
array(
'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