1. Home
  2. Docs
  3. Function Reference
  4. Functions
  5. general_delete()

general_delete()

Delete database records

Copy to Clipboard

Parameters

$table

Target table

$field

Field to search (default ‘ID’)

$search_what

Search term, number for ID, sting for slug etc

$can_echo_query

If true the query will be echoed out (default false)

$can_prefix

If true, prefixes table names with the WordPress table prefix (default true)

Return

boolean

Whether the delete was successful or not

Example

It works for all tables.

Copy to Clipboard
Tags