• Resolved mariwnm

    (@mariwnm)


    I have a custom post type Flower on my website. Users can create new Flowers and/or upload photos for a given flower that are reviewed by an editor. I’d like the notification message that the editor receives to identify who uploaded a photo (Flower Updated). I thought that [display_name] would do that, but instead I get the display name of the person who created the Flower. Is a custom shortcode the only way to get this info into the notification? If so, please expand on the stub provided in the documentation. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @mariwnm,
    Thanks for your message.

    You can use any of the user_ or email_user shortcodes mentioned in the documentation. This should give you the information you’re looking for.

    Let me know how you get on.

    Thread Starter mariwnm

    (@mariwnm)

    The user codes (display_name, user_firstname, user_lastname) are giving me the info for the original author, not for the current user making the change.

    Plugin Author bnfw

    (@voltronik)

    Hi @mariwnm,
    So you’re looking for details of who the email is going to, rather than the author of the original post, is that correct?

    If so, can you try the email_user_ shortcodes instead?

    Thread Starter mariwnm

    (@mariwnm)

    No, that’s not correct. I have two different “authors”, (1) the person who posted the flower, and (2) the person who added a flower photo (an update). I just need a shortcode for the display name of the “current user” who triggered an update notification. Right now, all of your “user” shortcodes come back with data on the person who posted the flower, not the current user.

    Plugin Author bnfw

    (@voltronik)

    Hi @mariwnm,
    Ok, I understand now.

    Have you tried [post_update_author]?

    Thread Starter mariwnm

    (@mariwnm)

    I don’t get any user’s name from [post_update_author]. (I modified a name field for one of the flowers instead of a photo this time.) Please check your code.

    Plugin Author bnfw

    (@voltronik)

    Hi @mariwnm,
    Did you try the email_user_ shortcodes instead? These are different to the user_ shortcodes.

    Thread Starter mariwnm

    (@mariwnm)

    None of your suggestions worked for me. What did work is creating three notifications: (1) post added (Flower), (2) post updated (Flower) and (3) new media published (a flower photo). The current user I was looking for is the media_author. (FYI, I can get the media_title but not the media_caption.)

    Plugin Author bnfw

    (@voltronik)

    Hi @mariwnm,
    I’m glad you got it working in the end using your method.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Current user shortcode’ is closed to new replies.