Changeset 12081 for trunk/wp-admin/includes/media.php
- Timestamp:
- 10/21/2009 07:27:33 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/media.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r12060 r12081 1102 1102 */ 1103 1103 function get_media_item( $attachment_id, $args = null ) { 1104 global $redir_tab; 1105 1106 $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); 1107 $args = wp_parse_args( $args, $default_args ); 1108 extract( $args, EXTR_SKIP ); 1109 1110 global $post_mime_types; 1104 global $post_mime_types, $redir_tab; 1105 1111 1106 if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) ) 1112 1107 $thumb_url = $thumb_url[0]; 1113 1108 else 1114 1109 return false; 1110 1111 $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); 1112 $args = wp_parse_args( $args, $default_args ); 1113 extract( $args, EXTR_SKIP ); 1115 1114 1116 1115 $toggle_on = __('Show'); … … 1142 1141 <a class='toggle describe-toggle-on' href='#'>$toggle_on</a> 1143 1142 <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>"; 1144 if ( 'image' == $type )1145 $toggle_links .= "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"" . intval( $attachment_id ) . "\");return false;'>" . esc_html__( "Use for thumbnail" ) . "</a>";1146 1143 } else { 1147 1144 $class = 'form-table'; … … 1210 1207 if ( $delete ) 1211 1208 $delete = current_user_can('delete_post', $attachment_id) ? "<a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a>" : ""; 1212 if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) 1213 $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete</td></tr>\n"); 1209 if ( 'image' == $type && get_post_image_id($_GET['post_id']) != $attachment_id ) 1210 $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 1211 1212 if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) 1213 $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $thumbnail $delete</td></tr>\n"); 1214 1214 1215 1215 $hidden_fields = array();
Note: See TracChangeset
for help on using the changeset viewer.