Function Reference: geodir_payment_delete_listing_info
Summary
Delete the invoice details for post after post deleted.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
Parameters
- $deleted_postid
- (int) (required) The post id requested to delete.
- Default: None
- $force
- (bool) (required) Force to delete post data if True, else false.
- Default: None
Return Values
- (False)
- for invalid post type.
Change Log
Since: 1.0.0
Source Code
function geodir_payment_delete_listing_info($deleted_postid, $force = false) { global $wpdb; $post_type = get_post_type( $deleted_postid ); $all_postypes = geodir_get_posttypes(); if(!in_array($post_type, $all_postypes)) return false; $wpdb->query($wpdb->prepare("DELETE FROM ".INVOICE_TABLE." WHERE status = 'pending' AND `post_id` = %d", array($deleted_postid))); }