WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] "Create New" Button on main events page (6 posts)

  1. Donald McIntyre
    Member
    Posted 2 years ago #

    [Events Manager]

    Hello, how can I add the "Create New" button on the main events page. At this moment users can only create a new event by going to their page on BuddyPress:

    Profile > Events > My Events > Create New

    But I would like to put that button in the Events page so they have an easier access to create new events.

    Thx! Donald.

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    for BP it's tricky because the urls are always in the form of /members/username/events/... where username is different for each user.

    you'd have to do this with PHP at the moment and generate the link that way.

  3. Donald McIntyre
    Member
    Posted 2 years ago #

    Yes, I see, I copied the code from where the other button is on the

    Profile > Events > My Events > Create New

    page which is located at the file: my-events.php, the code is:

    <?php if(current_user_can('edit_events')): ?>edit/" class="button add-new-h2"><?php _e('Add New','dbem'); ?><?php endif; ?>

    Tried pasting it on the main page PHP, but didnĀ“t work. I am not a developer so I guess I have to keep trying until I hit the correct PHP code format.

    If you could tell me how to write that I would be thankfull, my email is donald@dmcintyre.com

    Cheers and thank you!!

    Donald.

  4. Donald McIntyre
    Member
    Posted 2 years ago #

    The code is

    /** <?php if(current_user_can('edit_events')): ?>edit/" class="button add-new-h2"><?php _e('Add New','dbem'); ?><?php endif; ?> **/

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    it's a bit more complicated than that. You need to use the global $bp->logged_in_user... object, maybe someone can pitch in

  6. cdomurad
    Member
    Posted 1 year ago #

    Donald any update on whether the code you posted was a viable solution to your issue?

    Also if it was where is the template file that you had to put it in.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic