woocommerce - How to call wordpress function directly from url? -


i have added custom payment method woocommerce , working fine . have 1 problem calls callback url saving transaction information db. have created new function in plugin file cant excess directly . how have done it:

//add_action('wp_ajax_nopriv_payment_callback_action', 'payment_callback_action');

//function function payment_callback_action() { echo "its working!"; }

i trying access : url:"<?=site_url( '/' );?>wp-admin/admin-ajax.php?action=payment_callback_action

it seemd because of dnt have privillage use directly how can ?.

# users not logged in add_action('wp_ajax_nopriv_payment_callback_action', 'dixipay_callback_action');  # users logged in add_action('wp_ajax_payment_callback_action', 'dixipay_callback_action');  # callback function dixipay_callback_action() {    echo "its working!";  } 

read more: http://codex.wordpress.org/ajax_in_plugins


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -