1. Documentation
  2. Restrict Content
  3. Difference between Restrict Content and Show/Hide Content If

Difference between Restrict Content and Show/Hide Content If

Show Content If and Hide Content If shortcodes are utility shortcodes to dynamically show or hide any portion of content you have based on the current user earnings.

The main difference with the Restrict Content shortcode is that restrict content shortcode will grant access to a portion of content always at the moment the user meets the requirements (or get access by expending points).

But Show Content If and Hide Content If will revoke the access automatically at the moment the user doesn’t meets the requirements.

The better way to understand it is with an example, lets imagine that we have an achievement and we want to use this achievement with those 3 blocks, lets see how each block will work at the moment of award and revoke the achievement:

Restrict Content

  • Restrict Content shortcode will restrict the access to a portion of content until user doesn’t unlocks the achievement.
  • At the moment the user earns the achievement, Restrict Content shortcode will give access to the portion of content.
  • If for some reason, the user lost this achievement (for example, an admin revokes it), Restrict Content shortcode will maintain the access to the portion of content
  • Note: the access to the portion of content is stored on the GamiPress logs, if you remove this log entry, then the user will lost the access to the portion of content.

Show Content If

  • Show Content If shortcode will hide a portion of content until user doesn’t unlocks the achievement.
  • At the moment the user earns the achievement, Show Content If shortcode will show the portion of content.
  • If for some reason, the user lost this achievement (for example, an admin revokes it), Show Content If shortcode will hide the portion of content again.

Hide Content If

  • Hide Content If shortcode will show a portion of content until user doesn’t unlocks the achievement.
  • At the moment the user earns the achievement, Hide Content If shortcode will hide the portion of content.
  • If for some reason, the user lost this achievement (for example, an admin revokes it), Hide Content If shortcode will show the portion of content again.

Other of the great features of Show Content If and Hide Content If shortcodes is their ability to show/hide a portion of content based on the current user balance, so you can show or hide a portion of content if user has a current balance greater or lower of a specific amount.

How can we help?