/** * Returns WordPress AJAX requests URL. * * E.g.: https://example.com/wp-admin/admin-ajax.php * * @see https://wpcodebook.com/wordpress-ajax-url/ * @see https://developer.wordpress.org/plugins/javascript/ajax/#url * @see https://developer.wordpress.org/reference/functions/admin_url/ */ function wpcodebook_ajax_url() { return admin_url( 'admin-ajax.php' ); }