Events+ avoiding backend entry

Hello,

I am in the process of configuring the event+ pluing for my site as I am going through I am running into some issues. I am using it with buddypress and group events.

I would like to avoid members going to the backend of wordpress. Most of the links to add events work correctly by directing the member to a front end form. There is one link however in the admin bar, under "+New >> Event" that takes the user to the backend form.

How do I get rid of this link?

Are there any other ways that I may not know of that will take the user to the backend form?

  • Brian Purkiss
    • Smushie Pies

    There isn't a way within the plugin to change or remove that link.

    You would need to manually change that link in the plugin code (which will revert when you update the plugin) or deactivate the admin bar entirely.

    Here's a tutorial in how to deactivate the Admin Bar for all users: http://www.wpbeginner.com/wp-tutorials/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators/

    I am not aware of any other ways for the user to end up on the WordPress backend.

  • landshark
    • Flash Drive

    Do you have any guidance on the first option?

    I realize the drawback of that method but the admin bar is important to using the site unless there is another way to easily communicate things like message notifications to users.

    Is there a specific place to make recommendations for a feature request to either have the link under the +new menu optional.

  • Vladislav
    • Dead Eye Dev

    Hello,

    To remove only this particular from your admin toolbar (+ New > Event), you can use this code:

    function eab__remove_backend_access_from_admin_bar () {
    	global $wp_admin_bar;
    	$wp_admin_bar->remove_node('new-incsub_event');
    }
    if (!is_admin()) add_action('admin_bar_menu', 'eab__remove_backend_access_from_admin_bar', 999);

    You can either add this to your theme's functions.php, or create a .php file in your wp-content/mu-plugins directory (just create it if it doesn't exist) and paste this in.

  • landshark
    • Flash Drive

    Vladislav,

    That worked to a degree, It removed the "events" link. But if you click on the +New itself, it takes you to the backend events form. Any thoughts?

    Heck I'd be happy to just remove the +new all together, if that's possible.

  • landshark
    • Flash Drive

    Ok, I found a piece of code, I changed and it seems to work. Just don't know if it is proper.

    function ipstenu_admin_bar_remove() {
            global $wp_admin_bar;
    
            /* Remove their stuff */
            $wp_admin_bar->remove_menu('new-content');
    }
    
    add_action('wp_before_admin_bar_render', 'ipstenu_admin_bar_remove', 0);

    By "worked" I mean it removed the "+New" all together which is fine for me. Credit goes to this blog post http://halfelf.org/2011/customize-wp-admin-bar/

  • aecnu
    • WP Unicorn

    Greetings landshark,

    Knock, Knock - Housekeeping --> Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.