Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Jetpack_Testimonial_Title_Control | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| sanitize_content | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Helper class for the Jetpack Testimonial Title Control. |
| 4 | * |
| 5 | * @package automattic/jetpack-classic-theme-helper |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\Classic_Theme_Helper; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit( 0 ); |
| 12 | } |
| 13 | |
| 14 | if ( ! class_exists( __NAMESPACE__ . '\Jetpack_Testimonial_Title_Control' ) ) { |
| 15 | /** |
| 16 | * Extends the WP_Customize_Control class to clean the title parameter. |
| 17 | */ |
| 18 | class Jetpack_Testimonial_Title_Control extends \WP_Customize_Control { |
| 19 | /** |
| 20 | * Sanitize content passed to control. |
| 21 | * |
| 22 | * @param string $value Control value. |
| 23 | * @return string Sanitized value. |
| 24 | */ |
| 25 | public static function sanitize_content( $value ) { |
| 26 | if ( '' != $value ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual -- handle non-string inputs gracefully. |
| 27 | $value = trim( convert_chars( wptexturize( $value ) ) ); |
| 28 | } |
| 29 | return $value; |
| 30 | } |
| 31 | } |
| 32 | } |