{"id":38,"date":"2003-08-26T21:54:28","date_gmt":"2003-08-26T21:54:28","guid":{"rendered":"http:\/\/wordpress.org\/development\/2003\/08\/new-getlinkslist-function\/"},"modified":"2021-06-04T11:58:05","modified_gmt":"2021-06-04T11:58:05","slug":"new-getlinkslist-function","status":"publish","type":"post","link":"https:\/\/wordpress.org\/news\/2003\/08\/new-getlinkslist-function\/","title":{"rendered":"New get_links_list() function"},"content":{"rendered":"<blockquote cite=\"https:\/\/wordpress.org\/development\/archives\/37\"><p>There is also a new function called get_links_list() but I&#8217;ll let Dougal explain that.<\/p><\/blockquote>\n<p>\nOh, sure, put me on the spot. \ud83d\ude42\n<\/p>\n<p><code><br \/>\n\/*<br \/>\n * function get_links_list()<br \/>\n *<br \/>\n * added by Dougal<br \/>\n *<br \/>\n * Output a list of all links, listed by category, using the<br \/>\n * settings in $tablelinkcategories and output it as a nested<br \/>\n * HTML unordered list.<br \/>\n *<br \/>\n * Parameters:<br \/>\n *   order (default 'name')  - Sort link categories by 'name' or 'id'<br \/>\n *   hide_if_empty (default true)  - Supress listing empty link categories<br \/>\n *\/<br \/>\n<\/code><\/p>\n<p>\nYou can see it in action on my <a href=\"http:\/\/dougal.gunters.org\/wordpress\/\">in-testing version of my blog<\/a>.  All the links listed in the menu between the &#8220;Links:&#8221; heading down to the calendar were generated by a single line in my template that looks like this:\n<\/p>\n<p><code><br \/>\n&lt;?php<br \/>\nget_links_list('id');<br \/>\n?><br \/>\n<\/code><\/p>\n<p>\nI&#8217;m telling it to sort my link categories by id, rather than by name, because I entered my categories into the sytem in a particular order that I wanted to use. The links under each category are sorted according to the options set in the Link Manager&#8217;s &#8220;Manage Link Categories&#8221; section.\n<\/p>\n<p>\n<strong>This function is hardcoded to generate an HTML unordered list (&lt;ul \/> )<\/strong> Maybe one day we&#8217;ll make a similar function that can generate the links with some different HTML formatting. But don&#8217;t count on it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is also a new function called get_links_list() but I&#8217;ll let Dougal explain that. Oh, sure, put me on the spot. \ud83d\ude42 \/* * function get_links_list() * * added by Dougal * * Output a list of all links, listed by category, using the * settings in $tablelinkcategories and output it as a nested * [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[5],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-development"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pZhYe-C","_links":{"self":[{"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":10501,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/posts\/38\/revisions\/10501"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}