Home › Forums › Ticket Products › Event Tickets Plus › Customizing the admin-views/meta-box.php file
- This topic has 5 replies, 4 voices, and was last updated 9 years, 4 months ago by
Paul.
-
AuthorPosts
-
November 19, 2016 at 4:08 am #1194825
Paul
ParticipantHello 🙂
In this thread:
I asked if it was possible to remove the RSVP option, as we only sell our tickets using Woo.Rather than remove the RSVP option all together, I have simply made WooCommerce the default selected radio button (it’s normally RSVP) by editing the file Geoff pointed me to:
/wp-content/plugins/event-tickets/src/admin-views/meta-box.phpAll I have done is change true to false on line 131 and false to true on line 139. This works great but as Geoff pointed out, it gets overwritten when I update.
I have previously managed to do some customisations which do not get overwritten when I update by following your tutorial here:
https://theeventscalendar.com/knowledgebase/themers-guide/
I simply place my customised files into:
/wp-content/themes/my-child-theme/tribe-events
and my customizations persist after updates. 🙂I cannot figure out how to do it with the meta-box.php file. Is there a particular folder hierarchy I should be using to put my modified meta-box.php file into?
As always, many thanks for your help.
Paul.
November 21, 2016 at 11:25 am #1195442Nico
MemberHi Paul,
Thanks for getting in touch with us! I’ll help you here…
Unfortunately the template override method is not available for admin views (although we are exploring this possibility). So the options here are:
1) Re-do your customization after every update.
2) Explore alternatives (probably JS snippet) to do the same thing from outside the core files. I can help you getting started with this one.
Please let me know about it and I’ll help as possible,
Best,
NicoNovember 21, 2016 at 11:10 pm #1195650Paul
ParticipantHi Nico,
Thanks for your reply.
I’ve never really explored JS so I would need some help getting started with that.
If you could point me in the right direction I would be very grateful.
Paul.
November 24, 2016 at 3:54 am #1196941Nico
MemberHey Paul,
Don’t worry about it! I just coded a basic sample for you 😉
Just paste the code below in your theme’s (or child theme’s) functions.php file:
/* Tribe, remove RSVP tickets option from event page in the admin */
function tribe_remove_rsvp() {// check if it's a Tribe admin page
$screen = get_current_screen();if( !isset($screen->ID) || $screen->ID != Tribe__Events__Main::POSTTYPE ) return;
// switch default provider and hide RSVP
?><script type="text/javascript">
jQuery(document).ready(function($){
if ( $('input.ticket_field[value="Tribe__Tickets_Plus__Commerce__WooCommerce__Main"]').length ) {
$('input.ticket_field[value="Tribe__Tickets_Plus__Commerce__WooCommerce__Main"]').click();
$('input.ticket_field[value="Tribe__Tickets__RSVP"]').hide().next().hide();
}});
</script>
<?php }
add_action('admin_head', 'tribe_remove_rsvp');
Give it a try and let me know if it works for you,
Best,
NicoDecember 16, 2016 at 8:35 am #1207077Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Customizing the admin-views/meta-box.php file’ is closed to new replies.
