• Resolved tammo59

    (@tammo59)


    Even when you do not have coupons (in my community this is an unknown concept), they still show up in the interface.

    Please make this optinal, so you can switch off coupons, thereby ” uncluttering” the interface.

    It would help when each different concept in the interface would be encapsulated in a div with a proper class-name, so a themer can switch it off.

    But better would be to make it an optional feature.

    Question: does anyone know how to switch off the Coupons entry in the backend interface?

    Thanks,

    Tammo

    • This topic was modified 6 years, 6 months ago by tammo59.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Tammo,

    EM User here too ??
    It’s only logical that the sub menu item for coupons is added in the Pro version, otherwise you could never create any coupons (without manually creating it in the SQL database of course) ??

    To remove the submenu item add this to your functions.php:
    remove_action('em_create_events_submenu', 'EM_Coupons_Admin::admin_menu',10,1);

    Again, you will not be able to create coupons then anymore… You could choose to wrap it in a condition, hiding it for everyone except admin, for example.

    if( !is_admin() ){ 
    remove_action('em_create_events_submenu', 'EM_Coupons_Admin::admin_menu',10,1);
    }

    Additionally, wrapping it in a div would not help much. The WordPress menu is build rather complex. So, all menu items are always enqueued through functions. That way you can remove any unwanted items easily or add items, like a lot of plugin developers do.

    For example:
    Yoast will create an item in the top bar. And I have created a link to Wordfence’s Live Traffic in the top bar as I use that daily. ??

    Thread Starter tammo59

    (@tammo59)

    Hi, you seem to be awake 25 hours per day.

    Thanks.

    It did remove the menu item, but actually I meant the panel in the interface. See image at: https://ibb.co/gsx3jK

    Tammo (ook hagenees, maar nu even niet)

    Hey stadsgenoot ??

    Ah, I now see what you mean. Yes… It is added in the coupons-admin.php file on line 36. The devs did wrap the “show coupons” in a div id, but not the h4…

    But they do use a function to create that part of the meta box.
    Paste this in your functions.php to remove it:
    remove_action('em_events_admin_bookings_footer',array('EM_Coupons', 'admin_meta_box'),20,1);

    Thread Starter tammo59

    (@tammo59)

    This is great, it works like a charm,

    thank you Patrick!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Make “coupons” optional in the UI’ is closed to new replies.