General Widget Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 Field 9 Overview Use this tool to create custom code for Widgets with WP_Widget class. Usage Fill in the user-friendly form. Click the “Update Code” button. Copy the code to your project. Or save it as a snippet and share with the community. Examples If you are still learning how to use this tool, check out the following examples: Text Widget Image Widget Recent Posts Widget Embed Widget Class Name The class name used in the code. Prefix Unique string placed in front of root elements. Text Domain Translation file Text Domain. Optional. Widget ID Used in the code as HTML ID attribute. Title Widget title. Description The text that describes the widget. Class The widget class name. Widget Code $title = apply_filters( 'widget_title', empty( $instance['generatewp_title'] ) ? '' : $instance['generatewp_title'], $instance, $this->id_base ); $image = apply_filters( 'widget_image', empty( $instance['generatewp_image'] ) ? '' : $instance['generatewp_image'], $instance ); // Before widget tag echo $args['before_widget']; // Title if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } // Image echo '<img src="' . $image . '">'; // After widget tag echo $args['after_widget']; The widget output displayed in the front-end. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line. Type - Select - Text Number Email URL Password Text Area True/False Checkboxes Radio Select Date Time Color oEmbed Select field type. ID Unique ID used in the code. Label Text appears before the field. Description Text appears after the field. Field Placeholder Text appears within the input. Default value Default field value. Multiple Options For select and radio fields. Set value|label, each fields in new line.