Feature #2260
closed
Hide Google Calendar Plugin
Added by Sarah Morgano over 12 years ago.
Updated over 12 years ago.
Category name:
WordPress (misc)
Description
The Google Calendar plugin currently active on the Commons is no longer valid, though it is in use by some of our members, as of April 2012, Google no longer provides the API key necessary to make this work. Can you please leave this as an active plugin on the site, but hide it from the list of searchable plugins?
- Assignee changed from Boone Gorges to Dominic Giglio
Dom - same technique as cforms :)
Boone,
I've linked this issue with the associated plugin hiding and Google Calendar related issues.
I've updated the hiding function to be a little more flexible incase we want to hide additional plugins in the future:
/**
* Prevent specific plugins from being activated on the Commons.
* To add additional plugins simply add their paths the the $dissabled_plugins
* array.
*/
function cac_hide_plugins( $plugins ) {
$dissabled_plugins = array(
'cforms/cforms.php',
'wpng-calendar/wpng-calendar.php'
);
foreach ( $dissabled_plugins as $dissabled_plugin )
if ( array_key_exists( $dissabled_plugin, $plugins ) )
unset( $plugins[$dissabled_plugin] );
return $plugins;
}
add_filter( 'all_plugins', 'cac_hide_plugins' );
I haven't pushed this code to the repo yet incase you notice something I've missed that may cause problems. I'm leaving all these issues open for now, so we have a chance to discuss after the CBox release but before the 1.4.11 release.
Dom, this technique looks great. If it's working on your local, go ahead and commit it as a fix for this ticket and the CForms ticket.
- Status changed from New to Resolved
Also available in: Atom
PDF