pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 265 forks source link

hide text "You do not have access to view this content." #5875

Closed neilsinger closed 3 years ago

neilsinger commented 4 years ago

Issue Overview

The restricted content feature is working in the template, but then it is displaying text "You do not have access to view this content." We would prefer to have nothing display instead of what looks like an error message. It is hiding the pods content which we wanted - but the way it is handled looks like an error.

Expected Behavior

We would prefer that the text "You do not have access to view this content." not appear for users not authorized to view. It would be better if that text area was empty.

Is there a control that we have not been able to find by which we can configure whether or not that auth message shows, and if we want it to show, allow us to enter text we prefer to be displayed?

Current Behavior

Steps to Reproduce (for bugs)

  1. Edit POD template
  2. Restrict Access either by "Show to Admins Only?" or by "Restrict access by Capability?"
  3. View live page - where the POD content would normally display shows the text "You do not have access to view this content." to viewers who lack authorization.

Possible Solution

Is there Custom CSS we could add which would hide the text "You do not have access to view this content" using the WP Appearance tool?

WordPress Environment

WordPress 5.5.2 running Property Rental WordPress Theme theme.

``` Copy and paste your System Details from **Pods Admin > Settings > Debug Information** in WordPress admin here. ```

Debug Information WordPress Version: 5.5.2

PHP Version: 7.3.12

MySQL Version: 5.6.32

Server Software: Apache

Your User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

Session Save Path:

Session Save Path Exists: No

Session Save Path Writeable: No

Session Max Lifetime: 1440

Opcode Cache:

Apc: Yes Memcached: No OPcache: Yes Redis: No Object Cache:

APC: Yes APCu: Yes Memcache: Yes Memcached: No Redis: No WPDB Prefix: wp9t3khd9gqx

WP Multisite Mode: No

WP Memory Limit: 40M

Current Memory Usage: 11.071M

Current Memory Usage (real): 4.000M

Pods Network-Wide Activated: No

Pods Install Location: /var/www/wp-content/plugins/pods/

Pods Tableless Mode Activated: No

Pods Light Mode Activated: No

Currently Active Theme: Property Rental WordPress Theme

Currently Active Plugins:

API KEY for Google Maps: 1.2.0 Ninja Forms: 3.4.30 Ninja Forms - Addon Manager: 3.0.13 Pods - Custom Content Types and Fields: 2.7.23 Show-Hide/Collapse-Expand: 1.2.4 SiteOrigin CSS: 1.2.11 Smart Slider 3: 3.4.1.11 UpdraftPlus - Backup/Restore: 1.16.34 Widget Importer & Exporter: 1.6 WordPress Importer: 0.7 WP Google Maps: 8.0.26 WP Google Maps - Pro Add-on: 7.11.69 Yoast Duplicate Post: 3.2.6

Pods Package Export (helpful!)

Copy and Paste the JSON Export from **Pods Admin, Migrate: Packages, Export** in WordPress admin here

Workaround or Alternate Solution Until Bug is Addressed

Related Issues and/or PRs

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label Type: Bug to this issue, with a confidence of 0.56. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

JoryHogeveen commented 4 years ago

Hello @neilsinger

You can use the filter pods_templates_permission_denied to change or remove this text.

JoryHogeveen commented 4 years ago

Reopening for PR that allows this in the UI