Filter hook 'link_category'

in WP Core File wp-includes/deprecated.php at line 1063

View Source

link_category

Filter Hook
Description
Output entire list of links by category. Output a list of all links, listed by category, using the settings in $wpdb->linkcategories and output it as a nested HTML unordered list.

Hook Information

File Location wp-includes/deprecated.php View on GitHub
Hook Type Filter
Line Number 1063

Hook Parameters

Type Name Description
string $order Sort link categories by 'name' or 'id'

Usage Examples

Basic Usage
<?php
// Hook into link_category
add_filter('link_category', 'my_custom_filter', 10, 1);

function my_custom_filter($order) {
    // Your custom filtering logic here
    return $order;
}

Source Code Context

wp-includes/deprecated.php:1063 - How this hook is used in WordPress core
<?php
1058  	if ( $cats ) {
1059  		foreach ( (array) $cats as $cat ) {
1060  			// Handle each category.
1061  
1062  			// Display the category name.
1063  			echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
1064  			// Call get_links() with all the appropriate params.
1065  			get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
1066  
1067  			// Close the last category.
1068  			echo "\n\t</ul>\n</li>\n";

PHP Documentation

<?php
/**
 * Output entire list of links by category.
 *
 * Output a list of all links, listed by category, using the settings in
 * $wpdb->linkcategories and output it as a nested HTML unordered list.
 *
 * @since 1.0.1
 * @deprecated 2.1.0 Use wp_list_bookmarks()
 * @see wp_list_bookmarks()
 *
 * @param string $order Sort link categories by 'name' or 'id'
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/deprecated.php
Related Hooks

Related hooks will be displayed here in future updates.