function toria_add_ajax(
	$mode = 'private',
	$ajax_variables = array(),
	$nonce = 'my_custom_value_submission_test',
	$ajax_object = 'toria',
	$ajax_handle = '',
	$script_depends = array(),
	$script_version = false,
	$script_in_footer = true


Adds Ajax scripts and their associated actions and callback



The name of the Ajax action.


PHP function to respond to ajax calls.


File path containing you Javascript file.


(string) Determines if the script will be exposed to authenticated Ajax actions for logged-in users or non-authenticated Ajax actions for logged-out users or both. Using both, private, and public.


Variables to be passed to be available for JS to utilize.


(string) Used to create WP nonce for verification on PHP callback.


(string) Name of object to be storing JS variables.


Name of script.


(string[]) (Optional) An array of registered script handles this script depends on. Default value: array().


A string specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If the version is set to false, a version number is automatically added equal to the current installed Tori Ajax version. If set to null, no version is added. Default value: false.


(bool) (Optional) Whether to enqueue the script before <body> instead of in the <head>. Default ‘false’.


(bool) Whether it is added or not.