Noptin_Sidebar::forms_select( int $selected )
Outputs a form select field
Parameters Parameters
- $selected
(int) (Required) the currently selected form.
Return Return
(void)
Source Source
File: includes/class-noptin-sidebar.php
public function forms_select( $selected ) { // Get all widget forms. $forms = $this->get_forms(); // Create <option> tags for each form. foreach ( $forms as $form ) { // Fetch the form title. $name = esc_html( get_the_title( $form ) ); // Is it selected? $_selected = selected( $form, $selected, true ); echo "<option value='$form' $_selected>$name</option>"; } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.5 | Introduced. |