12 $parent_file = 'upload.php'; |
12 $parent_file = 'upload.php'; |
13 $submenu_file = 'upload.php'; |
13 $submenu_file = 'upload.php'; |
14 |
14 |
15 wp_reset_vars(array('action')); |
15 wp_reset_vars(array('action')); |
16 |
16 |
17 switch( $action ) : |
17 switch ( $action ) { |
18 case 'editattachment' : |
18 case 'editattachment' : |
19 $attachment_id = (int) $_POST['attachment_id']; |
19 $attachment_id = (int) $_POST['attachment_id']; |
20 check_admin_referer('media-form'); |
20 check_admin_referer('media-form'); |
21 |
21 |
22 if ( !current_user_can('edit_post', $attachment_id) ) |
22 if ( !current_user_can('edit_post', $attachment_id) ) |
78 '<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>' |
78 '<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>' |
79 ) ); |
79 ) ); |
80 |
80 |
81 get_current_screen()->set_help_sidebar( |
81 get_current_screen()->set_help_sidebar( |
82 '<p><strong>' . __('For more information:') . '</strong></p>' . |
82 '<p><strong>' . __('For more information:') . '</strong></p>' . |
83 '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' . |
83 '<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' . |
84 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
84 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
85 ); |
85 ); |
86 |
86 |
87 require( ABSPATH . 'wp-admin/admin-header.php' ); |
87 require( ABSPATH . 'wp-admin/admin-header.php' ); |
88 |
88 |
89 $parent_file = 'upload.php'; |
89 $parent_file = 'upload.php'; |
90 $message = ''; |
90 $message = ''; |
91 $class = ''; |
91 $class = ''; |
92 if ( isset($_GET['message']) ) { |
92 if ( isset($_GET['message']) ) { |
93 switch ( $_GET['message'] ) : |
93 switch ( $_GET['message'] ) { |
94 case 'updated' : |
94 case 'updated' : |
95 $message = __('Media attachment updated.'); |
95 $message = __('Media attachment updated.'); |
96 $class = 'updated'; |
96 $class = 'updated'; |
97 break; |
97 break; |
98 endswitch; |
98 } |
99 } |
99 } |
100 if ( $message ) |
100 if ( $message ) |
101 echo "<div id='message' class='$class'><p>$message</p></div>\n"; |
101 echo "<div id='message' class='$class'><p>$message</p></div>\n"; |
102 |
102 |
103 ?> |
103 ?> |
104 |
104 |
105 <div class="wrap"> |
105 <div class="wrap"> |
106 <?php screen_icon(); ?> |
|
107 <h2> |
106 <h2> |
108 <?php |
107 <?php |
109 echo esc_html( $title ); |
108 echo esc_html( $title ); |
110 if ( current_user_can( 'upload_files' ) ) { ?> |
109 if ( current_user_can( 'upload_files' ) ) { ?> |
111 <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> |
110 <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> |
112 <?php } ?> |
111 <?php } ?> |
113 </h2> |
112 </h2> |
114 |
113 |
115 <form method="post" action="" class="media-upload-form" id="media-single-form"> |
114 <form method="post" class="media-upload-form" id="media-single-form"> |
116 <p class="submit" style="padding-bottom: 0;"> |
115 <p class="submit" style="padding-bottom: 0;"> |
117 <?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?> |
116 <?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?> |
118 </p> |
117 </p> |
119 |
118 |
120 <div class="media-single"> |
119 <div class="media-single"> |
121 <div id='media-item-<?php echo $att_id; ?>' class='media-item'> |
120 <div id="media-item-<?php echo $att_id; ?>" class="media-item"> |
122 <?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, 'show_title' => false, 'errors' => !empty($errors[$att_id]) ? $errors[$att_id] : null ) ); ?> |
121 <?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, 'show_title' => false, 'errors' => !empty($errors[$att_id]) ? $errors[$att_id] : null ) ); ?> |
123 </div> |
122 </div> |
124 </div> |
123 </div> |
125 |
124 |
126 <?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?> |
125 <?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?> |