Function Reference: geodir_payment_delete_listing_info


Delete the invoice details for post after post deleted.

Global Values

(object) (required) WordPress Database object.

Default: None


(int) (required) The post id requested to delete.

Default: None
(bool) (required) Force to delete post data if True, else false.

Default: None

Return Values

  • 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)));