Title: link_categories_meta_box
Published: April 25, 2014
Last modified: August 20, 2026

---

# link_categories_meta_box( object $link )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#changelog)

Displays link categories form fields.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#parameters)󠁿

 `$link`objectrequired

Current link object.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#source)󠁿

    ```php
    function link_categories_meta_box( $link ) {
    	?>
    <div id="taxonomy-linkcategory" class="categorydiv">
    	<ul id="category-tabs" class="category-tabs" role="tablist">
    		<li class="tabs"><a href="#categories-all" role="tab" aria-controls="categories-all" aria-selected="true"><?php _e( 'All categories' ); ?></a></li>
    		<li class="hide-if-no-js"><a href="#categories-pop" role="tab" aria-controls="categories-pop"><?php _ex( 'Most Used', 'categories' ); ?></a></li>
    	</ul>

    	<div id="categories-all" class="tabs-panel" role="tabpanel">
    		<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
    			<?php
    			if ( isset( $link->link_id ) ) {
    				wp_link_category_checklist( $link->link_id );
    			} else {
    				wp_link_category_checklist();
    			}
    			?>
    		</ul>
    	</div>

    	<div id="categories-pop" class="tabs-panel" style="display: none;" role="tabpanel">
    		<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
    			<?php wp_popular_terms_checklist( 'link_category' ); ?>
    		</ul>
    	</div>

    	<div id="category-adder" class="wp-hidden-children">
    		<a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add Category' ); ?></a>
    		<p id="link-category-add" class="wp-hidden-child">
    			<label class="screen-reader-text" for="newcat">
    				<?php
    				/* translators: Hidden accessibility text. */
    				_e( '+ Add Category' );
    				?>
    			</label>
    			<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
    			<input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
    			<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
    			<span id="category-ajax-response"></span>
    		</p>
    	</div>
    </div>
    	<?php
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/meta-boxes.php#L1176)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/meta-boxes.php#L1176-L1219)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_link_category_checklist()](https://developer.wordpress.org/reference/functions/wp_link_category_checklist/)`wp-admin/includes/template.php` |

Outputs a link category checklist element.

  | 
| [wp_popular_terms_checklist()](https://developer.wordpress.org/reference/functions/wp_popular_terms_checklist/)`wp-admin/includes/template.php` |

Retrieves a list of the most popular terms from the specified taxonomy.

  | 
| [_ex()](https://developer.wordpress.org/reference/functions/_ex/)`wp-includes/l10n.php` |

Displays translated string with gettext context.

  | 
| [esc_attr_e()](https://developer.wordpress.org/reference/functions/esc_attr_e/)`wp-includes/l10n.php` |

Displays translated text that has been escaped for safe use in an attribute.

  | 
| [wp_nonce_field()](https://developer.wordpress.org/reference/functions/wp_nonce_field/)`wp-includes/functions.php` |

Retrieves or display nonce hidden field for forms.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/link_categories_meta_box/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Flink_categories_meta_box%2F)
before being able to contribute a note or feedback.