@@ -17,11 +17,12 @@ class OptionRenderer {
17
17
* @return string
18
18
*/
19
19
public static function optionInput ( array $ option ) : string {
20
- return call_user_func (
21
- /* @phpstan-ignore-next-line */
20
+ $ option_input = call_user_func (
22
21
[ 'WP2Static\OptionRenderer ' , self ::INPUT_TYPE_FNS [ $ option ['type ' ] ] ],
23
22
$ option
24
23
);
24
+
25
+ return strval ( $ option_input );
25
26
}
26
27
27
28
/**
@@ -38,7 +39,11 @@ public static function optionInputArray( array $option ) : string {
38
39
* @return string
39
40
*/
40
41
public static function optionInputBoolean ( array $ option ) : string {
41
- $ checked = (int ) $ option ['unfiltered_value ' ] === 1 ? ' checked ' : '' ;
42
+ /**
43
+ * @var int $unfiltered_value
44
+ */
45
+ $ unfiltered_value = $ option ['unfiltered_value ' ];
46
+ $ checked = (int ) $ unfiltered_value === 1 ? ' checked ' : '' ;
42
47
return '<input id=" ' . $ option ['name ' ] . '" name=" ' . $ option ['name ' ] . '" value="1" ' .
43
48
' type="checkbox" ' . $ checked . '> ' ;
44
49
}
@@ -49,7 +54,7 @@ public static function optionInputBoolean( array $option ) : string {
49
54
*/
50
55
public static function optionInputInteger ( array $ option ) : string {
51
56
return '<input class="widefat" id=" ' . $ option ['name ' ] . '" name=" ' . $ option ['name ' ] .
52
- '" type="number" value=" ' . esc_html ( $ option ['value ' ] ) . '"> ' ;
57
+ '" type="number" value=" ' . esc_html ( strval ( $ option ['value ' ] ) ) . '"> ' ;
53
58
}
54
59
55
60
/**
@@ -58,7 +63,7 @@ public static function optionInputInteger( array $option ) : string {
58
63
*/
59
64
public static function optionInputPassword ( array $ option ) : string {
60
65
return '<input class="widefat" id=" ' . $ option ['name ' ] . '" name=" ' . $ option ['name ' ] .
61
- '" type="password" value=" ' . esc_html ( $ option ['value ' ] ) . '"> ' ;
66
+ '" type="password" value=" ' . esc_html ( strval ( $ option ['value ' ] ) ) . '"> ' ;
62
67
}
63
68
64
69
/**
@@ -67,7 +72,7 @@ public static function optionInputPassword( array $option ) : string {
67
72
*/
68
73
public static function optionInputString ( array $ option ) : string {
69
74
return '<input class="widefat" id=" ' . $ option ['name ' ] . '" name=" ' . $ option ['name ' ] .
70
- '" type="text" value=" ' . esc_html ( $ option ['value ' ] ) . '"> ' ;
75
+ '" type="text" value=" ' . esc_html ( strval ( $ option ['value ' ] ) ) . '"> ' ;
71
76
}
72
77
73
78
/**
0 commit comments