Changeset 22783
- Timestamp:
- 11/21/2012 06:53:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin-rtl.css
r22755 r22783 921 921 padding-left: 0; 922 922 padding-right: 18px; 923 } 924 925 .compat-attachment-fields th { 926 padding-right: 0; 927 padding-left: 10px; 923 928 } 924 929 -
trunk/wp-admin/css/wp-admin.css
r22755 r22783 3401 3401 } 3402 3402 3403 .compat-attachment-fields th { 3404 padding-top: 5px; 3405 padding-right: 10px; 3406 } 3407 3403 3408 /*------------------------------------------------------------------------------ 3404 3409 11.2 - Post Revisions -
trunk/wp-admin/includes/media.php
r22765 r22783 1277 1277 $default_args = array( 1278 1278 'errors' => null, 1279 'taxonomies' => false, 1279 1280 ); 1280 1281 … … 1284 1285 $form_fields = array(); 1285 1286 1286 foreach ( get_attachment_taxonomies($post) as $taxonomy ) { 1287 $t = (array) get_taxonomy($taxonomy); 1288 if ( ! $t['public'] || ! $t['show_ui'] ) 1289 continue; 1290 if ( empty($t['label']) ) 1291 $t['label'] = $taxonomy; 1292 if ( empty($t['args']) ) 1293 $t['args'] = array(); 1294 1295 $terms = get_object_term_cache($post->ID, $taxonomy); 1296 if ( false === $terms ) 1297 $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); 1298 1299 $values = array(); 1300 1301 foreach ( $terms as $term ) 1302 $values[] = $term->slug; 1303 $t['value'] = join(', ', $values); 1304 1305 $form_fields[$taxonomy] = $t; 1287 if ( $args['taxonomies'] ) { 1288 foreach ( get_attachment_taxonomies($post) as $taxonomy ) { 1289 $t = (array) get_taxonomy($taxonomy); 1290 if ( ! $t['public'] || ! $t['show_ui'] ) 1291 continue; 1292 if ( empty($t['label']) ) 1293 $t['label'] = $taxonomy; 1294 if ( empty($t['args']) ) 1295 $t['args'] = array(); 1296 1297 $terms = get_object_term_cache($post->ID, $taxonomy); 1298 if ( false === $terms ) 1299 $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); 1300 1301 $values = array(); 1302 1303 foreach ( $terms as $term ) 1304 $values[] = $term->slug; 1305 $t['value'] = join(', ', $values); 1306 1307 $form_fields[$taxonomy] = $t; 1308 } 1306 1309 } 1307 1310 … … 1333 1336 1334 1337 $name = "attachments[$attachment_id][$id]"; 1338 $id_attr = "attachments-$attachment_id-$id"; 1335 1339 1336 1340 if ( !empty( $field['tr'] ) ) { … … 1342 1346 1343 1347 if ( $field['input'] == 'hidden' ) { 1344 $hidden_fields[$ id] = $field['value'];1348 $hidden_fields[$name] = $field['value']; 1345 1349 continue; 1346 1350 } … … 1348 1352 $required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : ''; 1349 1353 $aria_required = $field['required'] ? " aria-required='true' " : ''; 1350 $class = 'compat- item-' . $name;1354 $class = 'compat-field-' . $id; 1351 1355 $class .= $field['required'] ? ' form-required' : ''; 1352 1356 1353 1357 $item .= "\t\t<tr class='$class'>"; 1354 $item .= "\t\t\t<th valign='top' scope='row' class='label'><label for='$ name'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>";1358 $item .= "\t\t\t<th valign='top' scope='row' class='label'><label for='$id_attr'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>"; 1355 1359 $item .= "</th>\n\t\t\t<td class='field'>"; 1356 1360 … … 1362 1366 $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); 1363 1367 } 1364 $item .= "<textarea id='$ name' name='$name' $aria_required>" . $field['value'] . '</textarea>';1368 $item .= "<textarea id='$id_attr' name='$name' $aria_required>" . $field['value'] . '</textarea>'; 1365 1369 } else { 1366 $item .= "<input type='text' class='text' id='$ name' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />";1370 $item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />"; 1367 1371 } 1368 1372 if ( !empty( $field['helps'] ) ) … … 1389 1393 $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n"; 1390 1394 if ( $item ) 1391 $item = '<table >' . $item . '</table>';1395 $item = '<table class="compat-attachment-fields">' . $item . '</table>'; 1392 1396 1393 1397 return array( … … 2286 2290 </div> 2287 2291 <?php 2292 $extras = get_compat_media_markup( $post->ID ); 2293 echo $extras['item']; 2294 foreach ( $extras['hidden'] as $hidden_field => $value ) { 2295 echo '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n"; 2296 } 2288 2297 } 2289 2298 -
trunk/wp-admin/includes/post.php
r22769 r22783 239 239 update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) ); 240 240 } 241 242 if ( isset( $post_data['attachments'][ $post_ID ] ) ) 243 $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $post_data['attachments'][ $post_ID ] ); 241 244 } 242 245 -
trunk/wp-includes/media.php
r22770 r22783 1294 1294 1295 1295 if ( function_exists('get_compat_media_markup') ) 1296 $response['compat'] = get_compat_media_markup( $attachment->ID );1296 $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'taxonomies' => true ) ); 1297 1297 1298 1298 return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
Note: See TracChangeset
for help on using the changeset viewer.