Changeset 22778 for trunk/wp-admin/custom-background.php
- Timestamp:
- 11/21/2012 05:44:49 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/custom-background.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-background.php
r22521 r22778 73 73 add_action("load-$page", array(&$this, 'take_action'), 49); 74 74 add_action("load-$page", array(&$this, 'handle_upload'), 49); 75 76 if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-background' ) {77 add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );78 add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );79 add_filter( 'media_upload_mime_type_links', '__return_empty_array' );80 }81 75 82 76 if ( $this->admin_header_callback ) … … 106 100 ); 107 101 108 add_thickbox();109 102 wp_enqueue_media(); 110 103 wp_enqueue_script('custom-background'); … … 398 391 399 392 /** 400 * Replace default attachment actions with "Set as background" link.393 * Unused since 3.5.0. 401 394 * 402 395 * @since 3.4.0 403 396 */ 404 function attachment_fields_to_edit( $form_fields, $post ) { 405 $form_fields = array( 'image-size' => $form_fields['image-size'] ); 406 $form_fields['buttons'] = array( 'tr' => '<tr class="submit"><td></td><td><a data-attachment-id="' . $post->ID . '" class="wp-set-background">' . __( 'Set as background' ) . '</a></td></tr>' ); 407 $form_fields['context'] = array( 'input' => 'hidden', 'value' => 'custom-background' ); 408 397 function attachment_fields_to_edit( $form_fields ) { 409 398 return $form_fields; 410 399 } 411 400 412 401 /** 413 * Leave only "Media Library" tab in the uploader window.402 * Unused since 3.5.0. 414 403 * 415 404 * @since 3.4.0 416 405 */ 417 function filter_upload_tabs( ) {418 return array( 'library' => __('Media Library') );406 function filter_upload_tabs( $tabs ) { 407 return $tabs; 419 408 } 420 409
Note: See TracChangeset
for help on using the changeset viewer.