Skip to content
bonsak edited this page Nov 20, 2012 · 1 revision

delete()

Delete the current item or a specific item by ID.

public function delete ( $id = null )

Parameters

Parameter Type Details
$id int ID of the Pod item to delete

Returns

(bool) Whether the item was successfully deleted

Example

<?php
// Get the book item with an ID of 5
$pod = pods( 'book', 5 );

// Delete the current pod item
$pod->delete();

// Delete a book pod item with the ID of 2
$pod->delete( 2 );

Tutorials and other Resources

Hooking into the Save / Delete process in the Pods API Contributed by owi See examples on how to use filters and actions to hook into the Save / Delete process in Pods API.

Available Since Version

2.0+

See Also