Support » Plugin: Customize WordPress Emails and Alerts - Better Notifications for WP » [edit_post] in notifications generated by non-admins

  • Resolved zymeth25

    (@zymeth25)


    Hi,

    Thanks for this great plugin, it makes my life super easy.

    I have set up an admin notification that is sent every time a new custom post type is “Pending Review”, it includes the [edit_post] shortcode. The posts are created via a front-end form and wp_insert_post, only logged in users (any role) have access to this form but, it’s intended for use by “Subscriber” users.

    When I submit the form from an “Admin” account, everything flies. But when I do it from a “Subscriber” account, the [edit_post] shortcode is replaced with an empty string. I guess it has to do with capabilites check, but is there a way around it?

    Thanks!

    • This topic was modified 6 years ago by zymeth25.
    • This topic was modified 6 years ago by zymeth25.

    The page I need help with: [log in to see the link]

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

    (@voltronik)

    Hi @zymeth25,
    Thanks for your message.

    That sounds plausible. The only thing I can suggest is to create two notifications – one for admins that contain the [edit_post] shortcode and one for subscribers that doesn’t.

    Does this solve your issue?

    Thread Starter zymeth25

    (@zymeth25)

    Thanks for your reply @voltronik

    Yes, that’s what I’ve already implemented. Whenever the form is submitted two emails are sent: the author (usually a Subscriber) receives a simple confirmation notification and the admin receives another one with the edit link. The thing is in that admin notification the edit link doesn’t appear. Only when I submit the form while logged in as admin (which is not intended) the [edit_post] shortcode works.

    Plugin Author bnfw

    (@voltronik)

    Hi @zymeth25,
    Ok, thanks.

    So to clarify:
    1. You post as a subscriber on the front-end and two emails are sent – one to the subscriber and one to the admin (which contains a working edit post shortcode).
    2. If you post via the WP Admin as an admin, the notifications are sent but the admin notification doesn’t contain a working edit post shortcode.

    Have I understood that right?

    Thread Starter zymeth25

    (@zymeth25)

    No, sorry for being unclear, it’s close to what you wrote but the exact scenario is:

      1. You post as a subscriber on the front-end and two emails are sent – one to the subscriber and one to the admin (which contains a non working edit post shortcode).
      2. If you post as an admin still on the front-end, the notifications are sent and the admin notification does contain a working edit post shortcode.

    If I create a “Pending review” post via WP Admin everything also works. Subscribers don’t (and I don’t want them to) have access to WP Admin post editing so that’s not an issue.

    • This reply was modified 6 years ago by zymeth25.
    Plugin Author bnfw

    (@voltronik)

    Hi @zymeth25,
    Thanks for clarifying.

    I’ve now been able to re-create this so i’m going to add it to my list of things to look into for March.

    I’ll let you know how I get on soon.

    Thread Starter zymeth25

    (@zymeth25)

    Great! Thanks for looking into it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[edit_post] in notifications generated by non-admins’ is closed to new replies.