Support

Home Forums Event Espresso Premium Remove iFrame Code text from New Event Admin

Remove iFrame Code text from New Event Admin

Posted: March 3, 2017 at 3:36 am

Viewing 8 reply threads


ardiaful

March 3, 2017 at 3:36 am

I need to remove the text “iFrame Embed Code” and the text and button below from Event Admin via CSS, without affecting any other style in the website. See screenshot.
http://imgur.com/a/urc79


Tony

  • Support Staff

March 3, 2017 at 5:04 am

Hi there,

is there a reason you want to do this with CSS? You can not easily hide the button with CSS but you can remove it with a snippet:

https://gist.github.com/Pebblo/bcbe0f50ed5d1457cf843feb43545b13

If you add that to a Custom Functions Plugin it will remove the calendar imbed button (which is the one you show in the screenshot) from the event list table.


ardiaful

March 3, 2017 at 6:00 am

Actually, I want to keep the “iFrame code” text displayed and the button available in my admin account, but remove it from event organizers admin. That’s why I would prefer to use CSS instead, understanding that if I use the snippet this will remove it also from my admin account.


Tony

  • Support Staff

March 3, 2017 at 6:16 am

As it is it will, but you can just wrap the unset() call within a current_user_can( 'manage_options' ); conditional. So:

if(! current_user_can( 'manage_options' ) ) {
	unset($embed_buttons['calendar']);
}
return $embed_buttons;

That will remove the embed button for any user that doesn’t have the ‘manage_options’ capability, which only ‘Admins’ should have.


ardiaful

March 3, 2017 at 7:16 am

in functions.php? it does not seem to work


Tony

  • Support Staff

March 3, 2017 at 7:25 am

It does work within functions.php, I’m using it on a test site currently.

Are you logged into a user that does NOT have the manage_options capability to view if it is removed?

Failing that you may need to move the function into Custom Functions Plugin as mentioned in my above reply.

Are you looking within Event Espresso -> Events?


ardiaful

March 3, 2017 at 8:11 am

but the code above does not have any function statement, only the conditional. Am I missing something?


Tony

  • Support Staff

March 3, 2017 at 8:30 am

Yes, you’re missing my first reply: https://eventespresso.com/topic/remove-iframe-code-text-from-new-event-admin/#post-234327

You need the function from that, with the extra conditional.

I’ve added a second file to the gist that shows you the full function, see:

https://gist.github.com/Pebblo/bcbe0f50ed5d1457cf843feb43545b13#file-function2-php


ardiaful

March 3, 2017 at 9:25 am

Thank you Tony! that works now good for me.

Viewing 8 reply threads

The support post ‘Remove iFrame Code text from New Event Admin’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso