user->get_roles(); } /** * @inheritdoc * @see ACP_Editing_Model::get_view_settings() */ public function get_view_settings() { return array( 'type' => 'checklist', 'placeholder' => __( 'Select roles for access validation', 'ac-addon-members' ), 'multiple' => true, 'options' => ac_helper()->user->get_roles(), ); } /** * @inheritdoc * @see ACP_Editing_Model::save() */ public function save( $id, $value ) { if ( is_string( $value ) ) { $value = explode( ',', $value ); } members_set_post_roles( $id, $value ); return $value; } }