4 * |
4 * |
5 * @package WordPress |
5 * @package WordPress |
6 * @subpackage Administration |
6 * @subpackage Administration |
7 */ |
7 */ |
8 |
8 |
9 // don't load directly |
9 // Don't load directly. |
10 if ( ! defined( 'ABSPATH' ) ) { |
10 if ( ! defined( 'ABSPATH' ) ) { |
11 die( '-1' ); |
11 die( '-1' ); |
12 } |
12 } |
13 |
13 |
14 if ( ! empty( $link_id ) ) { |
14 if ( ! empty( $link_id ) ) { |
|
15 /* translators: %s: URL to Links screen. */ |
15 $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' ); |
16 $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' ); |
16 $submit_text = __( 'Update Link' ); |
17 $submit_text = __( 'Update Link' ); |
17 $form_name = 'editlink'; |
18 $form_name = 'editlink'; |
18 $nonce_action = 'update-bookmark_' . $link_id; |
19 $nonce_action = 'update-bookmark_' . $link_id; |
19 } else { |
20 } else { |
|
21 /* translators: %s: URL to Links screen. */ |
20 $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' ); |
22 $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' ); |
21 $submit_text = __( 'Add Link' ); |
23 $submit_text = __( 'Add Link' ); |
22 $form_name = 'addlink'; |
24 $form_name = 'addlink'; |
23 $nonce_action = 'add-bookmark'; |
25 $nonce_action = 'add-bookmark'; |
24 } |
26 } |
25 |
27 |
26 require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); |
28 require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; |
27 |
29 |
28 add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' ); |
30 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' ); |
31 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' ); |
32 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' ); |
33 add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' ); |
63 'id' => 'overview', |
65 'id' => 'overview', |
64 'title' => __( 'Overview' ), |
66 'title' => __( 'Overview' ), |
65 'content' => |
67 'content' => |
66 '<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>' . |
68 '<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>' . |
67 '<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>' . |
69 '<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>' . |
68 '<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>', |
70 '<p>' . __( 'XFN stands for <a href="https://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>', |
69 ) |
71 ) |
70 ); |
72 ); |
71 |
73 |
72 get_current_screen()->set_help_sidebar( |
74 get_current_screen()->set_help_sidebar( |
73 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
75 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
74 '<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen">Documentation on Creating Links</a>' ) . '</p>' . |
76 '<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen">Documentation on Creating Links</a>' ) . '</p>' . |
75 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
77 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
76 ); |
78 ); |
77 |
79 |
78 require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
80 require_once ABSPATH . 'wp-admin/admin-header.php'; |
79 ?> |
81 ?> |
80 |
82 |
81 <div class="wrap"> |
83 <div class="wrap"> |
82 <h1 class="wp-heading-inline"> |
84 <h1 class="wp-heading-inline"> |
83 <?php |
85 <?php |
104 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); |
106 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); |
105 ?> |
107 ?> |
106 |
108 |
107 <div id="poststuff"> |
109 <div id="poststuff"> |
108 |
110 |
109 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> |
111 <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> |
110 <div id="post-body-content"> |
112 <div id="post-body-content"> |
111 <div id="namediv" class="stuffbox"> |
113 <div id="namediv" class="stuffbox"> |
112 <h2><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2> |
114 <h2><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2> |
113 <div class="inside"> |
115 <div class="inside"> |
114 <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" /> |
116 <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" /> |
118 |
120 |
119 <div id="addressdiv" class="stuffbox"> |
121 <div id="addressdiv" class="stuffbox"> |
120 <h2><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2> |
122 <h2><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2> |
121 <div class="inside"> |
123 <div class="inside"> |
122 <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url ); ?>" id="link_url" /> |
124 <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr( $link->link_url ); ?>" id="link_url" /> |
123 <p><?php _e( 'Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>' ); ?></p> |
125 <p><?php _e( 'Example: <code>https://wordpress.org/</code> — don’t forget the <code>https://</code>' ); ?></p> |
124 </div> |
126 </div> |
125 </div> |
127 </div> |
126 |
128 |
127 <div id="descriptiondiv" class="stuffbox"> |
129 <div id="descriptiondiv" class="stuffbox"> |
128 <h2><label for="link_description"><?php _e( 'Description' ); ?></label></h2> |
130 <h2><label for="link_description"><?php _e( 'Description' ); ?></label></h2> |