Favorites 2.5 Delete_All
The Favorites:Delete_All function, when placed in a template, allows your members to delete all of their Favorites at once. To remove all Favorites, link to this template with the entry_id or url_title appended to the link.
Place this loop inside a new template (such as site/delete_all_favorites)
{exp:favorites:delete_all}
Parameters
site=
site="site1|site2"
MSM Only: The "site" parameter is required for sites using Multiple Site Manager. Specifiy multiple sites with pipe character.
weblog=
weblog="weblog_c"
The "weblog" parameter is required when using URL Titles in the URL as they are not unique across weblogs.
Examples
The Favorites:Delete_All function will output a confirm or error message. Below is an example of how a Favorites:Save template might look like (it is possible to add more than the below code to the template):
<p>{exp:favorites:delete_all}</p>
Additionally, as an extra precaution, the below example provided includes a Javascript warning to confirm the delete from another template:
<script type="text/javascript">
function ConfirmDelete(){
var answer=confirm("Are you sure you want to delete all your Favorites? This action cannot be undone!")
if(answer)
window.location="/path_to/delete_all_template/"
}
</script>
<form>
<p><input type="button" value="Delete All Favorites" name="delete_all" onclick="ConfirmDelete()"></p>
</form>