querying user bookmarks from a large number of bookmarks

It looks like the default get_bookmarks() http://codex.wordpress.org/Function_Reference/get_bookmarks is using this query: SELECT * FROM wp_links WHERE 1=1 AND link_visible=”Y” ORDER BY link_name ASC; You can check the function in /wp-includes/bookmark.php. The get_bookmarks() function has limit and order parameters that you might find helpful. The option get_bookmarks(“limit=5”) gives this query: SELECT * FROM wp_links WHERE 1=1 … Read more

How do I get link URLs from the WordPress links backend into an array?

I believe that you’re looking for the get_bookmarks() function, which returns an array of bookmark objects. You could then implement this into your code: <?php // Get RSS Feed(s) include_once(ABSPATH . WPINC . ‘/feed.php’); $bookmarks = get_bookmarks(); $rsslist = array(); foreach ( $bookmarks as $bm ) { if ( $bm->link_rss ) $rsslist[] = $bm->link_rss; } … Read more

wp_list_bookmarks display

Not extremely elegant, but should work… $sep = ” | “; $args = array( ‘before’=>”, ‘after’=>$sep, ‘category_after’=>”, ‘category_before’=>”, ‘title_li’=>”, ‘echo’=>0 //return the string, don’t echo ); $str = wp_list_bookmarks($args); //chop off the last separator… $str = substr($str, 0, strlen($str) – strlen($sep)); echo $str; EDIT — I added before and after to the $args array — … Read more

Getting only the most recent bookmark?

As far as I know it’s not possible to query the links directly, but there is definetly a link_updated field in the wp_links table, so you can use wpdb to interact with it and return the latest (modified) links. There’s also a solution here. EDIT : Updating a link doesn’t change link_updated, but here is … Read more

How to splice in wp_links links into the loop?

I’ve tried something similar to that (well, slightly different, what I did was try to create a timeline where posts and comments showed up in the same timeline)… Merging those two arrays is not easy, because the post object has completely different properties to the link object. If you wanted to do it, you’d have … Read more