| @@ 760-767 (lines=8) @@ | ||
| 757 | return $this->sanitize_1or0_option( $value ); |
|
| 758 | } |
|
| 759 | ||
| 760 | function carousel_background_color_callback() { |
|
| 761 | $this->settings_select( |
|
| 762 | 'carousel_background_color', array( |
|
| 763 | 'black' => __( 'Black', 'jetpack' ), |
|
| 764 | 'white' => __( 'White', 'jetpack' ), |
|
| 765 | ) |
|
| 766 | ); |
|
| 767 | } |
|
| 768 | ||
| 769 | function carousel_background_color_sanitize( $value ) { |
|
| 770 | return ( 'white' == $value ) ? 'white' : 'black'; |
|
| @@ 76-82 (lines=7) @@ | ||
| 73 | register_setting( 'media', 'jetpack_slideshow_background_color', array( $this, 'slideshow_background_color_sanitize' ) ); |
|
| 74 | } |
|
| 75 | ||
| 76 | function slideshow_background_color_callback() { |
|
| 77 | $options = array( |
|
| 78 | 'black' => __( 'Black', 'jetpack' ), |
|
| 79 | 'white' => __( 'White', 'jetpack' ), |
|
| 80 | ); |
|
| 81 | $this->settings_select( 'jetpack_slideshow_background_color', $options ); |
|
| 82 | } |
|
| 83 | ||
| 84 | function settings_select( $name, $values, $extra_text = '' ) { |
|
| 85 | if ( empty( $name ) || empty( $values ) || ! is_array( $values ) ) { |
|