Skip to content

Commit d95cb94

Browse files
Add settings view
1 parent 8b2f953 commit d95cb94

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/class-tiny-settings.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ public function render_sizes() {
540540
echo '</div>';
541541
}
542542

543+
/**
544+
* Renders the back-up section on the settings page.
545+
*/
546+
public function render_backup() {
547+
include_once( dirname( __FILE__ ) . '/views/settings-backup.php' );
548+
}
549+
543550
private function render_size_checkboxes( $size, $option ) {
544551
$id = self::get_prefixed_name( "sizes_$size" );
545552
$name = self::get_prefixed_name( 'sizes[' . $size . ']' );

src/views/settings-backup.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<tr>
2+
<th scope="row"><?php esc_html_e('Backup', 'tiny-compress-images') ?></th>
3+
<td>
4+
<p class="tiny-check">
5+
<input type="checkbox" name="" value="" />
6+
<label for="">
7+
<?php esc_html_e('Save a copy of the original uncompressed image', 'tiny-compress-images'); ?>
8+
</label>
9+
</p>
10+
<p class="intro">
11+
<?php
12+
esc_html_e(
13+
'When enabled, the original image will be backed up as <original_filename>.tiny-backup.',
14+
'tiny-compress-images'
15+
)
16+
?>
17+
</p>
18+
</td>
19+
</tr>

src/views/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<?php $this->render_resize() ?>
5858
</td>
5959
</tr>
60+
<?php $this->render_backup() ?>
6061
</tbody>
6162
</table>
6263
<p><?php echo Tiny_Plugin::request_review();?></p>

0 commit comments

Comments
 (0)