Changeset 28407
- Timestamp:
- 05/15/2014 02:45:01 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r28368 r28407 1286 1286 $current_post_id = !empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0; 1287 1287 1288 $default_args = array( 'errors' => null, 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true ); 1288 $default_args = array( 1289 'errors' => null, 1290 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true, 1291 'delete' => true, 1292 'toggle' => true, 1293 'show_title' => true 1294 ); 1289 1295 $args = wp_parse_args( $args, $default_args ); 1290 1296 … … 1298 1304 * @param array $args An array of arguments. 1299 1305 */ 1300 $args = apply_filters( 'get_media_item_args', $args ); 1301 extract( $args, EXTR_SKIP ); 1306 $r = apply_filters( 'get_media_item_args', $args ); 1302 1307 1303 1308 $toggle_on = __( 'Show' ); … … 1312 1317 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 1313 1318 1314 $form_fields = get_attachment_fields_to_edit( $post, $ errors);1315 1316 if ( $ toggle) {1317 $class = empty( $ errors) ? 'startclosed' : 'startopen';1319 $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] ); 1320 1321 if ( $r['toggle'] ) { 1322 $class = empty( $r['errors'] ) ? 'startclosed' : 'startopen'; 1318 1323 $toggle_links = " 1319 1324 <a class='toggle describe-toggle-on' href='#'>$toggle_on</a> … … 1325 1330 1326 1331 $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case 1327 $display_title = $ show_title? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . "</span></div>" : '';1332 $display_title = $r['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . "</span></div>" : ''; 1328 1333 1329 1334 $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ); … … 1399 1404 ); 1400 1405 1401 if ( $send ) 1402 $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ); 1406 if ( $r['send'] ) { 1407 $r['send'] = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ); 1408 } 1409 1410 $delete = empty( $r['delete'] ) ? '' : $r['delete']; 1403 1411 if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { 1404 1412 if ( !EMPTY_TRASH_DAYS ) { … … 1420 1428 $thumbnail = ''; 1421 1429 $calling_post_id = 0; 1422 if ( isset( $_GET['post_id'] ) ) 1430 if ( isset( $_GET['post_id'] ) ) { 1423 1431 $calling_post_id = absint( $_GET['post_id'] ); 1424 elseif ( isset( $_POST ) && count( $_POST ) )// Like for async-upload where $_GET['post_id'] isn't set1432 } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set 1425 1433 $calling_post_id = $post->post_parent; 1434 } 1426 1435 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1427 1436 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { … … 1430 1439 } 1431 1440 1432 if ( ( $ send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) )1433 $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'> $send$thumbnail $delete</td></tr>\n" );1434 1441 if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) { 1442 $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $r['send'] . " $thumbnail $delete</td></tr>\n" ); 1443 } 1435 1444 $hidden_fields = array(); 1436 1445 -
trunk/src/wp-includes/bookmark-template.php
r28405 r28407 242 242 } 243 243 244 if ( $ categorize) {244 if ( $r['categorize'] ) { 245 245 // Split the bookmarks into ul's for each category 246 246 foreach ( (array) $cats as $cat ) {
Note: See TracChangeset
for help on using the changeset viewer.