Remove tribetickets metabox from admin not working

Home Forums Ticket Products Event Tickets Plus Remove tribetickets metabox from admin not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1338142
    David Hager
    Participant

    Hi I have created a custom user for my site and I would like to give it restricted access to certain areas and everything seems to work fine, but some of your metaboxes are not respecting my code, do you have any idea why they are not working like WordPress has intended them to work?

    Here is a snippet of my code with a comment behind hem if they work or not

    remove_meta_box( 'tribe_events_event_details', 'tribe_events', 'normal' ); // Works
    remove_meta_box( 'tribetickets', 'tribe_events', 'normal' ); // Not working

    Removing the meta box tribe_events_event_details works fine, but removing the meta box tribetickets doesn’t work. Has the Event ticket (plus) plugin an other way to add the metaboxes to the page and if so why is that?

    Here is the full code block with some lines working and some are not

    function coordinator_remove_meta_boxes() {
    	if ( current_user_can( 'coordinator' ) ) {
    		remove_meta_box( 'tagsdiv-post_tag', 'tribe_events', 'side' ); // Works
    		remove_meta_box( 'postexcerpt', 'tribe_events', 'normal' ); // Works
    		remove_meta_box( 'authordiv', 'tribe_events', 'normal' ); // Works
    		remove_meta_box( 'tribe_events_event_details', 'tribe_events', 'normal' ); // Works
    		remove_meta_box( 'tribetickets', 'tribe_events', 'normal' ); // Not working
    		remove_meta_box( 'tribe_events_event_options', 'tribe_events', 'side' ); // Works
    		remove_meta_box( 'tribe_events_catdiv', 'tribe_events', 'side' ); // Works
    	}
    }
    add_action( 'admin_menu', 'coordinator_remove_meta_boxes' );
    #1338763
    Andras
    Keymaster

    Hello atmedia,

    Thanks for reaching out with your question!

    I checked the code and it looks like that metabox is somehow added with javascript.

    Good news is, that is a template file for which you can create a template override. You will find more information on how you can do this in our Themer’s Guide.

    Basically you will need to create an override for this file:

    wp-content\plugins\the-events-calendar-eventbrite-tickets\src\views\eventbrite\eventbrite-meta-box-extension.php

    in this location:

    wp-content/themes/[your-theme]/tribe-events/eventbrite/eventbrite-meta-box-extension.php

    Hope this helps. Let me know if you have further questions.

    Andras

    #1338943
    David Hager
    Participant

    Thanks for your feedback, weird that it is not loaded the way WordPress intended it to work, this is really confusing if you are not consistent across your plugins.

    I had already fixed it by displaying: none; the metabox, because there were a lot of other UI elements that couldn’t be disabled the normal way either.

    #1339001
    Andras
    Keymaster

    I’m sure the developers had quite a good reason to do it this way and not the normal WordPress way. I believe it is because that interface part is connected to EventBrite and needs to pull data from there, and likely this was the solution to do that properly.

    Anyway, I’m glad to hear you managed to solve it. Good job on that one!

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic in the forum and we will help you out.

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Remove tribetickets metabox from admin not working’ is closed to new replies.