dashed-slug.net › Forums › General discussion › Hiding the error “User is not logged in!”
- This topic has 3 replies, 2 voices, and was last updated 5 years ago by
alexg.
-
AuthorPosts
-
October 4, 2020 at 4:19 pm #9340
Anonymous
InactiveHi,
Problem for not logged in user : they see error :Error while rendering the rates shortcode with its default template in /home/customer/www/timaxpay.com/public_html/wp-content/plugins/wallets/templates/rates.php: User is not logged in!
mo
I can’t redirect all your pages to login / registry page ?Best regards,
ValeriiOctober 5, 2020 at 7:40 am #9342alexg
KeymasterThat is correct. You cannot redirect the user directly to the template file. This is true for all WordPress plugins, not just this one.
The template file is not a complete page, just an HTML fragment that gets inserted wherever you use the exchange rates file.
To display exchange rates, create a WordPress page and insert the
[wallets_rates]
shortcode in it.with regards
October 5, 2020 at 12:44 pm #9346Anonymous
InactiveHi,
But WordPress has different plugins for restriction for logged in and not logged in user.
If you look up in menu FIAT wallet page restricted only for logged in user in other case page redirected to login / registry page. bur users doesn’t see error on page.What i have to do to to prevent user from error if they not logged in ???
Best regards,
ValeriiOctober 6, 2020 at 8:11 am #9348alexg
KeymasterHello,
Unfortunately the
[wallets_rates]
shortcode currently uses the JSON-API, which is available only to logged in users. Therefore it’s not possible at this time to display this shortcode to non-logged in users. This is something that will be solved in wallets 6.0.0, with some architectural changes.In the meantime, if you simply want to hide the error from users who are not logged in, there are two ways to do this:
UI elements that display an error gain the
error
class. Therefore you can add the following to your CSS rules to hide it:.dashed-slug-wallets.error { display: none; }
Alternatively, you can use a WordPress filter to modify the text of the error. The filter is
wallets_ui_text_shortcode_error
. To see an example of how to use it, you can look at the documentation, under “Frontend” -> “Template Modifications” -> “Shortcode rendering error messages”.Hope this helps. Please let me know if I misunderstood your question.
with regards
-
AuthorPosts
- You must be logged in to reply to this topic.