• Resolved trcwebmaster

    (@trcwebmaster)


    I am trialing the free version of FEU plugin for our community rowing club, and am pretty happy so far.
    I use the standard [register] form with fields for username, password (x2 )and email. I added the email field under the Fields setting as a required field.
    If I now put the shortcode [user-data] on a page, I see just the username. The extended shortcode [user-data field_name=’Email’] (or email) returns nothing.
    Is there a way to access the email field?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hello trc,

    You should always make sure to add the attribute to the shortcode to specify which field you would like to display, and never just the user-data shortcode without any attributes.

    Also, just to make sure, the user-data shortcode only displays content if the person viewing the page is logged in.

    Just so we have a better understanding of the situation, is your user-data shortcode on a page with other shortcodes from our front-end users plugin?

    I ask because, if it’s on a page with the login shortcode, and you do not have a redirect URL set for that shortcode, then, when you log in, you would need to refresh the page to see the user data. It’s for this reason that we recommend redirecting people after login and also recommend using the user-data shortcode on a page that doesn’t have other shortcodes (from our plugin) on it.

    Thread Starter trcwebmaster

    (@trcwebmaster)

    Thanks jaysupport.

    A quick explanation will answer your comments. I’m trying to set up a boat booking service for our rowing club.

    When the user wants to book a boat, the first page they see (Boat booking login) contains [login] and [register] shortcodes.

    If they log in, they are then re-directed to another page (Boat list) containing [restricted] content of a list of boats. This is the page showing the [user-data] shortcode within the [restricted] bounds. So, to see this page, a user is required to be logged in from another page.

    Now, within the [restricted] content, I just used:
    Welcome [user-data]
    and this shows my registered login username.
    If I use:
    Welcome [user-data field_name=’Email’] – or ‘email’ or ‘Username’
    I see nothing

    There are no other FEU shortcodes on this Boat list page. It contains a list of boats. When a boat name is clicked, its own calendar (Appointment Hour Booking plugin) is shown in a popup (Popup Builder), so the logged in user can select a boat, then a date and time for their training session.

    I would like to be able to show the logged in user email so it can be associated with the booking.

    Plugin Support jaysupport

    (@jaysupport)

    Thanks for the explanation. That should work then. If it isn’t working, then either the user isn’t actually logged in, the field name specified isn’t correct or that field has no value for that user.

    You said you placed all of that text in between restricted shortcodes? Does the rest of the restricted text show up? If you log out, can you still see that restricted text? Just trying to determine whether or not you really are logged in.

    Does it make any difference if you use a private browser window or log out of WordPress when you’re trying this?

    The field_name attribute takes the name of the field, and it must be exactly the same as the name of the field as it shows in the Fields tab in the plugin admin. Also, make sure you are using plain text quotes and not ones with formatting (i.e. typing them in and not pasting). You can also try double quotes.

    What happens if you create a new field, set that field for the user-data shortcode, put a value for that field for a user, log in with that user account and go to the page with the user-data shortcode? Does the value show?

    • This reply was modified 1 year, 10 months ago by jaysupport.
    • This reply was modified 1 year, 10 months ago by jaysupport.
    Thread Starter trcwebmaster

    (@trcwebmaster)

    Hi again jaysupport.
    You can mark my reported “issue” as resolved.
    Despite it appearing to me to be a recurring event over a week, the [user-data] shortcode plus attributes now works as you describe.
    I have no idea why this changed. The only change I made subsequent to our posts (apart from a logout of WordPress and re-boot – although I do this every evening) was to place 2 [user-data + atts] shortcodes (one for username and one for email) on the same page. Both worked this morning as expected and again for just the email shortcode.
    Please accept my apologies – I’ll now duck for cover.
    Thanks for your assistance.

    Plugin Support jaysupport

    (@jaysupport)

    That’s no problem at all. I’m just glad to hear it has resolved itself.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to access FE user email’ is closed to new replies.