@@ 198-204 (lines=7) @@ | ||
195 | } |
|
196 | ||
197 | if ( $update ) { |
|
198 | if ( false === $wpdb->update( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ), compact( 'link_id' ) ) ) { |
|
199 | if ( $wp_error ) { |
|
200 | return new WP_Error( 'db_update_error', __( 'Could not update link in the database' ), $wpdb->last_error ); |
|
201 | } else { |
|
202 | return 0; |
|
203 | } |
|
204 | } |
|
205 | } else { |
|
206 | if ( false === $wpdb->insert( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ) ) ) { |
|
207 | if ( $wp_error ) { |
|
@@ 206-212 (lines=7) @@ | ||
203 | } |
|
204 | } |
|
205 | } else { |
|
206 | if ( false === $wpdb->insert( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ) ) ) { |
|
207 | if ( $wp_error ) { |
|
208 | return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb->last_error ); |
|
209 | } else { |
|
210 | return 0; |
|
211 | } |
|
212 | } |
|
213 | $link_id = (int) $wpdb->insert_id; |
|
214 | } |
|
215 |