2005-09-19 02:47:58 +02:00
|
|
|
<?php
|
2008-08-16 09:27:34 +02:00
|
|
|
/**
|
|
|
|
* Edit links form for inclusion in administration panels.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Administration
|
|
|
|
*/
|
|
|
|
|
2009-08-03 02:04:45 +02:00
|
|
|
// don't load directly
|
|
|
|
if ( !defined('ABSPATH') )
|
|
|
|
die('-1');
|
|
|
|
|
2005-09-19 02:47:58 +02:00
|
|
|
if ( ! empty($link_id) ) {
|
2008-08-20 23:42:31 +02:00
|
|
|
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
|
2008-12-09 10:07:36 +01:00
|
|
|
$submit_text = __('Update Link');
|
2008-03-18 20:37:31 +01:00
|
|
|
$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
|
2006-05-27 01:08:05 +02:00
|
|
|
$nonce_action = 'update-bookmark_' . $link_id;
|
2005-09-19 02:47:58 +02:00
|
|
|
} else {
|
2008-08-20 23:42:31 +02:00
|
|
|
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
|
2008-02-20 20:30:55 +01:00
|
|
|
$submit_text = __('Add Link');
|
2008-03-18 20:37:31 +01:00
|
|
|
$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
|
2006-05-03 00:36:06 +02:00
|
|
|
$nonce_action = 'add-bookmark';
|
2005-09-19 02:47:58 +02:00
|
|
|
}
|
|
|
|
|
2010-04-18 08:14:45 +02:00
|
|
|
require_once('./includes/meta-boxes.php');
|
2008-02-20 09:06:03 +01:00
|
|
|
|
2008-08-20 23:42:31 +02:00
|
|
|
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
|
2008-05-30 23:16:15 +02:00
|
|
|
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
|
2008-08-20 23:42:31 +02:00
|
|
|
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
|
|
|
|
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
|
2008-12-09 19:03:31 +01:00
|
|
|
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
|
2008-11-11 23:40:16 +01:00
|
|
|
|
2010-04-09 17:17:57 +02:00
|
|
|
do_action('add_meta_boxes', 'link', $link);
|
|
|
|
do_action('add_meta_boxes_link', $link);
|
|
|
|
|
2008-11-11 23:40:16 +01:00
|
|
|
do_action('do_meta_boxes', 'link', 'normal', $link);
|
|
|
|
do_action('do_meta_boxes', 'link', 'advanced', $link);
|
|
|
|
do_action('do_meta_boxes', 'link', 'side', $link);
|
|
|
|
|
2010-01-15 17:58:36 +01:00
|
|
|
add_contextual_help($current_screen, drag_drop_help());
|
|
|
|
|
2008-11-11 23:40:16 +01:00
|
|
|
require_once ('admin-header.php');
|
|
|
|
|
|
|
|
?>
|
2008-09-28 06:11:27 +02:00
|
|
|
<div class="wrap">
|
2008-11-26 14:51:25 +01:00
|
|
|
<?php screen_icon(); ?>
|
2009-05-18 17:11:07 +02:00
|
|
|
<h2><?php echo esc_html( $title ); ?></h2>
|
2008-09-13 21:12:55 +02:00
|
|
|
|
2008-11-15 00:01:16 +01:00
|
|
|
<?php if ( isset( $_GET['added'] ) ) : ?>
|
2009-12-26 10:00:58 +01:00
|
|
|
<div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
|
2008-11-11 23:40:16 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
|
2008-09-28 06:11:27 +02:00
|
|
|
<?php
|
2008-11-04 04:22:24 +01:00
|
|
|
if ( !empty($form) )
|
|
|
|
echo $form;
|
|
|
|
if ( !empty($link_added) )
|
|
|
|
echo $link_added;
|
2008-09-28 06:11:27 +02:00
|
|
|
|
|
|
|
wp_nonce_field( $nonce_action );
|
|
|
|
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
|
|
|
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
2008-08-20 23:42:31 +02:00
|
|
|
|
2009-03-25 15:29:22 +01:00
|
|
|
<div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
|
2008-08-20 23:42:31 +02:00
|
|
|
|
|
|
|
<div id="side-info-column" class="inner-sidebar">
|
2008-12-09 19:03:31 +01:00
|
|
|
<?php
|
2008-08-20 23:42:31 +02:00
|
|
|
|
|
|
|
do_action('submitlink_box');
|
|
|
|
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
|
|
|
|
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
2009-03-25 15:29:22 +01:00
|
|
|
<div id="post-body">
|
2009-04-04 12:21:43 +02:00
|
|
|
<div id="post-body-content">
|
2008-08-20 23:42:31 +02:00
|
|
|
<div id="namediv" class="stuffbox">
|
|
|
|
<h3><label for="link_name"><?php _e('Name') ?></label></h3>
|
|
|
|
<div class="inside">
|
2009-05-05 21:43:53 +02:00
|
|
|
<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
|
2008-11-15 00:58:17 +01:00
|
|
|
<p><?php _e('Example: Nifty blogging software'); ?></p>
|
2008-08-20 23:42:31 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="addressdiv" class="stuffbox">
|
|
|
|
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
|
|
|
|
<div class="inside">
|
2009-05-05 21:43:53 +02:00
|
|
|
<input type="text" name="link_url" size="30" class="code" tabindex="1" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
|
2008-11-15 00:58:17 +01:00
|
|
|
<p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
|
2008-08-20 23:42:31 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="descriptiondiv" class="stuffbox">
|
|
|
|
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
|
|
|
|
<div class="inside">
|
2009-05-05 21:43:53 +02:00
|
|
|
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
|
2008-11-15 00:58:17 +01:00
|
|
|
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
|
2008-08-20 23:42:31 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2008-12-09 19:03:31 +01:00
|
|
|
<?php
|
2008-08-20 23:42:31 +02:00
|
|
|
|
|
|
|
do_meta_boxes('link', 'normal', $link);
|
2006-02-27 05:57:30 +01:00
|
|
|
|
2008-05-30 23:16:15 +02:00
|
|
|
do_meta_boxes('link', 'advanced', $link);
|
2008-02-08 22:06:15 +01:00
|
|
|
|
2008-05-30 23:16:15 +02:00
|
|
|
if ( $link_id ) : ?>
|
2006-02-27 05:57:30 +01:00
|
|
|
<input type="hidden" name="action" value="save" />
|
|
|
|
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
|
2009-05-05 21:43:53 +02:00
|
|
|
<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
|
2006-02-27 05:57:30 +01:00
|
|
|
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
|
2005-09-19 02:47:58 +02:00
|
|
|
<?php else: ?>
|
2006-02-27 05:57:30 +01:00
|
|
|
<input type="hidden" name="action" value="add" />
|
2005-09-19 02:47:58 +02:00
|
|
|
<?php endif; ?>
|
2008-01-31 21:04:54 +01:00
|
|
|
|
2009-04-04 12:21:43 +02:00
|
|
|
</div>
|
2008-08-20 23:42:31 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2008-01-31 21:04:54 +01:00
|
|
|
</form>
|
2008-10-17 05:49:43 +02:00
|
|
|
</div>
|