[Plugin: teachPress] PHP conditional test for TeachPress access
-
Can anyone help write a simple conditional test in PHP that will be true or false based upon whether the actively logged in WordPress user is successfully enrolled in a particular course or not.
In other words, Boolean true or false based upon if the user is enrolled in TeachPress’s Course ID=1.
NOTE, THE TPPOST SHORTCUT YIELDS THE WRONG RESULTS:
`[tppost id=”1″]
You can only see this text if registered for Course ID 1
[/tppost]`I am trying to display different executable buttons (embeded as shortcode from another plugin) based upon php conditional tests. I am unable to utilize the TPPOST shortcut for this scenario because the TPPOST simply outputs the text string of the said embedded button shortcode to the screen. So, instead of seeing a functional button, I see the shortcode text string. Hence, TPPOST shortcode is functioning successfully as it is designed, but doesn’t allow me to process the code within the embedded shortcode for the said buttons.
Hence, I need assistance finding a PHP test parameter that I can use to test if a user is registered for a course (e.g. Course ID=1). Perhaps, someone can specify an appropriate parameter to go with the current_user_can scope, such as:
<?php if (!current_user_can('teachpress_user')) ...
However, ‘TEACHPRESS_USER’ is the wrong parameter.
Thanks for any assistance.
- The topic ‘[Plugin: teachPress] PHP conditional test for TeachPress access’ is closed to new replies.