wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_update_link › WordPress Function
Since2.0.0
Deprecatedn/a
› wp_update_link ( $linkdata )
Parameters: |
|
Returns: |
|
Defined at: |
|
Codex: |
Updates a link in the database.
Related Functions: wp_update_plugin, wp_update_plugins, wp_delete_link, wp_update_site, wp_ajax_update_plugin
Source
function wp_update_link( $linkdata ) { $link_id = (int) $linkdata['link_id']; $link = get_bookmark( $link_id, ARRAY_A ); // Escape data pulled from DB. $link = wp_slash( $link ); // Passed link category list overwrites existing category list if not empty. if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && count( $linkdata['link_category'] ) > 0 ) { $link_cats = $linkdata['link_category']; } else { $link_cats = $link['link_category']; } // Merge old and new fields with new fields overwriting old ones. $linkdata = array_merge( $link, $linkdata ); $linkdata['link_category'] = $link_cats; return wp_insert_link( $linkdata ); }