Last active
April 25, 2017 18:35
-
-
Save mariadanieldeepak/5d935b24ee9d8b2cb311dd4983242759 to your computer and use it in GitHub Desktop.
This file contains 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
function my_theme_remove_optins() { | |
if ( is_user_logged_in() ) { | |
wp_enqueue_script( 'remove-optin', 'remove-optin.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ) ); | |
} elseif ( wp_script_is( 'remove-optin', 'enqueued' ) ) { | |
// This check is needed to show the Optin. | |
wp_dequeue_script( 'remove-optin' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'my_theme_remove_optins' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment