| @@ 112-155 (lines=44) @@ | ||
| 109 | * @param mixed $instance |
|
| 110 | * @return void |
|
| 111 | */ |
|
| 112 | public function form( $instance ) { |
|
| 113 | ||
| 114 | // Set default values |
|
| 115 | $instance = wp_parse_args( (array) $instance, array( |
|
| 116 | 'latitude' => '', |
|
| 117 | 'longitude' => '', |
|
| 118 | 'level' => '', |
|
| 119 | 'title' => '', |
|
| 120 | ) ); |
|
| 121 | ||
| 122 | // Retrieve an existing value from the database |
|
| 123 | $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
| 124 | $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
| 125 | $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
| 126 | $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
| 127 | ||
| 128 | // Form fields |
|
| 129 | echo '<p>'; |
|
| 130 | echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title_label">' . __( 'Title', 're-pro' ) . '</label>'; |
|
| 131 | echo ' <input type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $title ) . '">'; |
|
| 132 | echo ' <span class="description">' . __( 'Title', 're-pro' ) . '</span>'; |
|
| 133 | echo '</p>'; |
|
| 134 | ||
| 135 | echo '<p>'; |
|
| 136 | echo ' <label for="' . $this->get_field_id( 'latitude' ) . '" class="latitude_label">' . __( 'Latitude', 're-pro' ) . '</label>'; |
|
| 137 | echo ' <input type="text" id="' . $this->get_field_id( 'latitude' ) . '" name="' . $this->get_field_name( 'latitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $latitude ) . '">'; |
|
| 138 | echo ' <span class="description">' . __( 'Latitude', 're-pro' ) . '</span>'; |
|
| 139 | echo '</p>'; |
|
| 140 | ||
| 141 | echo '<p>'; |
|
| 142 | echo ' <label for="' . $this->get_field_id( 'longitude' ) . '" class="longitude_label">' . __( 'Longitude', 're-pro' ) . '</label>'; |
|
| 143 | echo ' <input type="text" id="' . $this->get_field_id( 'longitude' ) . '" name="' . $this->get_field_name( 'longitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $longitude ) . '">'; |
|
| 144 | echo ' <span class="description">' . __( 'Longitude', 're-pro' ) . '</span>'; |
|
| 145 | echo '</p>'; |
|
| 146 | ||
| 147 | echo '<p>'; |
|
| 148 | echo ' <label for="' . $this->get_field_id( 'level' ) . '" class="level_label">' . __( 'Level', 're-pro' ) . '</label>'; |
|
| 149 | echo ' <input type="number" id="' . $this->get_field_id( 'level' ) . '" name="' . $this->get_field_name( 'level' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $level ) . '" step="1" min="0" max="50">'; |
|
| 150 | echo ' <span class="description">' . __( 'Level', 're-pro' ) . '</span>'; |
|
| 151 | echo '</p>'; |
|
| 152 | ||
| 153 | ||
| 154 | ||
| 155 | } |
|
| 156 | ||
| 157 | ||
| 158 | /** |
|
| @@ 111-154 (lines=44) @@ | ||
| 108 | * @param mixed $instance |
|
| 109 | * @return void |
|
| 110 | */ |
|
| 111 | public function form( $instance ) { |
|
| 112 | ||
| 113 | // Set default values |
|
| 114 | $instance = wp_parse_args( (array) $instance, array( |
|
| 115 | 'latitude' => '', |
|
| 116 | 'longitude' => '', |
|
| 117 | 'level' => '', |
|
| 118 | 'title' => '', |
|
| 119 | ) ); |
|
| 120 | ||
| 121 | // Retrieve an existing value from the database |
|
| 122 | $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
| 123 | $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
| 124 | $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
| 125 | $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
| 126 | ||
| 127 | // Form fields |
|
| 128 | echo '<p>'; |
|
| 129 | echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title_label">' . __( 'Title', 're-pro' ) . '</label>'; |
|
| 130 | echo ' <input type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $title ) . '">'; |
|
| 131 | echo ' <span class="description">' . __( 'Title', 're-pro' ) . '</span>'; |
|
| 132 | echo '</p>'; |
|
| 133 | ||
| 134 | ||
| 135 | echo '<p>'; |
|
| 136 | echo ' <label for="' . $this->get_field_id( 'latitude' ) . '" class="latitude_label">' . __( 'Latitude', 're-pro' ) . '</label>'; |
|
| 137 | echo ' <input type="text" id="' . $this->get_field_id( 'latitude' ) . '" name="' . $this->get_field_name( 'latitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $latitude ) . '">'; |
|
| 138 | echo ' <span class="description">' . __( 'Latitude', 're-pro' ) . '</span>'; |
|
| 139 | echo '</p>'; |
|
| 140 | ||
| 141 | echo '<p>'; |
|
| 142 | echo ' <label for="' . $this->get_field_id( 'longitude' ) . '" class="longitude_label">' . __( 'Longitude', 're-pro' ) . '</label>'; |
|
| 143 | echo ' <input type="text" id="' . $this->get_field_id( 'longitude' ) . '" name="' . $this->get_field_name( 'longitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $longitude ) . '">'; |
|
| 144 | echo ' <span class="description">' . __( 'Longitude', 're-pro' ) . '</span>'; |
|
| 145 | echo '</p>'; |
|
| 146 | ||
| 147 | echo '<p>'; |
|
| 148 | echo ' <label for="' . $this->get_field_id( 'level' ) . '" class="level_label">' . __( 'Level', 're-pro' ) . '</label>'; |
|
| 149 | echo ' <input type="number" id="' . $this->get_field_id( 'level' ) . '" name="' . $this->get_field_name( 'level' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $level ) . '">'; |
|
| 150 | echo ' <span class="description">' . __( 'Level', 're-pro' ) . '</span>'; |
|
| 151 | echo '</p>'; |
|
| 152 | ||
| 153 | ||
| 154 | } |
|
| 155 | ||
| 156 | ||
| 157 | /** |
|