clean_bookmark_cache example

$wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );

    /** * Fires after a link has been deleted. * * @since 2.2.0 * * @param int $link_id ID of the deleted link. */
    do_action( 'deleted_link', $link_id );

    clean_bookmark_cache( $link_id );

    return true;
}

/** * Retrieves the link category IDs associated with the link specified. * * @since 2.1.0 * * @param int $link_id Link ID to look up. * @return int[] The IDs of the requested link's categories. */
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) );
        $wpdb->update( $wpdb->posts, array( 'post_author' => $reassign ), array( 'post_author' => $id ) );
        if ( ! empty( $post_ids ) ) {
            foreach ( $post_ids as $post_id ) {
                clean_post_cache( $post_id );
            }
        }
        $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
        $wpdb->update( $wpdb->links, array( 'link_owner' => $reassign ), array( 'link_owner' => $id ) );
        if ( ! empty( $link_ids ) ) {
            foreach ( $link_ids as $link_id ) {
                clean_bookmark_cache( $link_id );
            }
        }
    }

    // FINALLY, delete user.     if ( is_multisite() ) {
        remove_user_from_blog( $idget_current_blog_id() );
    } else {
        $meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
        foreach ( $meta as $mid ) {
            delete_metadata_by_mid( 'user', $mid );
        }
Home | Imprint | This part of the site doesn't use cookies.