| @@ 68-92 (lines=25) @@ | ||
| 65 | * @param mixed $instance Instance. |
|
| 66 | * @return void |
|
| 67 | */ |
|
| 68 | public function form( $instance ) { |
|
| 69 | ||
| 70 | // Set default values. |
|
| 71 | $instance = wp_parse_args( (array) $instance, array( |
|
| 72 | 'title' => '', |
|
| 73 | 'color' => '0054a0', |
|
| 74 | ) ); |
|
| 75 | ||
| 76 | // Retrieve an existing value from the database. |
|
| 77 | $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
| 78 | $color = ! empty( $instance['color'] ) ? $instance['color'] : ''; |
|
| 79 | ||
| 80 | // Title. |
|
| 81 | echo '<p>'; |
|
| 82 | echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
| 83 | echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
| 84 | echo '</p>'; |
|
| 85 | ||
| 86 | // Color. |
|
| 87 | echo '<p>'; |
|
| 88 | echo ' <label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Color:', 're-pro' ) . '</label>'; |
|
| 89 | echo ' <input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color . '" class="widefat">'; |
|
| 90 | echo '</p>'; |
|
| 91 | ||
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Update Widget Instance. |
|
| @@ 67-91 (lines=25) @@ | ||
| 64 | * @param mixed $instance Instance. |
|
| 65 | * @return void |
|
| 66 | */ |
|
| 67 | public function form( $instance ) { |
|
| 68 | ||
| 69 | // Set default values. |
|
| 70 | $instance = wp_parse_args( (array) $instance, array( |
|
| 71 | 'title' => '', |
|
| 72 | 'location' => '', |
|
| 73 | ) ); |
|
| 74 | ||
| 75 | // Retrieve an existing value from the database. |
|
| 76 | $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
| 77 | $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
| 78 | ||
| 79 | // Title. |
|
| 80 | echo '<p>'; |
|
| 81 | echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
| 82 | echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
| 83 | echo '</p>'; |
|
| 84 | ||
| 85 | // Location. |
|
| 86 | echo '<p>'; |
|
| 87 | echo ' <label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>'; |
|
| 88 | echo ' <input id="' . $this->get_field_id( 'location' ) . '" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">'; |
|
| 89 | echo '</p>'; |
|
| 90 | ||
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Update Widget Instance. |
|