prefix . 'ranq_forms_entries'; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange $wpdb->query( "DROP TABLE IF EXISTS `{$ranq_forms_table}`" ); $ranq_forms_all = get_posts( array( 'post_type' => 'ranq_form', 'post_status' => 'any', 'numberposts' => -1, 'fields' => 'ids', 'no_found_rows' => true, ) ); foreach ( $ranq_forms_all as $ranq_forms_one ) { wp_delete_post( (int) $ranq_forms_one, true ); }