0

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;
?>
3
  • 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, 2012 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, 2012 at 17:35
  • those functions are all buttons above the edit screen or click the orange "?" on the right.
    – s_ha_dum
    Nov 22, 2012 at 17:40

3 Answers 3

0

what about get_terms('link_category');?

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

0
0

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.

1
  • But these only shows the category of the post, not bookmarks.
    – bayuah
    Nov 22, 2012 at 17:51
0

The function get_bookmark() exists, which also returns the category IDs in an array, for the ID of the bookmark passed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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