Shortcode to restrict content to b2b/b2c/user groups/specific users

The following feature exists in beta and will be/is available in releases after 2.0.0

The following shortcode can be used to restrict content, so that it can be seen only by groups/b2b/b2c/users

[b2bking_content show_to=b2b]Your content here...[/b2bking_content]

The parameter show_to is mandatory. This parameter can contain multiple items, comma-separated. The parameter supports 5 elements:

  • b2b
  • b2c
  • loggedout
  • b2bking group IDs (e.g. 71, 343, 5884. Each business group has its own ID, which is visible in the link of the group's page when you click edit group)
  • usernames e.g: admin, user, mike.johnson, mazda.213

More examples:

[b2bking_content show_to=b2c,loggedout,admin]Your content here...[/b2bking_content]

In this example: b2c users, logged out users, and the user "admin" will see content

[b2bking_content show_to=123,b2c,loggedout,admin]Your content here...[/b2bking_content]

In this example: b2b users in the group with ID 123, b2c users, logged out users and the user admin will see the content.

[b2bking_content show_to=123,14,88]Your content here...[/b2bking_content]

In this example: b2b users in groups 123,14 and 88 will see the content.

Did you find this article useful?