WPSEO_Option_RSS

Option: wpseo_rss.

Defined (1)

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

/inc/options/class-wpseo-option-rss.php  
  1. class WPSEO_Option_RSS extends WPSEO_Option { 
  2.  
  3. /** 
  4. * @var string option name 
  5. */ 
  6. public $option_name = 'wpseo_rss'; 
  7.  
  8. /** 
  9. * @var array Array of defaults for the option 
  10. * Shouldn't be requested directly, use $this->get_defaults(); 
  11. * @internal Note: Some of the default values are added via the translate_defaults() method 
  12. */ 
  13. protected $defaults = array( 
  14. 'rssbefore' => '', // Text area. 
  15. 'rssafter' => '', // Text area. 
  16. ); 
  17.  
  18.  
  19. /** 
  20. * Get the singleton instance of this class 
  21. * @return object 
  22. */ 
  23. public static function get_instance() { 
  24. if ( ! ( self::$instance instanceof self ) ) { 
  25. self::$instance = new self(); 
  26.  
  27. return self::$instance; 
  28.  
  29.  
  30. /** 
  31. * Translate strings used in the option defaults 
  32. * @return void 
  33. */ 
  34. public function translate_defaults() { 
  35. /** translators: 1: link to post; 2: link to blog. */ 
  36. $this->defaults['rssafter'] = sprintf( __( 'The post %1$s appeared first on %2$s.', 'wordpress-seo' ), '%%POSTLINK%%', '%%BLOGLINK%%' ); 
  37.  
  38.  
  39. /** 
  40. * Validate the option 
  41. * @param array $dirty New value for the option. 
  42. * @param array $clean Clean value for the option, normally the defaults. 
  43. * @param array $old Old value of the option. 
  44. * @return array Validated clean value for the option to be saved to the database 
  45. */ 
  46. protected function validate_option( $dirty, $clean, $old ) { 
  47. foreach ( $clean as $key => $value ) { 
  48. if ( isset( $dirty[ $key ] ) ) { 
  49. $clean[ $key ] = wp_kses_post( $dirty[ $key ] ); 
  50.  
  51. return $clean;