Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 2 dev #101

Merged
merged 12 commits into from May 24, 2019
Merged

2 2 dev #101

merged 12 commits into from May 24, 2019

Conversation

brettshumaker
Copy link
Owner

Closes #71, #72, #84, #86, and #96

Adding the ability to pass a staff member ID to the `simple-staff-list` shortcode to display a single staff member using the default staff loop template.

Usage:

`[simple-staff-list id=5]`
I decided to show the staff member's post ID so it's easier for end users to find and use in the shortcode.
Adds the `sslp_query_args` filter that filters the args used in `WP_Query` by the `[simple-staff-list]` shortcode. The second parameter is `$context` and describes the context in which the filter is being run. I added this parameter in case there are other scenarios where we're querying staff members but _not_ from the shortcode i.e. a future Gutenberg block.

If an array is not returned, I reset `$args` to the unfiltered value. I then assign the `post_type` value so we're always going to be querying the `staff-member` post type.
…code-query-args

Add the `sslp_query_args` filter
Needed to set a sane default here instead of `-1`. If a user happened to have 100s or 1000s of staff members, using the shortcode could have caused trouble.
…aff-query

Limits the WP_Query posts_per_page to 100
Adds the `sslp_enable_staff_member_archive` filter to control whether or not the `https://your-site.com/staff-members` archive page is enabled. The default is `true`.

Remember that after changing this value you'll need to flush your permalinks to have the change take effect.
…taff-member-archive

Adds a filter to disable the staff-members archive page.
@brettshumaker brettshumaker merged commit 354a64b into dev-master May 24, 2019
@brettshumaker brettshumaker deleted the 2-2-dev branch May 24, 2019 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suggestion: way to sort staff by other an ASC/DESC alphabetical
1 participant