1. Home
  2. Docs
  3. Simpods MVC
  4. Tutorials
  5. Featured Methods
  6. simpods_delete_fn()

simpods_delete_fn()

simpods_delete_fn will delete data from the target database table, also those in relationship. For example, if you delete an item from a table created by Pods Framework, Pods’ delete function will be used and delete anythings saved in Pods tables and the WordPress ones. If it is a post type but not created by Pods, wp_delete_post will be used. Otherwise, custom code will be used to do the delete. In the future, it will be able to delete related data inserted by Simpods components.

Parameters

general_insert_fn accepts four parameters:

simpods_delete_fn( $table_str, $data_arr, $show_bln = false, $prefixMe_bln = true )
  • $table_str: the target table to update
  • $data_arr: Pass in the fields and values in an associated array to insert, in this format: array(‘key’ => ‘value’). simpods_select_fn will be used to located the item.
  • $show_bln: Default to false. If set to true, the SQL query will be displayed on the screen if it is not processed by Pods or WordPress, for debugging purpose.
  • $prefixMe_bln: Default to true. If set to false, the function won’t automatically prefix $table_prefix to the ‘target_tb’ in the $atts_arr array. It is useful if you are querying a database table that are not designed for WordPress.

Return

This function will return an Boolean.