Skip to content

Commit 903c680

Browse files
Merge pull request #324 from Codeinwp/copilot/fix-deprecated-dynamic-properties
Fix PHP 8.1+ deprecation warnings (dynamic properties and null parameters)
2 parents 3e5a0c2 + 301fa2b commit 903c680

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

includes/library/form-fields.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ abstract class Kucrut_Form_Field {
7575
'multiple',
7676
);
7777

78+
/**
79+
* URL path to this directory
80+
*
81+
* @since 0.1.0
82+
* @var string
83+
* @access protected
84+
*/
85+
protected static $url_path;
86+
7887
/**
7988
* Holds allowed html tags
8089
*
@@ -114,6 +123,15 @@ abstract class Kucrut_Form_Field {
114123
*/
115124
protected $attributes = array();
116125

126+
/**
127+
* Holds field arguments
128+
*
129+
* @since 0.1.0
130+
* @var stdClass
131+
* @access protected
132+
*/
133+
protected $args;
134+
117135

118136
/**
119137
* Loader
@@ -385,6 +403,13 @@ class Kucrut_Form_Field_Textarea extends Kucrut_Form_Field {
385403
);
386404

387405

406+
protected function set_properties() {
407+
if ( ! is_string( $this->field['value'] ) ) {
408+
$this->field['value'] = '';
409+
}
410+
}
411+
412+
388413
public function render() {
389414
printf( // WPCS: XSS ok.
390415
$this->template,

0 commit comments

Comments
 (0)