Right now the QueryBuilder::delete() method uses wpdb::delete() under the hood. This limits us to what that method is capable of. For example, want a WHERE X IN (SELECT...) clause in your delete method? Too bad. ðŸ˜
By switching to running simple SQL under the hood we make more complex conditions possible without much effort. The WHERE clause is simply converted to SQL and tacked onto the end, getting the full power of the Query Builder behind complex delete queries.
Right now the
QueryBuilder::delete()
method uses wpdb::delete() under the hood. This limits us to what that method is capable of. For example, want aWHERE X IN (SELECT...)
clause in your delete method? Too bad. ðŸ˜By switching to running simple SQL under the hood we make more complex conditions possible without much effort. The WHERE clause is simply converted to SQL and tacked onto the end, getting the full power of the Query Builder behind complex delete queries.