FeatureModule API
Implementing your API is a simple matter. The required file is frontend.php.
namespace SiteMap; function SiteMapApi($data){ switch($data['action']){ case 'CheckMaps': return CheckMaps($data); case 'AddToRobots': return AddToRobots($data); default: return NULL; } }
Simply change SiteMap to your FeatureModule name and SiteMapApi to YourModuleNameApi and thats it.
Calling from the client can be
$.getJSON( WPR.ajaxurl, { controller: "SiteMap", action: "CheckMaps" }, function(data){ $('#MapLoc').html(data.objectContents[0]); $('#IndexLoc').html(data.objectContents[1]); } );