Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was wondering how to create a list of categories name and ids for Wordpress Bookmarks such as get_all_category_ids for post.

I tried using the get_bookmarks, but the category does not appear in it.

Update:

Based on advice from @Mridul-Aggarwal, I wrote code that might be useful:

<?php
    $tautan=get_terms('link_category');//get links category object
    $html="<ul>\r\n";//Init

    /*Looping*/
    foreach($tautan as $isi) {
        $nama=$isi->name;
        $id=$isi->term_taxonomy_id;
        $html.="\t<li>$id - $nama</li>";
    };
    $html.="</ul>\r\n";

    /*Output*/
    echo $html;
?>
share|improve this question
    
It is helpful to provide links for the functions you reference. Usually that means a link to the WordPress Codex or PHP's docs. But anything that clarifies what you have tried or what you are doing could help. –  s_ha_dum Nov 22 '12 at 14:23
    
@s_ha_dum: I wish so, but at the time, I do not understand how to type the code in the edit. :) BTW, thanks for your editing help. –  bayuah Nov 22 '12 at 17:35
    
those functions are all buttons above the edit screen or click the orange "?" on the right. –  s_ha_dum Nov 22 '12 at 17:40
add comment

2 Answers

up vote 0 down vote accepted

what about get_terms('link_category');?

Once you have the objects, you can use them to get whatever information you like.

share|improve this answer
    
Thanks, it's work! –  bayuah Nov 22 '12 at 17:51
add comment

I believe you want wp_list_categories or get_categories. The latter will return an array that you can use to create and format links however your like.

share|improve this answer
    
But these only shows the category of the post, not bookmarks. –  bayuah Nov 22 '12 at 17:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.