Snippet or function to hide the Ticket Header in the backend?

Home Forums Ticket Products Event Tickets Plus Snippet or function to hide the Ticket Header in the backend?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1011373
    James O’Sullivan
    Participant

    Hi there, I was just wondering if there was a snippet or function that could be added to the functions.php file to hide the ticket header message and upload field in the backend of Woocommerce tickets. The reason I ask is because my users who are creating event tickets tend to add a header image from time to time but what I have discovered is that when attendees arrive at the events with their mobile phones it just tends to be a frustration when viewing the ticket on the mobile screen than a help so I would just like to hide this altogether with a function is possible. This would be very handy indeed.

    To be clear its the header image field on a ticket and the message ” Upload image for the ticket header. The maximum image size in the email will be 580px wide by any height, and then scaled for mobile. If you would like “retina” support use an image sized to 1160px wide.”

    Thanks in advance.

    #1011662
    Brian
    Keymaster

    Hello,

    Thanks for your reply today with the other user.

    I can help out here.

    There is not filter or action to be able to remove this section.

    However, I got this CSS to work for me.

    Add this to your theme’s functions.php and it will only load on the Single Event Editor.

    /*
    * Hide Ticket Header
    * @version 1.0
    */
    add_action( 'admin_head', 'tribe_hide_ticket_header' );
    function tribe_hide_ticket_header() {
    $screen = get_current_screen();

    if ( 'tribe_events' == $screen->id ) {
    echo '

    ';
    }
    }

    Let me know how that works out.

    Thanks

    #1011791
    James O’Sullivan
    Participant

    Thanks Brian, appreciate the feedback here as I realize its a little tricky for sure. This function has certainly opened up doors for me now in terms of hiding things via css through a function. I tried it and it worked so to speak however everthing is now hidden including the ticketing form so its not ideal as you can see here, when you insert a new ticket, well it just does not show at all as its hidden: http://i58.tinypic.com/24lvsdg.jpg

    I then altered your code a little for a new class and still not working – it seems tricky to isolate the right class here to hide to be honest. This is what I tried:

    add_action( ‘admin_head’, ‘tribe_hide_ticket_header’ );
    function tribe_hide_ticket_header() {
    $screen = get_current_screen();

    if ( ‘tribe_events’ == $screen->id ) {
    echo ‘<style type=”text/css”>
    #tribetickets #event_tickets .tribe_sectionheader{display:none!important;}
    </style>’;
    }
    }

    #1011915
    Brian
    Keymaster

    I guess I should have tested on an event with tickets.

    I modified the css in my original snippet. Let me know if that works.

    It hide the header image for me, but showed the tickets.

    Cheers

    #1016524
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Snippet or function to hide the Ticket Header in the backend?’ is closed to new replies.