Skip to main content
added 160 characters in body
Source Link
function getAjax() {
  wp_register_script('ajax_url_script', get_template_directory_uri() . '/js/edit.js', array('jQuery'));
  wp_localize_script( 'ajax_url_script', 'postAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )));
 
  wp_enqueue_script( 'ajax_url_script');
}
add_action( 'wp_enqueue_scripts', 'getAjax' );
function getAjax() {
wp_localize_script( 'ajax_url_script', 'postAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )));
 
wp_enqueue_script('ajax_url_script');
}
function getAjax() {
  wp_register_script('ajax_url_script', get_template_directory_uri() . '/js/edit.js', array('jQuery'));
  wp_localize_script( 'ajax_url_script', 'postAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )));
  wp_enqueue_script( 'ajax_url_script');
}
add_action( 'wp_enqueue_scripts', 'getAjax' );
added 210 characters in body
Source Link

Edit 2:

function getAjax() {
wp_localize_script( 'ajax_url_script', 'postAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )));

wp_enqueue_script('ajax_url_script');
}

Edit 2:

function getAjax() {
wp_localize_script( 'ajax_url_script', 'postAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )));

wp_enqueue_script('ajax_url_script');
}
added 448 characters in body
Source Link

Edit:

var_dump($_REQUEST); on the page that is outputting the data in the table gives array(0){}twelve times-- the same number of items that I'm printing in the table.

var_dump($_REQUEST); on functions.php doesn't print anything

console.log(response) on JS file prints 0.

Regardless if I put var_dump($_REQUEST) in the if statement (before $wpdb->update) or before the if statement, nothing gets printed.

Edit:

var_dump($_REQUEST); on the page that is outputting the data in the table gives array(0){}twelve times-- the same number of items that I'm printing in the table.

var_dump($_REQUEST); on functions.php doesn't print anything

console.log(response) on JS file prints 0.

Regardless if I put var_dump($_REQUEST) in the if statement (before $wpdb->update) or before the if statement, nothing gets printed.

added 14 characters in body
Source Link
jgraup
  • 9.8k
  • 3
  • 32
  • 68
Loading
Source Link
Loading