2005-09-18 20:47:58 -04:00
< ? php
2008-08-16 03:27:34 -04:00
/**
* Edit links form for inclusion in administration panels .
*
* @ package WordPress
* @ subpackage Administration
*/
2009-08-02 20:04:45 -04:00
// don't load directly
if ( ! defined ( 'ABSPATH' ) )
die ( '-1' );
2005-09-18 20:47:58 -04:00
if ( ! empty ( $link_id ) ) {
2008-08-20 17:42:31 -04:00
$heading = sprintf ( __ ( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
2008-12-09 04:07:36 -05:00
$submit_text = __ ( 'Update Link' );
2008-03-18 15:37:31 -04:00
$form = '<form name="editlink" id="editlink" method="post" action="link.php">' ;
2006-05-26 19:08:05 -04:00
$nonce_action = 'update-bookmark_' . $link_id ;
2005-09-18 20:47:58 -04:00
} else {
2008-08-20 17:42:31 -04:00
$heading = sprintf ( __ ( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
2008-02-20 14:30:55 -05:00
$submit_text = __ ( 'Add Link' );
2008-03-18 15:37:31 -04:00
$form = '<form name="addlink" id="addlink" method="post" action="link.php">' ;
2006-05-02 18:36:06 -04:00
$nonce_action = 'add-bookmark' ;
2005-09-18 20:47:58 -04:00
}
2010-04-18 02:14:45 -04:00
require_once ( './includes/meta-boxes.php' );
2008-02-20 03:06:03 -05:00
2008-08-20 17:42:31 -04:00
add_meta_box ( 'linksubmitdiv' , __ ( 'Save' ), 'link_submit_meta_box' , 'link' , 'side' , 'core' );
2008-05-30 17:16:15 -04:00
add_meta_box ( 'linkcategorydiv' , __ ( 'Categories' ), 'link_categories_meta_box' , 'link' , 'normal' , 'core' );
2008-08-20 17:42:31 -04: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 13:03:31 -05:00
add_meta_box ( 'linkadvanceddiv' , __ ( 'Advanced' ), 'link_advanced_meta_box' , 'link' , 'normal' , 'core' );
2008-11-11 17:40:16 -05:00
2010-04-09 11:17:57 -04:00
do_action ( 'add_meta_boxes' , 'link' , $link );
do_action ( 'add_meta_boxes_link' , $link );
2008-11-11 17:40:16 -05: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 );
2011-10-03 00:00:57 -04:00
$current_screen -> add_option ( 'layout_columns' , array ( 'max' => 2 , 'default' => 'auto' ) );
2010-10-07 15:34:18 -04:00
2011-10-03 00:00:57 -04:00
$current_screen -> add_option_context (
2011-10-02 02:59:36 -04:00
'<p>test</p>'
2010-05-25 18:45:18 -04:00
);
2010-01-15 11:58:36 -05:00
2011-10-02 02:59:36 -04:00
add_contextual_help ( $current_screen , '
< p > ' . __( ' You can add or edit links on this screen by entering information in each of the boxes . Only the link & #8217;s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>
< 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 & #8217;t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>
< p > ' . __( ' XFN stands for < a href = " http://gmpg.org/xfn/ " target = " _blank " > 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 >
< 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 = " http://wordpress.org/support/ " target = " _blank " > Support Forums </ a > ' ) . ' </ p > ' );
2008-11-11 17:40:16 -05:00
require_once ( 'admin-header.php' );
?>
2011-09-21 02:16:24 -04:00
< div class = " wrap columns-<?php echo (int) $screen_layout_columns ? (int) $screen_layout_columns : 'auto'; ?> " >
2008-11-26 08:51:25 -05:00
< ? php screen_icon (); ?>
2011-05-19 15:52:11 -04:00
< 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>
2008-09-13 15:12:55 -04:00
2008-11-14 18:01:16 -05:00
< ? php if ( isset ( $_GET [ 'added' ] ) ) : ?>
2009-12-26 04:00:58 -05:00
< div id = " message " class = " updated " >< p >< ? php _e ( 'Link added.' ); ?> </p></div>
2008-11-11 17:40:16 -05:00
< ? php endif ; ?>
2008-09-28 00:11:27 -04:00
< ? php
2008-11-03 22:22:24 -05:00
if ( ! empty ( $form ) )
echo $form ;
if ( ! empty ( $link_added ) )
echo $link_added ;
2008-09-28 00:11:27 -04: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 17:42:31 -04:00
2011-09-21 02:16:24 -04:00
< div id = " poststuff " class = " metabox-holder<?php echo 1 != $screen_layout_columns ? ' has-right-sidebar' : ''; ?> " >
2008-08-20 17:42:31 -04:00
< div id = " side-info-column " class = " inner-sidebar " >
2008-12-09 13:03:31 -05:00
< ? php
2011-09-21 02:16:24 -04:00
if ( 1 != $screen_layout_columns ) {
do_action ( 'submitlink_box' );
$side_meta_boxes = do_meta_boxes ( 'link' , 'side' , $link );
}
2008-08-20 17:42:31 -04:00
?>
</ div >
2009-03-25 10:29:22 -04:00
< div id = " post-body " >
2009-04-04 06:21:43 -04:00
< div id = " post-body-content " >
2008-08-20 17:42:31 -04:00
< div id = " namediv " class = " stuffbox " >
2011-06-10 18:13:26 -04:00
< h3 >< label for = " link_name " >< ? php _ex ( 'Name' , 'link name' ) ?> </label></h3>
2008-08-20 17:42:31 -04:00
< div class = " inside " >
2009-05-05 15:43:53 -04:00
< input type = " text " name = " link_name " size = " 30 " tabindex = " 1 " value = " <?php echo esc_attr( $link->link_name ); ?> " id = " link_name " />
2008-11-14 18:58:17 -05:00
< p >< ? php _e ( 'Example: Nifty blogging software' ); ?> </p>
2008-08-20 17:42:31 -04: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 15:43:53 -04: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-14 18:58:17 -05:00
< p >< ? php _e ( 'Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>' ); ?> </p>
2008-08-20 17:42:31 -04:00
</ div >
</ div >
< div id = " descriptiondiv " class = " stuffbox " >
< h3 >< label for = " link_description " >< ? php _e ( 'Description' ) ?> </label></h3>
< div class = " inside " >
2009-05-05 15:43:53 -04: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-14 18:58:17 -05: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 17:42:31 -04:00
</ div >
</ div >
2008-12-09 13:03:31 -05:00
< ? php
2008-08-20 17:42:31 -04:00
2011-09-21 02:16:24 -04:00
if ( 1 == $screen_layout_columns ) {
do_action ( 'submitlink_box' );
$side_meta_boxes = do_meta_boxes ( 'link' , 'side' , $link );
}
2008-08-20 17:42:31 -04:00
do_meta_boxes ( 'link' , 'normal' , $link );
2006-02-26 23:57:30 -05:00
2008-05-30 17:16:15 -04:00
do_meta_boxes ( 'link' , 'advanced' , $link );
2008-02-08 16:06:15 -05:00
2008-05-30 17:16:15 -04:00
if ( $link_id ) : ?>
2006-02-26 23:57:30 -05:00
< input type = " hidden " name = " action " value = " save " />
< input type = " hidden " name = " link_id " value = " <?php echo (int) $link_id ; ?> " />
2009-05-05 15:43:53 -04:00
< input type = " hidden " name = " order_by " value = " <?php echo esc_attr( $order_by ); ?> " />
2006-02-26 23:57:30 -05:00
< input type = " hidden " name = " cat_id " value = " <?php echo (int) $cat_id ?> " />
2005-09-18 20:47:58 -04:00
< ? php else : ?>
2006-02-26 23:57:30 -05:00
< input type = " hidden " name = " action " value = " add " />
2005-09-18 20:47:58 -04:00
< ? php endif ; ?>
2008-01-31 15:04:54 -05:00
2009-04-04 06:21:43 -04:00
</ div >
2008-08-20 17:42:31 -04:00
</ div >
</ div >
2008-01-31 15:04:54 -05:00
</ form >
2008-10-16 23:49:43 -04:00
</ div >