if ( ! empty($link_id) ) {
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
$submit_text = __('Update Link');
- $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
+ $form_name = 'editlink';
$nonce_action = 'update-bookmark_' . $link_id;
} else {
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
$submit_text = __('Add Link');
- $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
+ $form_name = 'addlink';
$nonce_action = 'add-bookmark';
}
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
?>
<div class="wrap">
-<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a></h2>
+<h1><?php echo esc_html( $title ); ?> <a href="link-add.php" class="page-title-action"><?php echo esc_html_x('Add New', 'link'); ?></a></h1>
<?php if ( isset( $_GET['added'] ) ) : ?>
-<div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
+<div id="message" class="updated notice is-dismissible"><p><?php _e('Link added.'); ?></p></div>
<?php endif; ?>
+<form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php">
<?php
-if ( !empty($form) )
- echo $form;
-if ( !empty($link_added) )
+if ( ! empty( $link_added ) ) {
echo $link_added;
+}
wp_nonce_field( $nonce_action );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
-<h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3>
+<h2><label for="link_name"><?php _ex( 'Name', 'link name' ) ?></label></h2>
<div class="inside">
<input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
<p><?php _e('Example: Nifty blogging software'); ?></p>
</div>
<div id="addressdiv" class="stuffbox">
-<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
+<h2><label for="link_url"><?php _e( 'Web Address' ) ?></label></h2>
<div class="inside">
<input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
<p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
</div>
<div id="descriptiondiv" class="stuffbox">
-<h3><label for="link_description"><?php _e('Description') ?></label></h3>
+<h2><label for="link_description"><?php _e( 'Description' ) ?></label></h2>
<div class="inside">
<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" />
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
<div id="postbox-container-1" class="postbox-container">
<?php
-/**
- * Fires before the Save meta box in the sidebar.
- *
- * @since 2.5.0
- */
+/** This action is documented in wp-admin/includes/meta-boxes.php */
do_action( 'submitlink_box' );
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );