PluginProbe
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.4.0
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.4.0
7.8.14.2 7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 All 103 releases
wordpress-popup / views / admin / global / components / select-units.php
select-units.php
52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Select Units.
4 *
5 * @package Hustle
6 * @since 4.3.0
7 *
8 * @phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
9 */
10
11 $html = '';
12 $label = ( isset( $label ) && ! empty( $label ) ) ? $label : __( 'Pick a unit', 'hustle' );
13 $units = array(
14 'px' => 'px',
15 '%' => '%',
16 'vw' => 'vw',
17 'vh' => 'vh',
18 );
19
20 if ( ! empty( $exclude_units ) ) {
21 foreach ( $exclude_units as $unit ) {
22 unset( $units[ $unit ] );
23 }
24 }
25
26 if ( ! empty( $extra_units ) ) {
27 $units = array_merge( $units, $extra_units );
28 }
29
30 $html .= '<label for="hustle-' . $name . '" id="hustle-' . $name . '-label" class="sui-label">';
31 $html .= esc_html( $label );
32 $html .= Hustle_Layout_Helper::get_html_for_options(
33 array(
34 array(
35 'type' => 'select',
36 'name' => $name,
37 'options' => $units,
38 'id' => 'hustle-' . $name,
39 'selected' => $selected,
40 'class' => 'sui-inlabel sui-dropdown-align--right-desktop sui-styled',
41 'attributes' => array(
42 'data-attribute' => $name,
43 'aria-labelledby' => 'hustle-' . $name . '-label',
44 ),
45 ),
46 ),
47 true
48 );
49 $html .= '</label>';
50
51 echo $html;
52