Skip to content

Instantly share code, notes, and snippets.

@Screenfeed
Created December 17, 2014 09:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Screenfeed/13cea8345503acc871dc to your computer and use it in GitHub Desktop.
Save Screenfeed/13cea8345503acc871dc to your computer and use it in GitHub Desktop.
Keeping your shit at home is fine. Spreading it everywhere is not.
// !WordPress Plugin "Leaflet Maps Marker"
if ( class_exists( 'Leafletmapsmarker' ) ) :
// !Remove the fuckin' ad from the plugins list (I'm not paid to do that, it just makes me happy). Next time, follow WP guidelines. Kisses =)
add_action( 'admin_print_styles-plugins.php', 'sf_remove_fuckin_maps_maker_ad_from_plugins_list' );
function sf_remove_fuckin_maps_maker_ad_from_plugins_list() {
global $wp_filter;
if ( ! empty( $wp_filter['plugin_row_meta'][10] ) ) {
foreach ( $wp_filter['plugin_row_meta'][10] as $uniq_id => $atts ) {
if ( is_array( $atts['function'] ) && is_a( $atts['function'][0], 'Leafletmapsmarker' ) && $atts['function'][1] === 'lmm_plugins_page_add_links' ) {
remove_action( 'plugin_row_meta', $uniq_id, 10 ); // Head shot.
wp_deregister_style( 'leafletmapsmarker-plugin-styling' );
return;
}
}
}
}
// !Remove another fuckin' ad from the admin menu. YAY!
add_action( 'admin_menu', 'sf_remove_fuckin_maps_maker_ad_from_menu' );
function sf_remove_fuckin_maps_maker_ad_from_menu() {
remove_submenu_page( 'leafletmapsmarker_markers', 'leafletmapsmarker_pro_upgrade' );
}
endif;
// You're welcome :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment