Embed Javascript code to registered users only
WordPress provides the Conditional Tags. I think is_user_logged_in() tag will work for you. List of conditional tags available. if ( is_user_logged_in() ) { // include the JavaScript File } UPDATE: Also if you want to check the user roles etc.. you can use the current_user_can() you can check both the both roles and capabilities. Better … Read more