Error with ‘namaste-userinfo’ shortcode
-
An error displays with the shortcode [namaste-userinfo]. It works fine for logged-in users but if a guest to the site navigates to the secured page, instead of (or as well as) the message “This content is for logged in users”, I get the following error message displayed on the page:
‘error on shortcode: [namaste-userinfo field=”display_name” default=”Guest”]
“Warning: count(): Parameter must be an array or an object that implements Countable in /wordpress/wp-content/plugins/namaste-lms/controllers/shortcodes.php on line 670″
This content is for logged in users.’I use the shortcode to display the user’s ‘display_name’ on pages and posts. The syntax I use is as per the documentation, namely [namaste-userinfo field=”display_name”]. I have used it with the documentation’s default example of [namaste-userinfo field=”user_nicename” default=”Guest”] and I have used it with, and without, the parameters. I’ve tested it also on a blank page and a blank post, secured and unsecured. The result is the same for any NON logged-in user. For logged-in users it works fine.
Not a major issue as it is cosmetic only. However, if you use the shortcode in a heading you get a VERY BIG error message displayed all over the screen!
- The topic ‘Error with ‘namaste-userinfo’ shortcode’ is closed to new replies.