Delete an item from the Pod.
⚠️
Warning:
Running this method does NOT trash an item, it deletes it and their meta/relationships entirely. Be sure to back up your data before testing this.
Function Definition
public function delete ( $id = null )
Source File: /pods/classes/Pods.php
Since: 2.0
Parameters
PARAMETER | TYPE | DETAILS |
---|---|---|
$id | (int) | ID of the Pod item to delete |
Returns
(bool) Whether the item was successfully deleted
Examples
Example 1
<?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 );