$params, 'name' => $name, 'type' => 'text', ); } $field = array( 'name' => '', 'label' => '', 'type' => 'text', ); $field = array_merge( $field, $params ); if ( ! is_array( $css_class ) ) { $css_class = array( $css_class ); } $css_class = implode( " ", $css_class ); $html = ''; switch ( $field['type'] ) { case 'text': case 'email': $field_type = 'text'; //hardcoded because we don't have styles for inputs with email type $html .= ''; break; case 'checkbox': /** @var $rand int used for label in "for" attribute and also for input for "id" attribute; * for the case when the same input is rendered more that 1 time; * e.g. in focus area and in widget */ $rand = rand( 1, 9999 ); $html .= '
'; $html .= ''; $html .= ''; $html .= "
"; break; } return $html; } }