Feature Requests

Got an idea for a new feature or integration? We’d love to hear it! You can find our roadmap here.

1 vote

Shortcode to display restricted pages

I think it would be cool to have a shortcode that dynamically shows the user a list of pages that they have access to.
EDD has a shortcode like this called [edd_restricted_pages]

Currently the only way I can think of achieving this is embedding a nav menu onto a page. But it means if I create a new page I have to manually add it to this menu. The advantage of a shortcode is that it’ll populate for users as soon as I add a page that meets their restriction tag/s.

An added bonus would be if the shortcode could display the featured image of the pages that it’s displaying.
CSS could then be applied for the rest of the customisation. This would allow showing a really nice grid of content that the user has access to.

Declined Category: Core Feature Enhancements Ben Anderson shared this idea Updated: October 28, 2022

2 thoughts on “Shortcode to display restricted pages”

  1. Are you using a page builder?

    This is mostly possible with most of our supported page builders, or actually any grid / post listing plugin, using the Filter Queries feature: https://wpfusion.com/documentation/getting-started/access-control/#filter-queries

    For example with Elementor, if I wanted to show a grid of “Resource” post types that a user has access to, I’d add a new Posts widget to the page, and then enable Filter Queries on it https://wpfusion.com/documentation/page-builders/elementor/#filter-queries

    Then the user will only see the “Resources” they have access to.

    The problem with doing it as a shortcode is… a simple list of page links is easy enough, but once you want a grid, and featured images, and responsiveness, titles and excerpts, etc….. now we’re getting into page builder territory and it can be quite complex.

    If you’re using a page builder and we don’t currently support Filter Queries on the Posts or Grid elements let me know and we can look at adding it… it’s usually pretty easy.

  2. Hey Jack. Yes I use Elementor. I did read about Filter Queries but it didn’t fully click what it meant. This feature is amazing! In this case, yes definitely no need for WP Fusion to add in another shortcode.

Leave a Comment

Your email address will not be published. Required fields are marked *