jetpack_testimonial_custom_control_classes

The Jetpack by WordPress.com jetpack testimonial custom control classes function.

Description

jetpack_testimonial_custom_control_classes(); 

Usage

  1. if ( !function_exists( 'jetpack_testimonial_custom_control_classes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/custom-post-types/testimonial.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_testimonial_custom_control_classes(); 
  7.  

Defined (1)

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

/modules/custom-post-types/testimonial.php  
  1. function jetpack_testimonial_custom_control_classes() { 
  2. class Jetpack_Testimonial_Title_Control extends WP_Customize_Control { 
  3. public static function sanitize_content( $value ) { 
  4. if ( '' != $value ) 
  5. $value = trim( convert_chars( wptexturize( $value ) ) ); 
  6.  
  7. return $value; 
  8.  
  9. class Jetpack_Testimonial_Textarea_Control extends WP_Customize_Control { 
  10. public $type = 'textarea'; 
  11.  
  12. public function render_content() { 
  13. ?> 
  14. <label> 
  15. <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 
  16. <textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea> 
  17. </label> 
  18. <?php 
  19.  
  20. public static function sanitize_content( $value ) { 
  21. if ( ! empty( $value ) ) 
  22. /** This filter is already documented in core. wp-includes/post-template.php */ 
  23. $value = apply_filters( 'the_content', $value ); 
  24.  
  25. $value = preg_replace( '@<div id="jp-post-flair"([^>]+)?>(.+)?</div>@is', '', $value ); // Strip WPCOM and Jetpack post flair if included in content 
  26.  
  27. return $value;