Title: WP 3.8 theme customizer error
Last modified: August 21, 2016

---

# WP 3.8 theme customizer error

 *  Resolved [Dimoncheg777](https://wordpress.org/support/users/dimoncheg777/)
 * (@dimoncheg777)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/wp-38-theme-customizer-error/)
 * Hi there.
    I’m trying to make some customizer for my theme, but i’ve got JS error“
   Uncaught ReferenceError: wp is not defined ” LOL. I wrote all code based on Codex,
   maybe it is just WP 3.8 bug? Or what i’m doing wrong?
 * my code – PHP:
 *     ```
       add_action( 'customize_preview_init', 'customizer_preview' );
   
       function customizer_preview() {
               wp_register_script( 'wproto-customizer-preview', get_template_directory_uri() . '/js/admin/screen-customizer.js', '', true );
               wp_enqueue_script( 'wproto-customizer-preview', array( 'jquery', 'customize-preview' ) );
       }
       ```
   
 * JS:
 *     ```
       ( function( $ ) {
   
           // here i've got an error "wp is not defined"
           wp.customize( 'blogname', function( value ) {
               value.bind( function( newval ) {
                   $( '#text-logo .site-title' ).html( newval );
               } );
           } );
       } )( jQuery );
       ```
   
 * please help 🙂

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

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/wp-38-theme-customizer-error/#post-4424798)
 * Change this:
 *     ```
       add_action( 'customize_preview_init', array( 'customizer_preview' );
       ```
   
 * To this:
 *     ```
       add_action( 'customize_preview_init', array( $this, 'customizer_preview' ));
       ```
   
 * I’m assuming you’re writing this function inside a class?
 *  Thread Starter [Dimoncheg777](https://wordpress.org/support/users/dimoncheg777/)
 * (@dimoncheg777)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/wp-38-theme-customizer-error/#post-4424799)
 * you’re right, i wrote this function in class, but it doesn’t matter, I just simplified
   the code here. p.s. i got JS error 🙁

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

The topic ‘WP 3.8 theme customizer error’ is closed to new replies.

## Tags

 * [theme customizer](https://wordpress.org/support/topic-tag/theme-customizer/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Dimoncheg777](https://wordpress.org/support/users/dimoncheg777/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/wp-38-theme-customizer-error/#post-4424799)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
