Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_update_link [ WordPress Function ]

wp_update_link ( $linkdata )
Parameters:
  • (array) $linkdata Link data to update.
Returns:
  • (int|WP_Error) Value 0 or WP_Error on failure. The updated link ID on success.
Defined at:



Update a link in the database.

Source


<?php
function wp_update_link$linkdata ) {
    
$link_id = (int) $linkdata['link_id'];

    
$link get_bookmark$link_idARRAY_A );

    
// Escape data pulled from DB.
    
$link add_magic_quotes$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'] ) )
        
$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 );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics