Changeset 42343 for trunk/src/wp-admin/edit-link-form.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/edit-link-form.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-link-form.php
r39537 r42343 8 8 9 9 // don't load directly 10 if ( !defined('ABSPATH') ) 11 die('-1'); 10 if ( ! defined( 'ABSPATH' ) ) { 11 die( '-1' ); 12 } 12 13 13 if ( ! empty( $link_id) ) {14 $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );15 $submit_text = __('Update Link');16 $form_name = 'editlink';14 if ( ! empty( $link_id ) ) { 15 $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' ); 16 $submit_text = __( 'Update Link' ); 17 $form_name = 'editlink'; 17 18 $nonce_action = 'update-bookmark_' . $link_id; 18 19 } else { 19 $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );20 $submit_text = __('Add Link');21 $form_name = 'addlink';20 $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' ); 21 $submit_text = __( 'Add Link' ); 22 $form_name = 'addlink'; 22 23 $nonce_action = 'add-bookmark'; 23 24 } … … 25 26 require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); 26 27 27 add_meta_box( 'linksubmitdiv', __('Save'), 'link_submit_meta_box', null, 'side', 'core');28 add_meta_box( 'linkcategorydiv', __('Categories'), 'link_categories_meta_box', null, 'normal', 'core');29 add_meta_box( 'linktargetdiv', __('Target'), 'link_target_meta_box', null, 'normal', 'core');30 add_meta_box( 'linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', null, 'normal', 'core');31 add_meta_box( 'linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', null, 'normal', 'core');28 add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' ); 29 add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' ); 30 add_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' ); 31 add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' ); 32 add_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' ); 32 33 33 34 /** This action is documented in wp-admin/edit-form-advanced.php */ … … 50 51 do_action( 'do_meta_boxes', 'link', 'side', $link ); 51 52 52 add_screen_option('layout_columns', array('max' => 2, 'default' => 2) ); 53 add_screen_option( 54 'layout_columns', array( 55 'max' => 2, 56 'default' => 2, 57 ) 58 ); 53 59 54 get_current_screen()->add_help_tab( array( 55 'id' => 'overview', 56 'title' => __('Overview'), 57 'content' => 58 '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' . 59 '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' . 60 '<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>' 61 ) ); 60 get_current_screen()->add_help_tab( 61 array( 62 'id' => 'overview', 63 'title' => __( 'Overview' ), 64 'content' => 65 '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' . 66 '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' . 67 '<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>', 68 ) 69 ); 62 70 63 71 get_current_screen()->set_help_sidebar( … … 71 79 72 80 <div class="wrap"> 73 <h1 class="wp-heading-inline"><?php 81 <h1 class="wp-heading-inline"> 82 <?php 74 83 echo esc_html( $title ); 75 ?></h1> 84 ?> 85 </h1> 76 86 77 87 <a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a> … … 80 90 81 91 <?php if ( isset( $_GET['added'] ) ) : ?> 82 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.'); ?></p></div>92 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div> 83 93 <?php endif; ?> 84 94 … … 91 101 wp_nonce_field( $nonce_action ); 92 102 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 93 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> 103 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 104 ?> 94 105 95 106 <div id="poststuff"> … … 98 109 <div id="post-body-content"> 99 110 <div id="namediv" class="stuffbox"> 100 <h2><label for="link_name"><?php _ex( 'Name', 'link name' ) ?></label></h2>111 <h2><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2> 101 112 <div class="inside"> 102 <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name); ?>" id="link_name" />103 <p><?php _e( 'Example: Nifty blogging software'); ?></p>113 <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" /> 114 <p><?php _e( 'Example: Nifty blogging software' ); ?></p> 104 115 </div> 105 116 </div> 106 117 107 118 <div id="addressdiv" class="stuffbox"> 108 <h2><label for="link_url"><?php _e( 'Web Address' ) ?></label></h2>119 <h2><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2> 109 120 <div class="inside"> 110 <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url); ?>" id="link_url" />111 <p><?php _e( 'Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>121 <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url ); ?>" id="link_url" /> 122 <p><?php _e( 'Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>' ); ?></p> 112 123 </div> 113 124 </div> 114 125 115 126 <div id="descriptiondiv" class="stuffbox"> 116 <h2><label for="link_description"><?php _e( 'Description' ) ?></label></h2>127 <h2><label for="link_description"><?php _e( 'Description' ); ?></label></h2> 117 128 <div class="inside"> 118 <input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset( $link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />119 <p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>129 <input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset( $link->link_description ) ? esc_attr( $link->link_description ) : ''; ?>" id="link_description" /> 130 <p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.' ); ?></p> 120 131 </div> 121 132 </div> … … 134 145 <?php 135 146 136 do_meta_boxes( null, 'normal', $link);147 do_meta_boxes( null, 'normal', $link ); 137 148 138 do_meta_boxes( null, 'advanced', $link);149 do_meta_boxes( null, 'advanced', $link ); 139 150 140 151 ?> … … 142 153 <?php 143 154 144 if ( $link_id ) : ?> 155 if ( $link_id ) : 156 ?> 145 157 <input type="hidden" name="action" value="save" /> 146 158 <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" /> 147 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />148 <?php else : ?>159 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id; ?>" /> 160 <?php else : ?> 149 161 <input type="hidden" name="action" value="add" /> 150 162 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.