Created
October 24, 2014 19:52
-
-
Save thomasgriffin/4ee7f6bc037536ec15e6 to your computer and use it in GitHub Desktop.
Remove Soliloquy license notices and Settings page for handling license keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.