link_submit_meta_box

Display link create form fields.

Description

link_submit_meta_box( (object) $link ); 

Parameters (1)

0. $link (object)
The link.

Usage

  1. if ( !function_exists( 'link_submit_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_submit_meta_box($link); 
  9.  

Defined (1)

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

/wp-admin/includes/meta-boxes.php  
  1. function link_submit_meta_box($link) { 
  2. ?> 
  3. <div class="submitbox" id="submitlink"> 
  4.  
  5. <div id="minor-publishing"> 
  6.  
  7. <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 
  8. <div style="display:none;"> 
  9. <?php submit_button( __( 'Save' ), '', 'save', false ); ?> 
  10. </div> 
  11.  
  12. <div id="minor-publishing-actions"> 
  13. <div id="preview-action"> 
  14. <?php if ( !empty($link->link_id) ) { ?> 
  15. <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a> 
  16. <?php } ?> 
  17. </div> 
  18. <div class="clear"></div> 
  19. </div> 
  20.  
  21. <div id="misc-publishing-actions"> 
  22. <div class="misc-pub-section misc-pub-private"> 
  23. <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label> 
  24. </div> 
  25. </div> 
  26.  
  27. </div> 
  28.  
  29. <div id="major-publishing-actions"> 
  30. <?php 
  31. /** This action is documented in wp-admin/includes/meta-boxes.php */ 
  32. do_action( 'post_submitbox_start' ); 
  33. ?> 
  34. <div id="delete-action"> 
  35. <?php 
  36. if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> 
  37. <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 
  38. <?php } ?> 
  39. </div> 
  40.  
  41. <div id="publishing-action"> 
  42. <?php if ( !empty($link->link_id) ) { ?> 
  43. <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" /> 
  44. <?php } else { ?> 
  45. <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" /> 
  46. <?php } ?> 
  47. </div> 
  48. <div class="clear"></div> 
  49. </div> 
  50. <?php 
  51. /** 
  52. * Fires at the end of the Publish box in the Link editing screen. 
  53. * @since 2.5.0 
  54. */ 
  55. do_action( 'submitlink_box' ); 
  56. ?> 
  57. <div class="clear"></div> 
  58. </div> 
  59. <?php