BWS_Settings_Page

The Bootstrap Widget Styling BWS Settings Page class.

Defined (1)

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

/includes/class-bws-settings-page.php  
  1. class BWS_Settings_Page { 
  2.  
  3. private static $instance ; 
  4. private $widgets_to_add_to_settings_page ; 
  5.  
  6. private function __construct( $widgets ) { 
  7. $this->widgets_to_add_to_settings_page = $widgets ; 
  8.  
  9.  
  10. public static function init( $widgets ) { 
  11. self::$instance = new self( $widgets ) ; 
  12.  
  13. public static function validate_options( $input ) { 
  14. $validated = array() ; 
  15. foreach( self::$instance->widgets_to_add_to_settings_page as $widget_name ) { 
  16. $widget_key = 'disable_' . $widget_name . '_widget' ; 
  17. $disable_setting = isset( $input[ $widget_key ] ) ? $input[ $widget_key ] : '0' ; 
  18. if ( self::$instance->is_one_or_zero( $disable_setting ) ) { 
  19. $validated[ $widget_key ] = $disable_setting ; 
  20. return $validated ; 
  21.  
  22. function is_one_or_zero( $value ) { 
  23. return ( '1' == $value ) || ( '0' == $value ) ; 
  24.  
  25. public static function plugin_section_text() { 
  26. ?> 
  27. <h3> 
  28. <?php _e( 'This plugin does not work well when the top navbar has a "Categories" or "Pages" widget.' , 'bootstrap-widget-styling' ) ; ?> 
  29. </h3> 
  30. <h3> 
  31. <em><?php _e( 'Disable' , 'bootstrap-widget-styling' ) ; ?></em> 
  32. <?php _e( 'plugin for: ' , 'bootstrap-widget-styling' ) ; ?> 
  33. </h3> 
  34. <?php 
  35.  
  36. } /** end class BWS_Settings_Page */