Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Delete all relationships to an object.
- *
- * @param int $object_id ID of the object metadata is for.
- * @param string $type The relationship type.
- * @param string $target The relationship target.
- */
- protected function delete_object_relationships( $object_id, $type, $target ) {
- global $wpdb;
- $sql = $target
- ? "DELETE FROM $wpdb->mb_relationships WHERE `type`=%s AND `$target`=%d"
- : "DELETE FROM $wpdb->mb_relationships WHERE `type`=%s AND (`from`=%d OR `to`=%d)";
- $wpdb->query(
- $wpdb->prepare(
- $sql,
- $type,
- $object_id,
- $object_id // <-- Problem is this argument
- )
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement