PLL_Settings_Tools

Settings class for tools.

Defined (1)

The class is defined in the following location(s).

/settings/settings-tools.php  
  1. class PLL_Settings_Tools extends PLL_Settings_Module { 
  2.  
  3. /** 
  4. * constructor 
  5. * @since 1.8 
  6. * @param object $polylang polylang object 
  7. */ 
  8. public function __construct( &$polylang ) { 
  9. parent::__construct( $polylang, array( 
  10. 'module' => 'tools',  
  11. 'title' => __( 'Tools', 'polylang' ),  
  12. 'description' => __( 'Decide whether to remove all data when deleting Polylang.', 'polylang' ),  
  13. ) ); 
  14.  
  15. /** 
  16. * displays the settings form 
  17. * @since 1.8 
  18. */ 
  19. protected function form() { 
  20. printf( 
  21. '<label for="uninstall"><input id="uninstall" name="uninstall" type="checkbox" value="1" %s /> %s</label>',  
  22. empty( $this->options['uninstall'] ) ? '' : 'checked="checked"',  
  23. esc_html__( 'Remove all Polylang data when using the "Delete" link on the plugins screen.', 'polylang' ) 
  24. ); 
  25.  
  26. /** 
  27. * sanitizes the settings before saving 
  28. * @since 1.8 
  29. * @param array $options 
  30. */ 
  31. protected function update( $options ) { 
  32. $newoptions['uninstall'] = isset( $options['uninstall'] ) ? 1 : 0; 
  33. return $newoptions; // take care to return only validated options