| @@ -69,37 +69,5 @@ | ||
| 69 | 69 | |
| 70 | 70 | return $instance; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | -add_action( 'in_widget_form', 'bogo_in_widget_form', 10, 3 ); | |
| 74 | - | |
| 75 | -function bogo_in_widget_form( $widget, $return, $instance ) { | |
| 76 | - $available_languages = bogo_available_languages( 'orderby=value' ); | |
| 77 | - | |
| 78 | - $selected_languages = ! isset( $instance['bogo_locales'] ) | |
| 79 | - ? array_keys( $available_languages ) : (array) $instance['bogo_locales']; | |
| 80 | - | |
| 81 | -?> | |
| 82 | -<fieldset style="padding: .4em 1em .6em; border: 1px solid #ccc;"> | |
| 83 | -<legend style="padding: 0 1em;"><?php echo esc_html( __( 'Displayed on pages in:', 'bogo' ) ); ?></legend> | |
| 84 | -<?php foreach ( $available_languages as $locale => $language ) : ?> | |
| 85 | -<input type="checkbox" id="<?php echo $widget->get_field_id( 'bogo_locales' ); ?>" name="<?php echo $widget->get_field_name( 'bogo_locales' ); ?>[]" value="<?php echo esc_attr( $locale ); ?>"<?php echo in_array( $locale, $selected_languages ) ? ' checked="checked"' : ''; ?> /> | |
| 86 | - <?php echo esc_html( $language ); ?><br /> | |
| 87 | -<?php endforeach; ?> | |
| 88 | -</fieldset> | |
| 89 | -<?php | |
| 90 | - | |
| 91 | - $return = null; | |
| 92 | -} | |
| 93 | - | |
| 94 | -add_filter( 'widget_update_callback', 'bogo_widget_update_callback', 10, 4 ); | |
| 95 | - | |
| 96 | -function bogo_widget_update_callback( $instance, $new_instance, $old_instance, $widget ) { | |
| 97 | - if ( isset( $new_instance['bogo_locales'] ) && is_array( $new_instance['bogo_locales'] ) ) | |
| 98 | - $instance['bogo_locales'] = $new_instance['bogo_locales']; | |
| 99 | - else | |
| 100 | - $instance['bogo_locales'] = array(); | |
| 101 | - | |
| 102 | - return $instance; | |
| 103 | -} | |
| 104 | - | |
| 105 | 73 | ?> |