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
*/
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
}
2008-10-10 20:21:16 +02:00
/**
* Display checked checkboxes attribute for xfn microformat options .
*
* @ since 1.0 . 1
*
* @ param string $class
* @ param string $value
* @ param mixed $deprecated Not used .
*/
2007-12-06 07:37:30 +01:00
function xfn_check ( $class , $value = '' , $deprecated = '' ) {
2005-11-24 00:07:36 +01:00
global $link ;
2008-08-08 19:05:10 +02:00
$link_rel = isset ( $link -> link_rel ) ? $link -> link_rel : '' ; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
2005-09-19 02:47:58 +02:00
$rels = preg_split ( '/\s+/' , $link_rel );
if ( '' != $value && in_array ( $value , $rels ) ) {
echo ' checked="checked"' ;
}
if ( '' == $value ) {
2007-03-07 06:29:15 +01:00
if ( 'family' == $class && strpos ( $link_rel , 'child' ) === false && strpos ( $link_rel , 'parent' ) === false && strpos ( $link_rel , 'sibling' ) === false && strpos ( $link_rel , 'spouse' ) === false && strpos ( $link_rel , 'kin' ) === false ) echo ' checked="checked"' ;
if ( 'friendship' == $class && strpos ( $link_rel , 'friend' ) === false && strpos ( $link_rel , 'acquaintance' ) === false && strpos ( $link_rel , 'contact' ) === false ) echo ' checked="checked"' ;
if ( 'geographical' == $class && strpos ( $link_rel , 'co-resident' ) === false && strpos ( $link_rel , 'neighbor' ) === false ) echo ' checked="checked"' ;
2005-09-19 02:47:58 +02:00
if ( 'identity' == $class && in_array ( 'me' , $rels ) ) echo ' checked="checked"' ;
}
}
2008-10-10 20:21:16 +02:00
/**
* Display link create form fields .
*
* @ since 2.7 . 0
*
* @ param object $link
*/
function link_submit_meta_box ( $link ) {
?>
2008-02-18 20:38:01 +01:00
< div class = " submitbox " id = " submitlink " >
2008-02-20 09:06:03 +01:00
2008-11-12 19:03:07 +01:00
< div id = " minor-publishing " >
2008-02-20 09:06:03 +01:00
2008-11-12 19:03:07 +01:00
< ? php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
< div style = " display:none; " >
2009-04-28 01:09:08 +02:00
< input type = " submit " name = " save " value = " <?php _ea('Save'); ?> " />
2008-11-12 19:03:07 +01:00
</ div >
2008-09-13 21:12:55 +02:00
2008-11-12 19:03:07 +01:00
< div id = " minor-publishing-actions " >
< div id = " preview-action " >
2008-09-13 21:12:55 +02:00
< ? php if ( ! empty ( $link -> link_id ) ) { ?>
2008-11-12 19:03:07 +01:00
< a class = " preview button " href = " <?php echo $link->link_url ; ?> " target = " _blank " tabindex = " 4 " >< ? php _e ( 'Visit Link' ); ?> </a>
2008-09-13 21:12:55 +02:00
< ? php } ?>
2008-11-12 19:03:07 +01:00
</ div >
< div class = " clear " ></ div >
</ div >
2008-09-13 21:12:55 +02:00
2008-11-12 19:03:07 +01:00
< div id = " misc-publishing-actions " >
< div class = " misc-pub-section misc-pub-section-last " >
< label for = " link_private " class = " selectit " >< input id = " link_private " name = " link_visible " type = " checkbox " value = " N " < ? php checked ( $link -> link_visible , 'N' ); ?> /> <?php _e('Keep this link private') ?></label>
</ div >
</ div >
</ div >
< div id = " major-publishing-actions " >
< ? php do_action ( 'post_submitbox_start' ); ?>
< div id = " delete-action " >
2008-03-10 06:48:28 +01:00
< ? php
2008-11-12 19:03:07 +01:00
if ( ! empty ( $_GET [ 'action' ]) && 'edit' == $_GET [ 'action' ] && current_user_can ( 'manage_links' ) ) { ?>
2008-11-15 19:10:35 +01:00
< a class = " submitdelete deletion " href = " <?php echo wp_nonce_url( " link . php ? action = delete & amp ; link_id = $link -> link_id " , 'delete-bookmark_' . $link->link_id ); ?> " onclick = " if ( confirm('<?php echo js_escape(sprintf(__( " You are about to delete this link '%s' \n 'Cancel' to stop , 'OK' to delete . " ), $link->link_name )); ?>') ) { return true;}return false; " >< ? php _e ( 'Delete' ); ?> </a>
2008-11-12 19:03:07 +01:00
< ? php } ?>
</ div >
< div id = " publishing-action " >
2008-12-02 20:52:12 +01:00
< ? php if ( ! empty ( $link -> link_id ) ) { ?>
2009-04-28 01:09:08 +02:00
< input name = " save " type = " submit " class = " button-primary " id = " publish " tabindex = " 4 " accesskey = " p " value = " <?php _ea('Update Link') ?> " />
2008-12-02 20:52:12 +01:00
< ? php } else { ?>
2009-04-28 01:09:08 +02:00
< input name = " save " type = " submit " class = " button-primary " id = " publish " tabindex = " 4 " accesskey = " p " value = " <?php _ea('Add Link') ?> " />
2008-12-02 20:52:12 +01:00
< ? php } ?>
2008-11-12 19:03:07 +01:00
</ div >
< div class = " clear " ></ div >
</ div >
2008-02-18 20:38:01 +01:00
< ? php do_action ( 'submitlink_box' ); ?>
2008-09-14 14:58:00 +02:00
< div class = " clear " ></ div >
2008-01-31 21:04:54 +01:00
</ div >
2008-08-20 23:42:31 +02:00
< ? php
}
add_meta_box ( 'linksubmitdiv' , __ ( 'Save' ), 'link_submit_meta_box' , 'link' , 'side' , 'core' );
2008-01-31 21:04:54 +01:00
2008-10-10 20:21:16 +02:00
/**
* Display link categories form fields .
*
* @ since 2.6 . 0
*
* @ param object $link
*/
2008-08-20 23:42:31 +02:00
function link_categories_meta_box ( $link ) { ?>
2008-01-31 21:04:54 +01:00
< ul id = " category-tabs " >
< li class = " ui-tabs-selected " >< a href = " #categories-all " >< ? php _e ( 'All Categories' ); ?> </a></li>
2008-08-21 08:42:19 +02:00
< li class = " hide-if-no-js " >< a href = " #categories-pop " >< ? php _e ( 'Most Used' ); ?> </a></li>
2008-01-31 21:04:54 +01:00
</ ul >
< div id = " categories-all " class = " ui-tabs-panel " >
< ul id = " categorychecklist " class = " list:category categorychecklist form-no-clear " >
2008-08-09 07:36:14 +02:00
< ? php
2008-08-08 19:05:10 +02:00
if ( isset ( $link -> link_id ) )
wp_link_category_checklist ( $link -> link_id );
else
wp_link_category_checklist ();
?>
2008-01-31 21:04:54 +01:00
</ ul >
</ div >
< div id = " categories-pop " class = " ui-tabs-panel " style = " display: none; " >
< ul id = " categorychecklist-pop " class = " categorychecklist form-no-clear " >
2008-02-02 21:31:56 +01:00
< ? php wp_popular_terms_checklist ( 'link_category' ); ?>
2008-01-31 21:04:54 +01:00
</ ul >
2006-04-04 02:16:27 +02:00
</ div >
2009-01-29 08:00:00 +01:00
< div id = " category-adder " class = " wp-hidden-children " >
< h4 >< a id = " category-add-toggle " href = " #category-add " >< ? php _e ( '+ Add New Category' ); ?> </a></h4>
< p id = " link-category-add " class = " wp-hidden-child " >
2009-05-04 23:28:58 +02:00
< label class = " invisible " for = " newcat " >< ? php _e ( '+ Add New Category' ); ?> </label>
2009-04-28 01:09:08 +02:00
< input type = " text " name = " newcat " id = " newcat " class = " form-required form-input-tip " value = " <?php _ea( 'New category name' ); ?> " aria - required = " true " />
< input type = " button " id = " category-add-submit " class = " add:categorychecklist:linkcategorydiv button " value = " <?php _ea( 'Add' ); ?> " />
2009-01-29 08:00:00 +01:00
< ? php wp_nonce_field ( 'add-link-category' , '_ajax_nonce' , false ); ?>
< span id = " category-ajax-response " ></ span >
</ p >
</ div >
2008-05-30 23:16:15 +02:00
< ? php
}
add_meta_box ( 'linkcategorydiv' , __ ( 'Categories' ), 'link_categories_meta_box' , 'link' , 'normal' , 'core' );
2008-02-08 22:06:15 +01:00
2008-10-10 20:21:16 +02:00
/**
* Display form fields for changing link target .
*
* @ since 2.6 . 0
*
* @ param object $link
*/
2008-08-20 23:42:31 +02:00
function link_target_meta_box ( $link ) { ?>
2009-05-04 23:28:58 +02:00
< fieldset >< legend class = " invisible " >< ? php _e ( 'Target' ) ?> </legend>
2009-05-01 01:09:26 +02:00
< p >< label for = " link_target_blank " class = " selectit " >
2008-08-08 19:05:10 +02:00
< input id = " link_target_blank " type = " radio " name = " link_target " value = " _blank " < ? php echo ( isset ( $link -> link_target ) && ( $link -> link_target == '_blank' ) ? 'checked="checked"' : '' ); ?> />
2009-05-01 01:09:26 +02:00
< ? php _e ( '<code>_blank</code> - new window or tab.' ); ?> </label></p>
< p >< label for = " link_target_top " class = " selectit " >
2008-08-08 19:05:10 +02:00
< input id = " link_target_top " type = " radio " name = " link_target " value = " _top " < ? php echo ( isset ( $link -> link_target ) && ( $link -> link_target == '_top' ) ? 'checked="checked"' : '' ); ?> />
2009-05-01 01:09:26 +02:00
< ? php _e ( '<code>_top</code> - current window or tab, with no frames.' ); ?> </label></p>
< p >< label for = " link_target_none " class = " selectit " >
2008-08-08 19:05:10 +02:00
< input id = " link_target_none " type = " radio " name = " link_target " value = " " < ? php echo ( isset ( $link -> link_target ) && ( $link -> link_target == '' ) ? 'checked="checked"' : '' ); ?> />
2009-05-01 01:09:26 +02:00
< ? php _e ( '<code>_none</code> - same window or tab.' ); ?> </label></p>
2008-05-04 12:37:06 +02:00
</ fieldset >
2009-05-01 01:09:26 +02:00
< p >< ? php _e ( 'Choose the target frame for your link.' ); ?> </p>
2008-05-30 23:16:15 +02:00
< ? php
}
2008-08-20 23:42:31 +02:00
add_meta_box ( 'linktargetdiv' , __ ( 'Target' ), 'link_target_meta_box' , 'link' , 'normal' , 'core' );
2006-02-27 05:57:30 +01:00
2008-10-10 20:21:16 +02:00
/**
* Display xfn form fields .
*
* @ since 2.6 . 0
*
* @ param object $link
*/
2008-05-30 23:16:15 +02:00
function link_xfn_meta_box ( $link ) {
?>
2008-02-29 18:09:44 +01:00
< table class = " editform " style = " width: 100%; " cellspacing = " 2 " cellpadding = " 5 " >
2006-02-27 05:57:30 +01:00
< tr >
2009-03-13 04:53:39 +01:00
< th style = " width: 20%; " scope = " row " >< label for = " link_rel " >< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'rel:' ) ?> </label></th>
2009-04-28 01:09:08 +02:00
< td style = " width: 80%; " >< input type = " text " name = " link_rel " id = " link_rel " size = " 50 " value = " <?php echo ( isset( $link->link_rel ) ? attr( $link->link_rel ) : ''); ?> " /></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2008-03-11 08:23:07 +01:00
< td colspan = " 2 " >
< table cellpadding = " 3 " cellspacing = " 5 " class = " form-table " >
2006-02-27 05:57:30 +01:00
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'identity' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'identity' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " me " >
< input type = " checkbox " name = " identity " value = " me " id = " me " < ? php xfn_check ( 'identity' , 'me' ); ?> />
< ? php _e ( 'another web address of mine' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'friendship' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'friendship' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " contact " >
2009-03-13 04:53:39 +01:00
< input class = " valinp " type = " radio " name = " friendship " value = " contact " id = " contact " < ? php xfn_check ( 'friendship' , 'contact' , 'radio' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
2006-02-27 05:57:30 +01:00
< label for = " acquaintance " >
2009-03-13 04:53:39 +01:00
< input class = " valinp " type = " radio " name = " friendship " value = " acquaintance " id = " acquaintance " < ? php xfn_check ( 'friendship' , 'acquaintance' , 'radio' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
2006-07-05 19:14:29 +02:00
< label for = " friend " >
2009-03-13 04:53:39 +01:00
< input class = " valinp " type = " radio " name = " friendship " value = " friend " id = " friend " < ? php xfn_check ( 'friendship' , 'friend' , 'radio' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
2006-02-27 05:57:30 +01:00
< label for = " friendship " >
2009-03-13 04:53:39 +01:00
< input name = " friendship " type = " radio " class = " valinp " value = " " id = " friendship " < ? php xfn_check ( 'friendship' , '' , 'radio' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'physical' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'physical' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " met " >
< input class = " valinp " type = " checkbox " name = " physical " value = " met " id = " met " < ? php xfn_check ( 'physical' , 'met' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'met' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'professional' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'professional' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " co-worker " >
< input class = " valinp " type = " checkbox " name = " professional " value = " co-worker " id = " co-worker " < ? php xfn_check ( 'professional' , 'co-worker' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'co-worker' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " colleague " >
< input class = " valinp " type = " checkbox " name = " professional " value = " colleague " id = " colleague " < ? php xfn_check ( 'professional' , 'colleague' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'colleague' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'geographical' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'geographical' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " co-resident " >
< input class = " valinp " type = " radio " name = " geographical " value = " co-resident " id = " co-resident " < ? php xfn_check ( 'geographical' , 'co-resident' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'co-resident' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " neighbor " >
< input class = " valinp " type = " radio " name = " geographical " value = " neighbor " id = " neighbor " < ? php xfn_check ( 'geographical' , 'neighbor' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'neighbor' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " geographical " >
< input class = " valinp " type = " radio " name = " geographical " value = " " id = " geographical " < ? php xfn_check ( 'geographical' , '' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'none' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'family' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'family' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " child " >
< input class = " valinp " type = " radio " name = " family " value = " child " id = " child " < ? php xfn_check ( 'family' , 'child' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'child' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " kin " >
< input class = " valinp " type = " radio " name = " family " value = " kin " id = " kin " < ? php xfn_check ( 'family' , 'kin' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'kin' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " parent " >
< input class = " valinp " type = " radio " name = " family " value = " parent " id = " parent " < ? php xfn_check ( 'family' , 'parent' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'parent' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " sibling " >
< input class = " valinp " type = " radio " name = " family " value = " sibling " id = " sibling " < ? php xfn_check ( 'family' , 'sibling' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'sibling' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " spouse " >
< input class = " valinp " type = " radio " name = " family " value = " spouse " id = " spouse " < ? php xfn_check ( 'family' , 'spouse' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'spouse' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " family " >
< input class = " valinp " type = " radio " name = " family " value = " " id = " family " < ? php xfn_check ( 'family' , '' , 'radio' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'none' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
< tr >
2009-03-13 04:53:39 +01:00
< th scope = " row " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'romantic' ) ?> </th>
2009-05-04 23:28:58 +02:00
< td >< fieldset >< legend class = " invisible " > < ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'romantic' ) ?> </legend>
2006-02-27 05:57:30 +01:00
< label for = " muse " >
< input class = " valinp " type = " checkbox " name = " romantic " value = " muse " id = " muse " < ? php xfn_check ( 'romantic' , 'muse' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'muse' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " crush " >
< input class = " valinp " type = " checkbox " name = " romantic " value = " crush " id = " crush " < ? php xfn_check ( 'romantic' , 'crush' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'crush' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " date " >
< input class = " valinp " type = " checkbox " name = " romantic " value = " date " id = " date " < ? php xfn_check ( 'romantic' , 'date' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'date' ) ?> </label>
2006-02-27 05:57:30 +01:00
< label for = " romantic " >
< input class = " valinp " type = " checkbox " name = " romantic " value = " sweetheart " id = " romantic " < ? php xfn_check ( 'romantic' , 'sweetheart' ); ?> />
2009-03-13 04:53:39 +01:00
< ? php /* translators: xfn: http://gmpg.org/xfn/ */ _e ( 'sweetheart' ) ?> </label>
2008-05-04 12:37:06 +02:00
</ fieldset ></ td >
2006-02-27 05:57:30 +01:00
</ tr >
</ table >
</ td >
</ tr >
2005-09-19 02:47:58 +02:00
</ table >
2008-03-11 08:23:07 +01:00
< p >< ? php _e ( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.' ); ?> </p>
2008-05-30 23:16:15 +02:00
< ? php
}
2008-08-20 23:42:31 +02:00
add_meta_box ( 'linkxfndiv' , __ ( 'Link Relationship (XFN)' ), 'link_xfn_meta_box' , 'link' , 'normal' , 'core' );
2006-02-27 05:57:30 +01:00
2008-10-10 20:21:16 +02:00
/**
* Display advanced link options form fields .
*
* @ since 2.6 . 0
*
* @ param object $link
*/
2008-05-30 23:16:15 +02:00
function link_advanced_meta_box ( $link ) {
?>
2008-03-07 11:05:54 +01:00
< table class = " form-table " style = " width: 100%; " cellspacing = " 2 " cellpadding = " 5 " >
< tr class = " form-field " >
< th valign = " top " scope = " row " >< label for = " link_image " >< ? php _e ( 'Image Address' ) ?> </label></th>
2009-04-28 01:09:08 +02:00
< td >< input type = " text " name = " link_image " class = " code " id = " link_image " size = " 50 " value = " <?php echo ( isset( $link->link_image ) ? attr( $link->link_image ) : ''); ?> " style = " width: 95% " /></ td >
2006-02-27 05:57:30 +01:00
</ tr >
2008-03-07 11:05:54 +01:00
< tr class = " form-field " >
< th valign = " top " scope = " row " >< label for = " rss_uri " >< ? php _e ( 'RSS Address' ) ?> </label></th>
2009-04-28 01:09:08 +02:00
< td >< input name = " link_rss " class = " code " type = " text " id = " rss_uri " value = " <?php echo ( isset( $link->link_rss ) ? attr( $link->link_rss ) : ''); ?> " size = " 50 " style = " width: 95% " /></ td >
2006-02-27 05:57:30 +01:00
</ tr >
2008-03-07 11:05:54 +01:00
< tr class = " form-field " >
< th valign = " top " scope = " row " >< label for = " link_notes " >< ? php _e ( 'Notes' ) ?> </label></th>
2008-08-08 19:05:10 +02:00
< td >< textarea name = " link_notes " id = " link_notes " cols = " 50 " rows = " 10 " style = " width: 95% " >< ? php echo ( isset ( $link -> link_notes ) ? $link -> link_notes : '' ); ?> </textarea></td>
2006-02-27 05:57:30 +01:00
</ tr >
2008-03-07 11:05:54 +01:00
< tr class = " form-field " >
< th valign = " top " scope = " row " >< label for = " link_rating " >< ? php _e ( 'Rating' ) ?> </label></th>
< td >< select name = " link_rating " id = " link_rating " size = " 1 " >
2006-02-27 05:57:30 +01:00
< ? php
for ( $r = 0 ; $r < 10 ; $r ++ ) {
2009-04-28 01:09:08 +02:00
echo ( ' <option value="' . attr ( $r ) . '" ' );
2008-08-08 19:05:10 +02:00
if ( isset ( $link -> link_rating ) && $link -> link_rating == $r )
2006-02-27 05:57:30 +01:00
echo 'selected="selected"' ;
echo ( '>' . $r . '</option>' );
}
?> </select> <?php _e('(Leave at 0 for no rating.)') ?>
</ td >
</ tr >
2005-09-19 02:47:58 +02:00
</ table >
2008-05-30 23:16:15 +02:00
< ? php
}
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
do_action ( 'do_meta_boxes' , 'link' , 'normal' , $link );
do_action ( 'do_meta_boxes' , 'link' , 'advanced' , $link );
do_action ( 'do_meta_boxes' , 'link' , 'side' , $link );
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 (); ?>
2008-12-09 19:03:31 +01:00
< h2 >< ? php echo wp_specialchars ( $title ); ?> </h2>
2008-09-13 21:12:55 +02:00
2008-11-15 00:01:16 +01:00
< ? php if ( isset ( $_GET [ 'added' ] ) ) : ?>
2008-11-11 23:40:16 +01:00
< div id = " message " class = " updated fade " >< p >< ? php _e ( 'Link added.' ); ?> </p></div>
< ? 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-04-28 01:09:08 +02:00
< input type = " text " name = " link_name " size = " 30 " tabindex = " 1 " value = " <?php echo 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-04-28 01:09:08 +02:00
< input type = " text " name = " link_url " size = " 30 " class = " code " tabindex = " 1 " value = " <?php echo 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-04-28 01:09:08 +02:00
< input type = " text " name = " link_description " size = " 30 " tabindex = " 1 " value = " <?php echo isset( $link->link_description ) ? 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-04-28 07:58:45 +02:00
< input type = " hidden " name = " order_by " value = " <?php echo 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 >