verygoodplugins

Untitled

Nov 9th, 2020
570
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wpf_wpe_bug_enqueue_scripts() {
  2.  
  3.     wp_enqueue_script( 'wpf-wpe-bug', plugin_dir_url( __FILE__ ) . 'main.js', array( 'jquery' ), '1.0' );
  4.  
  5.     $localize_data = array(
  6.         'ajaxurl' => admin_url( 'admin-ajax.php' ),
  7.     );
  8.  
  9.     wp_localize_script( 'wpf-wpe-bug', 'wpf_ajax', $localize_data );
  10. }
  11.  
  12. add_action( 'wp_enqueue_scripts', 'wpf_wpe_bug_enqueue_scripts' );
  13.  
  14. function test_wpe_bug() {
  15.  
  16.     echo get_current_user_id();
  17.  
  18.     die();
  19.  
  20. }
  21.  
  22. add_action( 'wp_ajax_wpf_wpe_bug_test', 'test_wpe_bug' );
  23. add_action( 'wp_ajax_nopriv_wpf_wpe_bug_test', 'test_wpe_bug' );
  24.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×