| @@ 810-817 (lines=8) @@ | ||
| 807 | return $this->sanitize_1or0_option( $value ); |
|
| 808 | } |
|
| 809 | ||
| 810 | function carousel_background_color_callback() { |
|
| 811 | $this->settings_select( |
|
| 812 | 'carousel_background_color', array( |
|
| 813 | 'black' => __( 'Black', 'jetpack' ), |
|
| 814 | 'white' => __( 'White', 'jetpack' ), |
|
| 815 | ) |
|
| 816 | ); |
|
| 817 | } |
|
| 818 | ||
| 819 | function carousel_background_color_sanitize( $value ) { |
|
| 820 | 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 ) ) { |
|