wp/wp-admin/link.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     8  * @package WordPress
     8  * @package WordPress
     9  * @subpackage Administration
     9  * @subpackage Administration
    10  */
    10  */
    11 
    11 
    12 /** Load WordPress Administration Bootstrap */
    12 /** Load WordPress Administration Bootstrap */
    13 require_once( dirname( __FILE__ ) . '/admin.php' );
    13 require_once __DIR__ . '/admin.php';
    14 
    14 
    15 wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
    15 wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
    16 
    16 
    17 if ( ! current_user_can( 'manage_links' ) ) {
    17 if ( ! current_user_can( 'manage_links' ) ) {
    18 	wp_link_manager_disabled_message();
    18 	wp_link_manager_disabled_message();
    33 switch ( $action ) {
    33 switch ( $action ) {
    34 	case 'deletebookmarks':
    34 	case 'deletebookmarks':
    35 		check_admin_referer( 'bulk-bookmarks' );
    35 		check_admin_referer( 'bulk-bookmarks' );
    36 
    36 
    37 		// For each link id (in $linkcheck[]) change category to selected value.
    37 		// For each link id (in $linkcheck[]) change category to selected value.
    38 		if ( count( $linkcheck ) == 0 ) {
    38 		if ( count( $linkcheck ) === 0 ) {
    39 			wp_redirect( $this_file );
    39 			wp_redirect( $this_file );
    40 			exit;
    40 			exit;
    41 		}
    41 		}
    42 
    42 
    43 		$deleted = 0;
    43 		$deleted = 0;
    54 
    54 
    55 	case 'move':
    55 	case 'move':
    56 		check_admin_referer( 'bulk-bookmarks' );
    56 		check_admin_referer( 'bulk-bookmarks' );
    57 
    57 
    58 		// For each link id (in $linkcheck[]) change category to selected value.
    58 		// For each link id (in $linkcheck[]) change category to selected value.
    59 		if ( count( $linkcheck ) == 0 ) {
    59 		if ( count( $linkcheck ) === 0 ) {
    60 			wp_redirect( $this_file );
    60 			wp_redirect( $this_file );
    61 			exit;
    61 			exit;
    62 		}
    62 		}
    63 		$all_links = join( ',', $linkcheck );
    63 		$all_links = join( ',', $linkcheck );
    64 		/*
    64 		/*
   110 		$submenu_file = 'link-manager.php';
   110 		$submenu_file = 'link-manager.php';
   111 		$title        = __( 'Edit Link' );
   111 		$title        = __( 'Edit Link' );
   112 
   112 
   113 		$link_id = (int) $_GET['link_id'];
   113 		$link_id = (int) $_GET['link_id'];
   114 
   114 
   115 		if ( ! $link = get_link_to_edit( $link_id ) ) {
   115 		$link = get_link_to_edit( $link_id );
       
   116 		if ( ! $link ) {
   116 			wp_die( __( 'Link not found.' ) );
   117 			wp_die( __( 'Link not found.' ) );
   117 		}
   118 		}
   118 
   119 
   119 		include( ABSPATH . 'wp-admin/edit-link-form.php' );
   120 		require ABSPATH . 'wp-admin/edit-link-form.php';
   120 		include( ABSPATH . 'wp-admin/admin-footer.php' );
   121 		require_once ABSPATH . 'wp-admin/admin-footer.php';
   121 		break;
   122 		break;
   122 
   123 
   123 	default:
   124 	default:
   124 		break;
   125 		break;
   125 }
   126 }