Comments (4)
I'd also suggest that instead of a search and a checklist of users:
A token multiselect control is used. It essentially works the way the Tags
control works in the Block Editor, but as you type, it shows you a dropdown of users matching what you're typing, and then you can select, remove, etc.
from simple-user-listing.
Ok! Latest block iteration under development
Current status: show all users in the editor using the core data store and show all users on the frontend using existing shortcode. Absolutely no UI for modifying query yet.
from simple-user-listing.
👋 @aurooba
SUL supports most of the parameters of the WP_User_Query
class as parameters for the shortcode.
Here's everything that currently is supported:
'query_id' => 'simple_user_listing', // This allows for targeted filtering of pre_get_user which allows for very custom queries.
'role' => '', // Multiple roles can be defined in a comma separated list [userlist role="infield,outfield"]
'role__in' => '', // Multiple roles can be defined in a comma separated list
'role__not_in' => // Multiple roles can be defined in a comma separated list
'include' => '', // Multiple user IDs can be defined in a comma separated list
'exclude' => '', // Multiple user IDs can be defined in a comma separated lis
'blog_id' => '',
'number' => get_option( 'posts_per_page', 10 ),
'order' => 'ASC',
'orderby' => 'login',
'meta_key' => '',
'meta_value' => '',
'meta_compare' => '=',
'meta_type' => 'CHAR',
'count_total' => true,
'template' => 'author' // Corresponds to content-author.php template, can accept different templates per shortcode.
Technically you can combine those to get fairly complex queries, ie: users with role "author" that have a billing address in Illinois, but I definitely think we should start as simply as possible.
The Figma is a lot incomplete, but also not a terrible starting place. I think there needs to be 2 parts.. maybe block and sidebar. The block should handy the query and the sidebar the resulting parts to be displayed
Query
Show all
Include specific users
Exclude specific users
Include specific roles
Exclude specific roles
Number of users (per page?)
Order/Orderby
Currently unsure if include and exclude should be mutually exclusive. If I recall.. that's what I was going for in the Figma... exclude is toggle one way and Include is the other.
I do want it so that eventually you can build up a complex query. Technically you current can say get all Authors except Kathy and Aurooba.. which is a combo of multiple args.
There's also a possible "what should we show about each author" in the sidebar section. This might be a later phase thing though.
Sidebar Display
User display name
Username vs display name vs first/last names
user avatar
link to profile page
hide/show search?
Ok that's enough thinking for today!
from simple-user-listing.
Notes:
Initial block placeholder can show 3 options:
- Show all users
- Show users by x role (show dropdown of roles)
- Select custom users.
from simple-user-listing.
Related Issues (18)
- Decoded arrows
- Switch to _n for translation
- About user search function HOT 1
- FQDN in Picture-Path HOT 1
- Search on fields other than name HOT 1
- How to list admin approved users HOT 1
- Adjusting the number of users displayed per page HOT 2
- Create Gutenberg block for shortcode HOT 8
- Navigation stopped working HOT 14
- Search from paged page should reset to first page
- Remove the Search Input code no longer works HOT 3
- Change donation link back to me
- improve sanitization HOT 1
- add plugin playground support
- Can we use the toolbar for grid vs layout styles? should we?
- Block template and inner blocks
- Add docu for block
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-user-listing.