Applying and Removing Tags with JavaScript

#Overview

WP Fusion has a basic JavaScript API that lets you apply and remove tags from the current logged in user.

The AJAX methods are apply_tags and remove_tags, and they accept a comma-separated list of tags.

Note, to make use of the wpf_ajax.ajaxurl variable, Link Click Tracking should be turned on in the WP Fusion settings, on the Advanced tab. You can also use your own ajaxurl variable.

#Examples

#Apply tags with JavaScript

var data = {
	'action' : 'apply_tags',
	'tags'   : 'Tag One, Tag Two'
};

$.post(wpf_ajax.ajaxurl, data);

#Remove tags with JavaScript

var data = {
	'action' : 'remove_tags',
	'tags'   : 'Tag One, Tag Two'
};

$.post(wpf_ajax.ajaxurl, data);

Was this helpful?