• Resolved richyvoc

    (@richyvoc)


    Hi,
    I can’t get the plugin to use the current user as the author.
    I tried by leaving the field empty, then I tried again with
    [email* your-email default:user_email]
    your-email as the value. In every case it is the admin that is the author of the post.
    Any ideas why this is doing that? I have read that it is supposed to default to the current logged in user so I am at a loss.
    Thanks for any help.
    Rich

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    can’t get the plugin to use the current user as the author.

    if the current user does not have author rights then it will default back to the admin user.

    your-email as the value. In every case it is the admin that is the author of the post.

    again, the email must belong to a user that has author rights to work.

    Can you confirm this is the case?

    Thread Starter richyvoc

    (@richyvoc)

    Hi, Thanks for answering. I thought of that, so I installed User Role Editor. I gave authoring permissions to the subscribers, and I also tried to create users as authors automatically, but that doesn’t seem to function. So yes, in theory all logged in user have author priveledges. Unfortunately, every custom post that is created does not reflect that.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    oh, that very odd.

    Are you working on a local server or is your website online? If so can you share the page with the form on it?

    Thread Starter richyvoc

    (@richyvoc)

    credentiels removed. sorry

    • This reply was modified 5 years ago by richyvoc.
    Plugin Author Aurovrata Venet

    (@aurovrata)

    then I tried again with
    [email* your-email default:user_email]
    your-email as the value.

    currently this would not work, the mapped field must contain a user id (integer) for this option to work. This is something I plan to fix a later release.

    If your form has not fields mapped to the auhtor, then

    – the plugin set the current user if they have ‘edit_posts’ capability (admin, editor, author, contributor roles haev it).
    – else it defaults to the admin user (id=1).

    At the time of submission, (for new submissions, not submission of previously saved posts) you can modify the author by using the filter provided (#11) in the post-submission list provided in the map edit page (see screenshot #8)

    I have tested this again on my local server and it works fine.

    Thread Starter richyvoc

    (@richyvoc)

    Thank you. Must I remap the form and not indicate the author to use your filter. Or can I just try to change the field to ouput the user id instead of the user email?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    @richyvoc please remove your user/pw details post immediately, this is really dangerous to share over a public forum. I realise it’s only for page access and not the credentials for the dashboard acccess, but it should not be put out in the public arena ??

    You can reach out to me on vrata at syllogic dot in if you need to give me a page access, but please don’t share such credentials in the forum as this something WordPress forum take very seriously.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Must I remap the form and not indicate the author to use your filter.

    yes you do

    Plugin Author Aurovrata Venet

    (@aurovrata)

    So I had a look at your page (https://preprod10.groupepointsrezo.fr/demarrer-mon-projet/), and your 3rd form (you have a login, register and project form), the project form has its author set to 1 (admin) because I am not logged into the page.

    Once I log in using the credentials you provides (web at zesting…) the form author is now set to auhtor id=5 (which I am assuming is the user I logged into as.

    SO if you do not map any form field to the author in your map edit page, it should create a new post under that author.

    Can you please try and report back.

    Thread Starter richyvoc

    (@richyvoc)

    Thanks again. I just set it up and it worked. Thank you. I considered this resolved.

    While I have your attention, I am using cf7_2_post_filter for the content. Can I put this filter in a snippet directly in my cpt single post or must I leave it in functions. I am having a lot of problems with variable scope concerning variables in the functions.php file

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Thanks again. I just set it up and it worked. Thank you. I considered this resolved.

    great, please leave a review when you have a minute to spare.

    Can I put this filter in a snippet directly in my cpt single post

    I don’t know what you mean by that. The filter needs to be registered prior to the submission process, hence either in a plugin file or in the theme’s functions.php or the page template file which loads the form will work as well.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Author field is not resolving to current user’ is closed to new replies.