Support

Home Forums Event Espresso Premium Remove iFrame Embed Calendar code from EE > Events

Remove iFrame Embed Calendar code from EE > Events

Posted: May 25, 2017 at 2:46 am


ardiaful

May 25, 2017 at 2:46 am

I’ve using this function in my custom plugin to remove the iFrame Embed calendar text and button that is displayed inside EE > Events:


function tw_ee_filter_embed_buttons_output2( $embed_buttons ) {
	//Remove the calendar embed button for all users other than admins.
	if(! current_user_can( 'manage_options' ) ) {
		unset($embed_buttons['calendar']);
  	}
	return $embed_buttons;
}
add_filter('FHEE__EventEspresso_core_libraries_iframe_display_IframeEmbedButton__addIframeEmbedButtonsSection__embed_buttons', 'tw_ee_filter_embed_buttons_output2', 100, 1);

This function has been working fine for a while, however I recently noticed the iFrame text and button appears again. I have not made any changes in members permissions for manage_options. Please help to remove this again.


Tony

  • Support Staff

May 25, 2017 at 3:18 am

Hi there,

I just tested the snippet on a new test site to confirm it still works and didn’t run into any problems.

Where do you currently have that code on your site?

The capability check is for manage_options which only admins would normally have, so are you viewing the page using an admin account or another role?


ardiaful

May 25, 2017 at 6:37 am

the code is in my custom.php plugin

users do not have manage_options enabled.

I’m viweing the page using a user role other than administrator.


Josh

  • Support Staff

May 25, 2017 at 7:38 am

You could make sure that your custom plugin is activated.

You can also remove the caps check and remove the calendar button for everyone:

function tw_ee_filter_embed_buttons_output2( $embed_buttons ) {
  unset($embed_buttons['calendar']);
  return $embed_buttons;
}
add_filter('FHEE__EventEspresso_core_libraries_iframe_display_IframeEmbedButton__addIframeEmbedButtonsSection__embed_buttons', 
  'tw_ee_filter_embed_buttons_output2', 100, 1);

Finally, there’s a second iframe embed button that’s for embedding an upcoming events list (not the same as the calendar). You can remove both buttons by changing the code to be:

add_filter(
'FHEE__EventEspresso_core_libraries_iframe_display_IframeEmbedButton__addIframeEmbedButtonsSection__embed_buttons', 
  function(){return;},
 100, 1);

The support post ‘Remove iFrame Embed Calendar code from EE > Events’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 2 years, 5 months ago ago

Topic Tags

Tagged: 

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.