2010-02-20 16:57:43 -05:00
< ? php
/**
2010-02-23 15:38:27 -05:00
* WordPress Administration for Navigation Menus
2010-02-20 16:57:43 -05:00
* Interface functions
*
2010-02-27 18:06:56 -05:00
* @ version 2.0 . 0
2010-02-20 16:57:43 -05:00
*
* @ package WordPress
* @ subpackage Administration
*/
2010-02-20 19:03:42 -05:00
2010-03-15 12:26:46 -04:00
/** Load WordPress Administration Bootstrap */
require_once ( 'admin.php' );
2010-02-20 16:57:43 -05:00
2010-03-22 15:56:16 -04:00
// Load all the nav menu interface functions
require_once ( ABSPATH . 'wp-admin/includes/nav-menu.php' );
2010-03-15 12:26:46 -04:00
// Permissions Check
2010-02-23 15:48:50 -05:00
if ( ! current_user_can ( 'switch_themes' ) )
wp_die ( __ ( 'Cheatin’ uh?' ));
2010-03-15 12:26:46 -04:00
// Nav Menu CSS
2010-02-25 12:10:00 -05:00
wp_admin_css ( 'nav-menu' );
2010-03-15 12:26:46 -04:00
// jQuery
2010-02-20 18:35:05 -05:00
wp_enqueue_script ( 'jquery' );
2010-02-20 19:10:20 -05:00
wp_enqueue_script ( 'jquery-ui-draggable' );
wp_enqueue_script ( 'jquery-ui-droppable' );
wp_enqueue_script ( 'jquery-ui-sortable' );
2010-03-15 12:26:46 -04:00
wp_enqueue_script ( 'jquery-autocomplete' );
// Nav Menu functions
2010-03-17 12:13:16 -04:00
wp_enqueue_script ( 'nav-menu' );
2010-03-15 12:26:46 -04:00
// Metaboxes
wp_enqueue_script ( 'common' );
wp_enqueue_script ( 'wp-lists' );
wp_enqueue_script ( 'postbox' );
// Thickbox
2010-02-27 18:06:56 -05:00
add_thickbox ();
2010-02-20 19:10:20 -05:00
2010-03-15 12:26:46 -04:00
// Container for any messages displayed to the user
2010-02-24 13:52:54 -05:00
$messages_div = '' ;
2010-03-01 22:59:28 -05:00
2010-03-15 12:26:46 -04:00
// Container that stores the name of the active menu
$nav_menu_selected_title = '' ;
2010-02-24 01:41:35 -05:00
2010-03-15 12:26:46 -04:00
// The menu id of the current menu being edited
$nav_menu_selected_id = isset ( $_REQUEST [ 'menu' ] ) ? ( int ) $_REQUEST [ 'menu' ] : 0 ;
2010-02-25 16:06:44 -05:00
2010-03-15 12:26:46 -04:00
// Allowed actions: add, update, delete
$action = isset ( $_REQUEST [ 'action' ] ) ? $_REQUEST [ 'action' ] : 'edit' ;
2010-02-25 16:06:44 -05:00
2010-03-15 12:26:46 -04:00
switch ( $action ) {
case 'delete' :
check_admin_referer ( 'delete-nav_menu-' . $nav_menu_selected_id );
2010-02-23 15:48:50 -05:00
2010-03-15 12:26:46 -04:00
if ( is_nav_menu ( $nav_menu_selected_id ) ) {
2010-03-22 15:56:16 -04:00
$delete_nav_menu = wp_delete_nav_menu ( $nav_menu_selected_id );
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
if ( is_wp_error ( $delete_nav_menu ) ) {
$messages_div = '<div id="message" class="error"><p>' . $delete_nav_menu -> get_error_message () . '</p></div>' ;
} else {
$messages_div = '<div id="message" class="updated"><p>' . __ ( 'The menu has been successfully deleted.' ) . '</p></div>' ;
$nav_menu_selected_id = 0 ; // Reset the selected menu
}
unset ( $delete_nav_menu );
2010-02-23 15:48:50 -05:00
}
2010-03-15 12:26:46 -04:00
break ;
2010-03-17 12:27:25 -04:00
2010-03-15 12:26:46 -04:00
case 'update' :
check_admin_referer ( 'update-nav_menu' );
2010-03-17 12:27:25 -04:00
2010-03-15 12:26:46 -04:00
// Add Menu
2010-03-17 15:57:08 -04:00
if ( isset ( $_POST [ 'create-menu-button' ]) ) {
2010-03-24 14:35:31 -04:00
if ( current_theme_supports ( 'nav-menus' ) || current_theme_supports ( 'widgets' ) ) {
2010-03-15 12:26:46 -04:00
$add_nav_menu = esc_html ( $_POST [ 'create-menu-name' ] );
if ( $add_nav_menu ) {
$add_nav_menu = wp_create_nav_menu ( $add_nav_menu );
if ( is_wp_error ( $add_nav_menu ) ) {
2010-03-22 15:56:16 -04:00
$messages_div = '<div id="message" class="error"><p>' . $add_nav_menu -> get_error_message () . '</p></div>' ;
2010-03-15 12:26:46 -04:00
} else {
$nav_menu_selected_id = $add_nav_menu -> term_id ;
$nav_menu_selected_title = $add_nav_menu -> name ;
2010-03-22 15:56:16 -04:00
$messages_div = '<div id="message" class="updated"><p>' . sprintf ( __ ( 'The <strong>%s</strong> menu has been successfully created.' ), $add_nav_menu -> name ) . '</p></div>' ;
2010-03-15 12:26:46 -04:00
}
} else {
2010-03-22 15:56:16 -04:00
$messages_div = '<div id="message" class="error"><p>' . __ ( 'Please enter a valid menu name.' ) . '</p></div>' ;
2010-03-15 12:26:46 -04:00
}
2010-03-22 15:56:16 -04:00
unset ( $add_nav_menu );
2010-03-15 12:26:46 -04:00
}
2010-03-17 15:57:08 -04:00
} else {
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
// @todo wrap this into wp_update_nav_menu_object();
2010-03-17 15:57:08 -04:00
if ( isset ( $_POST [ 'menu-name' ]) ) {
$old_nav_menu = get_term ( $nav_menu_selected_id , 'nav_menu' , ARRAY_A );
$args = array ( 'name' => $_POST [ 'menu-name' ], 'slug' => null , 'description' => $old_nav_menu [ 'description' ], 'parent' => $old_nav_menu [ 'parent' ], );
$new_nav_menu = wp_update_term ( $nav_menu_selected_id , 'nav_menu' , $args );
}
2010-03-26 15:36:49 -04:00
2010-03-17 15:57:08 -04:00
// Update menu items
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
// @todo: wrap update logic into wp_update_nav_menu();
$update_count = isset ( $_POST [ 'li-count' ] ) ? ( int ) $_POST [ 'li-count' ] : 0 ;
2010-03-17 15:57:08 -04:00
$update_nav_menu = is_nav_menu ( $nav_menu_selected_id );
if ( ! is_wp_error ( $update_nav_menu ) ) {
$menu_items = wp_get_nav_menu_items ( $nav_menu_selected_id , array ( 'orderby' => 'ID' , 'output' => ARRAY_A , 'output_key' => 'ID' ) );
2010-03-26 15:36:49 -04:00
2010-03-17 15:57:08 -04:00
// Loop through all POST variables
2010-03-22 15:56:16 -04:00
for ( $k = 0 ; $k < $update_count ; $k ++ ) {
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
// Menu item title can't be blank
if ( '' == $_POST [ 'menu-item-title' ][ $k ] )
continue ;
2010-03-26 15:36:49 -04:00
2010-03-18 13:07:05 -04:00
$menu_item_db_id = isset ( $_POST [ 'menu-item-db-id' ][ $k ] ) ? $_POST [ 'menu-item-db-id' ][ $k ] : 0 ;
$menu_item_object_id = isset ( $_POST [ 'menu-item-object-id' ][ $k ] ) ? $_POST [ 'menu-item-object-id' ][ $k ] : 0 ;
2010-03-22 15:56:16 -04:00
$menu_item_object = isset ( $_POST [ 'menu-item-object' ][ $k ] ) ? $_POST [ 'menu-item-object' ][ $k ] : '' ;
2010-03-18 13:07:05 -04:00
$menu_item_parent_id = isset ( $_POST [ 'menu-item-parent-id' ][ $k ] ) ? $_POST [ 'menu-item-parent-id' ][ $k ] : 0 ;
$menu_item_position = isset ( $_POST [ 'menu-item-position' ][ $k ] ) ? $_POST [ 'menu-item-position' ][ $k ] : 0 ;
$menu_item_type = isset ( $_POST [ 'menu-item-type' ][ $k ] ) ? $_POST [ 'menu-item-type' ][ $k ] : 'custom' ;
$menu_item_append = isset ( $_POST [ 'menu-item-append' ][ $k ] ) ? $_POST [ 'menu-item-append' ][ $k ] : 'custom' ;
$menu_item_title = isset ( $_POST [ 'menu-item-title' ][ $k ] ) ? $_POST [ 'menu-item-title' ][ $k ] : '' ;
$menu_item_url = isset ( $_POST [ 'menu-item-url' ][ $k ] ) ? $_POST [ 'menu-item-url' ][ $k ] : '' ;
$menu_item_description = isset ( $_POST [ 'menu-item-description' ][ $k ] ) ? $_POST [ 'menu-item-description' ][ $k ] : '' ;
$menu_item_attr_title = isset ( $_POST [ 'menu-item-attr-title' ][ $k ] ) ? $_POST [ 'menu-item-attr-title' ][ $k ] : '' ;
2010-04-03 18:52:30 -04:00
$menu_item_target = isset ( $_POST [ 'menu-item-target' ][ $k ] ) ? $_POST [ 'menu-item-target' ][ $k ] : '' ;
2010-03-18 13:07:05 -04:00
$menu_item_classes = isset ( $_POST [ 'menu-item-classes' ][ $k ] ) ? $_POST [ 'menu-item-classes' ][ $k ] : '' ;
$menu_item_xfn = isset ( $_POST [ 'menu-item-xfn' ][ $k ] ) ? $_POST [ 'menu-item-xfn' ][ $k ] : '' ;
2010-03-17 15:57:08 -04:00
2010-03-22 15:56:16 -04:00
// Populate the menu item object
$post = array (
'post_status' => 'publish' , 'post_type' => 'nav_menu_item' , 'ping_status' => 0 ,
'post_author' => $user_ID , 'tax_input' => array ( 'nav_menu' => $update_nav_menu -> name ),
'post_title' => $menu_item_title , 'post_excerpt' => $menu_item_attr_title ,
'post_parent' => $menu_item_parent_id , 'menu_order' => $menu_item_position ,
'post_content' => $menu_item_description ,
);
2010-03-26 15:36:49 -04:00
2010-03-17 15:57:08 -04:00
// New menu item
if ( $menu_item_db_id == 0 ) {
$menu_item_db_id = wp_insert_post ( $post );
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
// Update existing menu item
} elseif ( isset ( $menu_items [ $menu_item_db_id ]) || ( 'custom' == $menu_item_type && 0 != $menu_item_db_id ) ) {
2010-03-17 15:57:08 -04:00
$post [ 'ID' ] = $menu_item_db_id ;
wp_update_post ( $post );
unset ( $menu_items [ $menu_item_db_id ] );
}
2010-03-22 15:56:16 -04:00
update_post_meta ( $menu_item_db_id , '_menu_item_type' , sanitize_key ( $menu_item_type ) );
update_post_meta ( $menu_item_db_id , '_menu_item_object_id' , ( int ) $menu_item_object_id );
update_post_meta ( $menu_item_db_id , '_menu_item_object' , sanitize_key ( $menu_item_object ) );
update_post_meta ( $menu_item_db_id , '_menu_item_target' , sanitize_key ( $menu_item_target ) );
2010-03-17 15:57:08 -04:00
// @todo handle sanitizing multiple classes separated by whitespace.
2010-03-22 15:56:16 -04:00
update_post_meta ( $menu_item_db_id , '_menu_item_classes' , sanitize_html_class ( $menu_item_classes ) );
update_post_meta ( $menu_item_db_id , '_menu_item_xfn' , sanitize_html_class ( $menu_item_xfn ) );
2010-03-17 15:57:08 -04:00
// @todo: only save custom link urls.
2010-03-22 15:56:16 -04:00
update_post_meta ( $menu_item_db_id , '_menu_item_url' , esc_url_raw ( $menu_item_url ) );
2010-03-15 12:26:46 -04:00
}
2010-03-17 12:27:25 -04:00
2010-03-17 15:57:08 -04:00
// Remove menu items from the menu that weren't in $_POST
if ( ! empty ( $menu_items ) ) {
foreach ( array_keys ( $menu_items ) as $menu_item_id ) {
wp_delete_post ( $menu_item_id );
}
2010-03-15 12:26:46 -04:00
}
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
do_action ( 'wp_update_nav_menu' , $nav_menu_selected_id );
2010-03-26 15:36:49 -04:00
2010-03-22 15:56:16 -04:00
$messages_div = '<div id="message" class="updated"><p>' . sprintf ( __ ( 'The <strong>%s</strong> menu has been updated.' ), $update_nav_menu -> name ) . '</p></div>' ;
unset ( $update_nav_menu , $update_count , $menu_items );
2010-03-15 12:26:46 -04:00
}
}
break ;
2010-02-23 15:48:50 -05:00
}
2010-02-20 19:03:42 -05:00
2010-03-15 12:26:46 -04:00
// Get all nav menus
$nav_menus = wp_get_nav_menus ();
2010-03-01 22:59:28 -05:00
2010-03-15 12:26:46 -04:00
// Get recently edited nav menu
$recently_edited = get_user_option ( 'nav_menu_recently_edited' );
2010-03-01 22:59:28 -05:00
2010-03-15 12:26:46 -04:00
// If there was no recently edited menu, and $nav_menu_selected_id is a nav menu, update recently edited menu.
if ( ! $recently_edited && is_nav_menu ( $nav_menu_selected_id ) ) {
$recently_edited = $nav_menu_selected_id ;
2010-02-23 15:48:50 -05:00
2010-03-15 12:26:46 -04:00
// Else if $nav_menu_selected_id is not a menu, but $recently_edited is, grab that one.
} elseif ( 0 == $nav_menu_selected_id && is_nav_menu ( $recently_edited ) ) {
$nav_menu_selected_id = $recently_edited ;
2010-02-25 11:49:57 -05:00
2010-03-15 12:26:46 -04:00
// Else try to grab the first menu from the menus list
} elseif ( 0 == $nav_menu_selected_id && ! empty ( $nav_menus ) ) {
2010-03-17 12:27:25 -04:00
$nav_menu_selected_id = $nav_menus [ 0 ] -> term_id ;
2010-03-15 12:26:46 -04:00
}
2010-03-01 22:59:28 -05:00
2010-03-15 12:26:46 -04:00
// Update the user's setting
if ( $nav_menu_selected_id != $recently_edited && is_nav_menu ( $nav_menu_selected_id ) )
update_user_meta ( $current_user -> ID , 'nav_menu_recently_edited' , $nav_menu_selected_id );
2010-02-23 18:13:54 -05:00
2010-03-15 12:26:46 -04:00
// If there's a menu, get it's name.
if ( ! $nav_menu_selected_title && $nav_menu_selected_title = is_nav_menu ( $nav_menu_selected_id ) ) {
$nav_menu_selected_title = $nav_menu_selected_title -> name ;
}
2010-02-25 11:49:57 -05:00
2010-03-22 15:56:16 -04:00
// Create Menu Metabox
add_meta_box ( 'create-menu' , __ ( 'Create Menu' ), 'wp_nav_menu_create_metabox' , 'nav-menus' , 'side' , 'core' );
2010-03-15 12:26:46 -04:00
// The user has no menus.
if ( ! is_nav_menu ( $nav_menu_selected_id ) ) {
2010-03-22 15:56:16 -04:00
$messages_div = '<div id="message" class="updated"><p>' . __ ( 'You do not have any menus. Create a new menu.' ) . '</p></div>' ;
2010-03-24 14:35:31 -04:00
2010-03-22 15:56:16 -04:00
// The theme supports menus
} elseif ( current_theme_supports ( 'nav-menus' ) ) {
// Register nav menu metaboxes
add_meta_box ( 'manage-menu' , __ ( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox' , 'nav-menus' , 'side' , 'high' , array ( $nav_menu_selected_id , $nav_menu_selected_title ) );
wp_nav_menu_metaboxes_setup ();
2010-03-24 14:35:31 -04:00
// The theme does not support menus but supports widgets
} elseif ( current_theme_supports ( 'widgets' ) ) {
// Register nav menu metaboxes
add_meta_box ( 'manage-menu' , __ ( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox' , 'nav-menus' , 'side' , 'high' , array ( $nav_menu_selected_id , $nav_menu_selected_title ) );
wp_nav_menu_metaboxes_setup ();
$messages_div = '<div id="message" class="error"><p>' . __ ( 'The current theme does not natively support menus, but you can use the “Navigation Menu” widget to add any menus you create here to the theme’s sidebar.' ) . '</p></div>' ;
// The theme supports neither menus nor widgets.
2010-03-15 12:26:46 -04:00
} else {
2010-03-22 15:56:16 -04:00
remove_meta_box ( 'create-menu' , 'nav-menus' , 'side' );
$messages_div = '<div id="message" class="error"><p>' . __ ( 'The current theme does not support menus.' ) . '</p></div>' ;
2010-02-23 15:48:50 -05:00
}
2010-02-20 19:03:42 -05:00
2010-03-15 12:26:46 -04:00
// Get the admin header
require_once ( 'admin-header.php' );
2010-02-23 15:48:50 -05:00
?>
< div class = " wrap " >
2010-02-24 19:03:42 -05:00
< ? php screen_icon (); ?>
2010-02-27 18:06:56 -05:00
< h2 >< ? php esc_html_e ( 'Menus' ); ?> </h2>
2010-04-02 18:46:48 -04:00
< ? php /* OMGWTFBBQ */ ?> <div class="error"><p><strong><?php _e('Beta Testers:') ?></strong> <?php _e('This feature is still under construction. You can try it out, but expect it to change in layout and functionality in the second beta release.'); ?></p></div>
2010-02-24 19:03:42 -05:00
< ? php echo $messages_div ; ?>
< div class = " hide-if-js error " >< p >< ? php _e ( 'You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.' ); ?> </p></div>
2010-03-01 22:59:28 -05:00
2010-03-24 14:35:31 -04:00
< ? php if ( ! empty ( $nav_menus ) && count ( $nav_menus ) > 1 && ( current_theme_supports ( 'nav-menus' ) || current_theme_supports ( 'widgets' ) ) ) : ?>
2010-03-15 12:26:46 -04:00
< ul class = " subsubsub " >
< ? php
foreach ( $nav_menus as $_nav_menu ) {
$sep = end ( $nav_menus ) == $_nav_menu ? '' : ' | ' ;
2010-03-17 12:27:25 -04:00
2010-03-15 12:26:46 -04:00
if ( $nav_menu_selected_id == $_nav_menu -> term_id )
echo '<li><a href="' . admin_url ( 'nav-menus.php?action=edit&menu=' . esc_attr ( $_nav_menu -> term_id ) ) . '" class="current">' . esc_html ( $_nav_menu -> name ) . '</a>' . $sep . '</li>' ;
else
echo '<li><a href="' . admin_url ( 'nav-menus.php?action=edit&menu=' . esc_attr ( $_nav_menu -> term_id ) ) . '">' . esc_html ( $_nav_menu -> name ) . '</a>' . $sep . '</li>' ;
}
?>
</ ul >
< ? php endif ; ?>
< div id = " menu-management " class = " metabox-holder has-right-sidebar " >
2010-03-22 15:56:16 -04:00
< form id = " update-nav-menu " action = " <?php echo admin_url( 'nav-menus.php' ); ?> " method = " post " enctype = " multipart/form-data " >
2010-03-15 12:26:46 -04:00
< ? php wp_nonce_field ( 'closedpostboxes' , 'closedpostboxesnonce' , false ); ?>
< ? php wp_nonce_field ( 'meta-box-order' , 'meta-box-order-nonce' , false ); ?>
< ? php wp_nonce_field ( 'update-nav_menu' ); ?>
< input type = " hidden " name = " action " value = " update " />
2010-03-22 15:56:16 -04:00
< input type = " hidden " name = " li-count " id = " li-count " value = " -1 " />
2010-03-15 12:26:46 -04:00
< input type = " hidden " name = " menu " id = " menu " value = " <?php echo esc_attr( $nav_menu_selected_id ); ?> " />
2010-03-22 15:56:16 -04:00
< input type = " hidden " id = " hidden-metaboxes " value = " <?php echo wp_initial_nav_menu_meta_boxes(); ?> " />
2010-02-27 18:06:56 -05:00
< div id = " post-body " >
< div id = " post-body-content " >
2010-03-24 14:35:31 -04:00
< ? php if ( is_nav_menu ( $nav_menu_selected_id ) && ( current_theme_supports ( 'nav-menus' ) || current_theme_supports ( 'widgets' ) ) ) : ?>
2010-03-01 22:59:28 -05:00
< div id = " menu-container " class = " postbox " >
2010-03-15 12:26:46 -04:00
< h3 class = " hndle " >< ? php echo esc_html ( $nav_menu_selected_title ); ?> </h3>
2010-02-27 18:06:56 -05:00
< div class = " inside " >
2010-03-15 12:26:46 -04:00
< ? php echo wp_get_nav_menu ( array ( 'context' => 'backend' , 'menu' => $nav_menu_selected_id ) ); ?>
2010-02-27 18:06:56 -05:00
</ div ><!-- /. inside -->
<!-- / #nav-menu-canvas .postbox-->
</ div >
< ? php endif ; ?>
</ div ><!-- / #post-body-content-->
</ div ><!--- / #post-body -->
2010-02-24 19:03:42 -05:00
< div id = " menu-settings-column " class = " inner-sidebar " >
2010-03-17 12:27:25 -04:00
2010-03-22 15:56:16 -04:00
< ? php do_meta_boxes ( 'nav-menus' , 'side' , null ); ?>
2010-03-17 12:27:25 -04:00
2010-02-24 19:03:42 -05:00
</ div ><!-- / #menu-settings-column -->
2010-03-15 12:26:46 -04:00
</ form ><!--/ #update-nav-menu-->
< br class = " clear " />
</ div ><!-- /. metabox - holder has - right - sidebar -->
2010-02-24 19:03:42 -05:00
</ div ><!-- /. wrap -->
2010-02-23 15:48:50 -05:00
2010-02-27 18:06:56 -05:00
< div id = " menu-item-settings " >
< p class = " description " >
2010-03-15 12:26:46 -04:00
< label for = " edit-menu-item-title " >
2010-02-27 18:06:56 -05:00
< ? php _e ( 'Menu Title' ); ?> <br />
2010-03-15 12:26:46 -04:00
< input type = " text " id = " edit-menu-item-title " class = " widefat " name = " edit-menu-item-title " value = " " tabindex = " 1 " />
2010-02-27 18:06:56 -05:00
</ label >
</ p >
< p class = " description " >
2010-03-15 12:26:46 -04:00
< label for = " edit-menu-item-url " >
2010-02-27 18:06:56 -05:00
< ? php _e ( 'URL' ); ?> <br />
2010-03-15 12:26:46 -04:00
< input type = " text " id = " edit-menu-item-url " class = " widefat code " name = " edit-menu-item-url " value = " " tabindex = " 2 " />
2010-02-27 18:06:56 -05:00
</ label >
</ p >
< p class = " description " >
2010-03-15 12:26:46 -04:00
< label for = " edit-menu-item-attr-title " >
< ? php _e ( 'Title Attribute' ); ?> <br />
< input type = " text " id = " edit-menu-item-attr-title " class = " widefat " name = " edit-menu-item-attr-title " value = " " tabindex = " 3 " />
2010-02-27 18:06:56 -05:00
</ label >
</ p >
< p class = " description " >
2010-03-15 12:26:46 -04:00
< label for = " edit-menu-item-target " >
< ? php _e ( 'Link Target' ); ?> <br />
< select id = " edit-menu-item-target " class = " widefat " name = " edit-menu-item-target " tabindex = " 4 " >
2010-04-03 18:52:30 -04:00
< option value = " " >< ? php _e ( 'Same window or tab' ); ?> </option>
2010-03-16 15:20:10 -04:00
< option value = " _blank " >< ? php _e ( 'New window or tab' ); ?> </option>
2010-02-27 18:06:56 -05:00
</ select >
</ label >
</ p >
< p class = " description " >
2010-03-15 12:26:46 -04:00
< label for = " edit-menu-item-classes " >
< ? php _e ( 'CSS Classes (optional)' ); ?> <br />
< input type = " text " id = " edit-menu-item-classes " class = " widefat code " name = " edit-menu-item-classes " value = " " tabindex = " 5 " />
</ label >
</ p >
< p class = " description " >
< label for = " edit-menu-item-xfn " >
< ? php _e ( 'Link Relationship (XFN) (optional)' ); ?> <br />
< input type = " text " id = " edit-menu-item-xfn " class = " widefat code " name = " edit-menu-item-xfn " value = " " tabindex = " 6 " />
</ label >
</ p >
< p class = " description " >
< label for = " edit-menu-item-description " >
< ? php _e ( 'Description (optional)' ); ?> <br />
< textarea id = " edit-menu-item-description " class = " widefat " rows = " 3 " name = " edit-menu-item-description " tabindex = " 7 " /></ textarea >
2010-03-16 15:20:10 -04:00
< span class = " description " >< ? php _e ( 'The description will be displayed in the menu if the current theme supports it.' ); ?> </span>
2010-02-27 18:06:56 -05:00
</ label >
</ p >
< p >
2010-03-15 12:26:46 -04:00
< a id = " update-menu-item " class = " save button-primary " tabindex = " 8 " >< ? php _e ( 'Save Changes' ); ?> </a>
< a id = " cancel-save " class = " submitdelete deletion " tabindex = " 9 " >< ? php _e ( 'Cancel' ); ?> </a>
2010-02-27 18:06:56 -05:00
</ p >
2010-03-15 12:26:46 -04:00
< input type = " hidden " id = " edit-menu-item-id " name = " edit-item-id " value = " " />
2010-02-27 18:06:56 -05:00
</ div ><!-- / #menu-item-settings-->
< ? php include ( 'admin-footer.php' ); ?>