PluginProbe
Polylang / 1.8
Polylang v1.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / settings / settings-tools.php

settings-tools.php in Polylang 1.8, at settings/settings-tools.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Settings class for tools
4 *
5 * @since 1.8
6 */
7 class PLL_Settings_Tools extends PLL_Settings_Module {
8 /*
9 * constructor
10 *
11 * @since 1.8
12 *
13 * @param object $polylang polylang object
14 */
15 public function __construct( &$polylang ) {
16 parent::__construct( $polylang, array(
17 'module' => 'tools',
18 'title' => __( 'Tools', 'polylang' ),
19 'description' => __( 'Decide whether to remove all data when deleting Polylang.', 'polylang' ),
20 ) );
21 }
22
23 /*
24 * displays the settings form
25 *
26 * @since 1.8
27 */
28 protected function form() {
29 printf(
30 '<label for="uninstall"><input id="uninstall" name="uninstall" type="checkbox" value="1" %s /> %s</label>',
31 empty( $this->options['uninstall'] ) ? '' : 'checked="checked"',
32 __( 'Remove all Polylang data when using the "Delete" link on the plugins screen.', 'polylang' )
33 );
34 }
35
36 /*
37 * sanitizes the settings before saving
38 *
39 * @since 1.8
40 *
41 * @param array $options
42 */
43 protected function update( $options ) {
44 $newoptions['uninstall'] = isset( $options['uninstall'] ) ? 1 : 0;
45 return $newoptions; // take care to return only validated options
46 }
47 }
48