Title: Themed profiles module &#8211; script enqueueing
Last modified: August 30, 2016

---

# Themed profiles module – script enqueueing

 *  Resolved [iCosmin](https://wordpress.org/support/users/icosmin/)
 * (@icosmin)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/themed-profiles-module-script-enqueueing/)
 * Hi,
 * Please correctly register and then enqueue the JS for the themed profiles. You
   are now just enqueuing it, you need to register it with a hook first.
 * Try to dequeue the useless file returns an undefined index notice, because there
   is no hook registered.
 * This is the line, in /theme-my-login/modules/themed-profiles/themed-profiles.
   php :
 *     ```
       /**
       	 * Enqueue scripts
       	 *
       	 * @since 6.4
       	 * @access public
       	 */
       	public function wp_enqueue_scripts() {
       		wp_enqueue_script( 'tml-themed-profiles', plugins_url( 'theme-my-login/modules/themed-profiles/themed-profiles.js' ), array( 'jquery' ) );
       	}
       ```
   
 * [https://wordpress.org/plugins/theme-my-login/](https://wordpress.org/plugins/theme-my-login/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/themed-profiles-module-script-enqueueing/#post-6650920)
 * The function `wp_enqueue_script` also registers a script if it’s not registered.
 *  Thread Starter [iCosmin](https://wordpress.org/support/users/icosmin/)
 * (@icosmin)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/themed-profiles-module-script-enqueueing/#post-6651145)
 *     ```
       add_action( 'wp_print_scripts', 'my_deregister_unneeded_js', 100 );
       function my_deregister_unneeded_js() {
   
           // TML Themed profiles
           if ( !is_page( array( 'profile', 'login', 'logout', 'lostpassword', 'register', 'resetpass' ) ) ) {
               wp_deregister_script( 'tml-themed-profiles' );
           }
   
       }
       ```
   
 * … results in these notices being shown (checking with WP_DEBUG):
 *     ```
       Notice: Undefined index: tml-themed-profiles in /var/www/.../wp-includes/class.wp-scripts.php on line 250
   
       Notice: Trying to get property of non-object in /var/www/.../wp-includes/class.wp-scripts.php on line 250
       ```
   
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/themed-profiles-module-script-enqueueing/#post-6651146)
 * I’m not sure why I have that script loading on every page. I’ll have to fix that.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Themed profiles module – script enqueueing’ is closed to new replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/themed-profiles-module-script-enqueueing/#post-6651146)
 * Status: resolved