• Resolved beefi1123

    (@beefi1123)


    Is there a way to redirect anonymous users to the login screen when they try to submit an event (I don’t want any anon submissions)? As it is now, it looks terrible and doesn’t offer any information for the user on why they have no rights.

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

    (@angelo_nwl)

    did you already tried to turn-off Events > Settings > General > Event Submission Forms > Allow anonymous event submissions =No ? you can also modify template file at events-manager/templates/forms/event-editor.php

    to use templates: https://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/forms/event-editor.php

    Thread Starter beefi1123

    (@beefi1123)

    Sorry, I didn’t word that very well. I already have anonymous submissions set to ‘No’. The problem is that when an anonymous user tries to submit an event, they are directed to a page which reads, “you don’t have the rights to edit this event.” This doesn’t offer any information to that (probably new) user on where to go next in order to successfully submit an event.

    What I want to do is either add a line onto that page that directs them to login in order to submit, or just redirect them to the login page rather than show that page at all.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can modify template file at events-manager/templates/forms/event-editor.php

    to use templates: https://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/forms/event-editor.php

    Thread Starter beefi1123

    (@beefi1123)

    I just want to make sure I’m doing this correctly. I copied the entire templates folder, but only edited that one php document. Will this still allow the rest of them to update with the plugin?

    Stonehenge Creations

    (@duisterdenhaag)

    No, only files in the plugin folder in wp-content/plugins/ will be updated. Each update only affects the directory of that specific plugin or theme.

    So, if a plugin is updated all the files in that (plugin) folder will be overwritten and manual changes will be lost. If a theme is updated, all files in that (theme) directory will be overwritten.
    If you manually edit/add files to your theme directory (like EM template files) they will be lost when your theme gets an update. If you are using a theme that receives external updates, it’s best to start using a child theme.
    https://www.hostinger.com/tutorials/how-to-create-wordpress-child-theme

    If a plugin is updated, files in your theme folder will remain unchanged. Just like your theme is untouched if a plugin updates.

    When EM calls the function locate_template() it will first look in the correct folder in your theme to see if it is there (its presence is interpreted as being modified). And if present, it will load the file in your theme dir. If not, it will default to the template file in events-manager/templates.

    So, if you copy all template files (also the not-modified ones) to your theme, you will always be left using that version. Updates within EM will be ignored. That is why you should only copy the files you actually edit and modify.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect to Login for Anonymous Submission’ is closed to new replies.