@@ 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 ) ) { |
@@ 770-777 (lines=8) @@ | ||
767 | return $this->sanitize_1or0_option( $value ); |
|
768 | } |
|
769 | ||
770 | function carousel_background_color_callback() { |
|
771 | $this->settings_select( |
|
772 | 'carousel_background_color', array( |
|
773 | 'black' => __( 'Black', 'jetpack' ), |
|
774 | 'white' => __( 'White', 'jetpack' ), |
|
775 | ) |
|
776 | ); |
|
777 | } |
|
778 | ||
779 | function carousel_background_color_sanitize( $value ) { |
|
780 | return ( 'white' == $value ) ? 'white' : 'black'; |