The plugin makes it very easy to programmatically create a new wishlist at any time and anywhere in code. To create a new wishlist, simply instantiate the wishlist class, set the properties of the new wishlist, and save.
$wishlist = new NMGR_Wishlist(); $wishlist->set_title('My wedding list'); $wishlist->set_first_name('John'); $wishlist->set_last_name('Mark'); $wishlist->save();
Settting the properties of the new wishlist is completely optional. If any properties are not set, the default properties set by the plugin would be used. The save method must be called at the end for the wishlist to be registered in the datatabase.