roles, true ); if ( 'is_not' === $args['operator'] ) { return ! $is_match; } return $is_match; } /** * Get UI options. * * @return array */ public function get_options_ui() { global $wp_roles; $options = []; if ( ! isset( $wp_roles ) ) { $wp_roles = new \WP_Roles(); } foreach ( $wp_roles->roles as $slug => $role ) { $options[] = [ 'value' => $slug, 'label' => $role['name'], ]; } return [ 'type' => 'select', 'options' => $options, ]; } }