Support » Plugin: Link Library » [Plugin: Link Library] Patch: Support for Hierarchical Link Categories

  • sgirard


    Hi Jack. I threw out the idea of supporting the Hierarchical Link Categories plugin on your site the other day and went ahead with a basic implementation this morning. Feel free to use it if you want or maybe this will be useful for others.

    The basic idea is let’s say you have have this link category hierarchy:

    And you want to be able to say:
    [link-library-cats settings=1 categorylistoverride=1]
    and then get 1,2,3,4 to show up in your list (so that as you add child categories you don’t have to come back and update your shortcode).

    Anyway, I just added

    // Recursive hooks for Hierarchical Link Categories plugin -sg
    if (in_array('hierarchical-link-categories/heirarchical-links.php', get_option('active_plugins'))) {
        $selectedcategorylist = $this->link_library_cats_recursive_func($selectedcategorylist);
        $excludedcategorylist = $this->link_library_cats_recursive_func($excludedcategorylist);
    // End recursive hooks

    right before:

    $genoptions = get_option('LinkLibraryGeneral'); near the bottom of link_library_cats_func

    and then added this method to the same class:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Oops. Added the method in this here pastebin:

    Hope it helps. If this post editor blows up the code I’ll just put my link-library.php someplace and post a follow-up.

    I haven’t tested this with exclusions yet but I think it should work.

    I’m on 4.9.8


Viewing 1 replies (of 1 total)
  • Plugin Author Yannick Lefebvre


    I will consider this for inclusion in future updates. Thanks for sending the code samples.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Link Library] Patch: Support for Hierarchical Link Categories’ is closed to new replies.