title: Wordpress Plugin Class setup Ajax
body: <p>Im making a plugin using Class , I need to run some Ajax on the Front end. All scripts are queue up correctly. when i trigger the call, i get 400 error.</p>
  
  <pre><code>class CCYTFeatured {
  
  public function __construct(){
          add_action( 'wp_enqueue_scripts', array($this, 'cc_yt_scripts' ));
          add_action( 'wp_ajax_cc_get_featured_yt', array( $this, 'cc_get_featured_yt' ) );
          add_action( 'wp_ajax_nopriv_cc_get_featured_yt', array( $this, 'cc_get_featured_yt' ) );
  
  } 
  public function cc_yt_scripts() {
  
      // JAVASCRIPT
      wp_register_script( 'cc_yt_script',
          plugins_url( '/js/cc_yt.js', __FILE__ ),
          array('jquery'),
          cc_yt_version(),
          true
      );
      wp_localize_script(
          'cc_yt_script',
          'cc_yt_ajax',
          array(
              'ajax_url' =&gt; admin_url( 'admin-ajax.php' )
          )
      );
      wp_enqueue_script('cc_yt_script');
  
  }
  public function cc_get_featured_yt(){
      echo 'SUCCESS!';
      die();
  }
  </code></pre>
  
  <p>My ajax call is: </p>
  
  <pre><code>function start_yt(){
  jQuery('#cc_yt_light_wrap').show();
  // REGISTER NEW ENTRY USING AJAX
  jQuery.ajax({
      url: cc_yt_ajax.ajax_url,
      type: 'POST',
      data: {
          action : 'cc_get_featured_yt',
      },
      async: true,
      success: function(response) {
          console.log(response);
      }
  });
  }
  </code></pre>
  
  <p>Thanks for your help! X)</p>