christineH-9
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
| Status | Topic | Supporter | Voices | Posts | Freshness |
|---|---|---|---|---|---|
|
Sort the search view results by address distance and custom date field
Started by: christineH-9
in: Toolset Professional Support
Problem: A Toolset View listing in-person workshop “event” posts needed conditional, multi-level sorting: if the user didn’t enter an origin address, results should sort by a custom “start date” field; if the user did enter an origin, results should sort by Toolset Maps distance and then by the same start-date field. The user attempted to do this via toolset_views_query_args, but it didn’t affect the View output. Solution: Toolset Views ordering must be adjusted via the wpv_filter_query hook (not toolset_views_query_args). Use wpv_filter_query to detect whether the distance search parameter is set; if not, force ordering by the start date meta field; if yes, apply a compound orderby with distance first and the start date second. Hook: add_filter( 'wpv_filter_query', ... ) If toolset_maps_distance_radius is empty → orderby = meta_value_num, meta_key = wpcf-start-date, order = ASC Else → orderby = array( 'distance' => 'ASC', 'wpcf-start-date' => 'ASC' ) Relevant Documentation: https://toolset.com/documentation/programmer-reference/views-filters/ |
|
1 | 5 | 4 months, 1 week ago | |
|
Restricting View Access based on Author’s User Role
Started by: christineH-9
in: Toolset Professional Support
Problem: Public visitors could still view single “event” (and similar) posts even when the post author no longer had the required membership role. An initial attempt using a user_has_cap filter to block read_post didn’t work reliably with the site’s setup (YOOtheme + memberships changing roles between “Professional Member” and “Customer”). Solution: Moved the restriction logic to the front-end request flow using template_redirect . On single posts of the target CPTs (e.g., event , profile ), the code fetches the post author, checks if they hold the professional_member role, and—if not—forces a 404 response. This bypasses theme/layout nuances and consistently hides content by author role. The same pattern can be extended to additional CPTs (e.g., facilitator-profile ) and/or different role slugs. Relevant Documentation: |
|
1 | 8 | 4 months, 2 weeks ago | |
|
Creating or removing a relationship with one click
Started by: christineH-9 in: Toolset Professional Support |
|
1 | 4 | 8 months, 3 weeks ago | |
|
Set content read/view permissions based on content creator’s access level
Started by: christineH-9 in: Toolset Professional Support |
|
1 | 6 | 11 months, 2 weeks ago |