public function enqueueScript($options)
    {
        // Connected hook
        add_action('wp_ajax_'.$options['name'], [&$this, 'hookCallback']);

        // Disconnected hook
        add_action('wp_ajax_nopriv_'.$options['name'], [&$this, 'hookCallback']);

        // Action
        wp_localize_script($options['handle'], $options['name'], $options['args']);
    }
public function enqueueScript($options)
    {
        // Connected hook
        add_action('wp_ajax_'.$options['name'], [&$this, 'hookCallback']);

        // Disconnected hook
        add_action('wp_ajax_nopriv_'.$options['name'], [&$this, 'hookCallback']);

        // Action
        wp_localize_script($options['handle'], $options['name'], $options['args']);
    }
public function enqueueScript ( $ options ) { // Connected hook add_action ( 'wp_ajax_' . $ options [ 'name' ] , [ & $ this , 'hookCallback' ] ) ; // Disconnected hook add_action ( 'wp_ajax_nopriv_' . $ options [ 'name' ] , [ & $ this , 'hookCallback' ] ) ; // Action wp_localize_script ( $ options [ 'handle' ] , $ options [ 'name' ] , $ options [ 'args' ] ) ; }
Hooks and enqueue script.

@param array $options the options
Hooks and enqueue script .