link_categories_meta_box

Display link categories form fields.

Description

link_categories_meta_box( (object) $link ); 

Parameters (1)

0. $link (object)
The link.

Usage

  1. if ( !function_exists( 'link_categories_meta_box' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/meta-boxes.php'; 
  3.  
  4. // The link. 
  5. $link = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = link_categories_meta_box($link); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/meta-boxes.php  
  1. function link_categories_meta_box($link) { 
  2. ?> 
  3. <div id="taxonomy-linkcategory" class="categorydiv"> 
  4. <ul id="category-tabs" class="category-tabs"> 
  5. <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li> 
  6. <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li> 
  7. </ul> 
  8.  
  9. <div id="categories-all" class="tabs-panel"> 
  10. <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> 
  11. <?php 
  12. if ( isset($link->link_id) ) 
  13. wp_link_category_checklist($link->link_id); 
  14. else 
  15. ?> 
  16. </ul> 
  17. </div> 
  18.  
  19. <div id="categories-pop" class="tabs-panel" style="display: none;"> 
  20. <ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> 
  21. <?php wp_popular_terms_checklist('link_category'); ?> 
  22. </ul> 
  23. </div> 
  24.  
  25. <div id="category-adder" class="wp-hidden-children"> 
  26. <a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a> 
  27. <p id="link-category-add" class="wp-hidden-child"> 
  28. <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label> 
  29. <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" /> 
  30. <input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" /> 
  31. <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?> 
  32. <span id="category-ajax-response"></span> 
  33. </p> 
  34. </div> 
  35. </div> 
  36. <?php