Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created October 24, 2014 19:52
Show Gist options
  • Save thomasgriffin/4ee7f6bc037536ec15e6 to your computer and use it in GitHub Desktop.
Save thomasgriffin/4ee7f6bc037536ec15e6 to your computer and use it in GitHub Desktop.
Remove Soliloquy license notices and Settings page for handling license keys.
<?php
add_action( 'init', 'tgm_remove_soliloquy_license_stuff', 999 );
function tgm_remove_soliloquy_license_stuff() {
// Do nothing if Soliloquy is not active.
if ( ! class_exists( 'Soliloquy' ) ) {
return;
}
// Remove the Settings menu and license notices.
remove_action( 'admin_menu', array( Soliloquy_Settings::get_instance(), 'admin_menu' ) );
remove_action( 'admin_notices', array( Soliloquy_License::get_instance(), 'notices' ) );
}
@logoscreative
Copy link

FWIW, I had to add checks for the Soliloquy_Settings and Soliloquy_License classes inside of this function (wrapping each remove_action()) to avoid fatal errors in some situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment