Changeset 30885 for trunk/src/wp-admin/custom-background.php
- Timestamp:
- 12/15/2014 11:27:17 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/custom-background.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/custom-background.php
r30657 r30885 61 61 62 62 add_action( 'admin_menu', array( $this, 'init' ) ); 63 64 add_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) ); 65 66 // Unused since 3.5.0. 63 67 add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) ); 64 68 } … … 465 469 466 470 /** 467 * Unused since 3.5.0. 471 * AJAX handler for adding custom background context to an attachment. 472 * 473 * Triggered when the user adds a new background image from the 474 * Media Manager. 475 * 476 * @since 4.1.0 477 */ 478 public function ajax_background_add() { 479 check_ajax_referer( 'background-add', 'nonce' ); 480 481 if ( ! current_user_can( 'edit_theme_options' ) ) { 482 wp_send_json_error(); 483 } 484 485 $attachment_id = absint( $_POST['attachment_id'] ); 486 if ( $attachment_id < 1 ) { 487 wp_send_json_error(); 488 } 489 490 update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_stylesheet() ); 491 492 wp_send_json_success(); 493 } 494 495 /** 468 496 * 469 497 * @since 3.4.0 498 * @deprecated 3.5.0 470 499 */ 471 500 public function attachment_fields_to_edit( $form_fields ) { … … 474 503 475 504 /** 476 * Unused since 3.5.0.477 505 * 478 506 * @since 3.4.0 507 * @deprecated 3.5.0 479 508 */ 480 509 public function filter_upload_tabs( $tabs ) { … … 482 511 } 483 512 513 /** 514 * 515 * @since 3.4.0 516 * @deprecated 3.5.0 517 */ 484 518 public function wp_set_background_image() { 485 519 if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)