PUM_Fields::multicheck_templ_callback( $args )


Description Description


Source Source

File: includes/class-pum-fields.php

	public function multicheck_templ_callback( $args ) {
			$this->field_before( $args );

			$this->field_label( $args );

			$this->field_description( $args ); ?>

			<# var checked = data.<?php echo esc_attr( $args['templ_name'] ); ?> !== undefined && data.<?php echo esc_attr( $args['templ_name'] ); ?> && typeof data.<?php echo esc_attr( $args['templ_name'] ); ?> === 'object' ? data.<?php echo esc_attr( $args['templ_name'] ); ?> : {}; #>

			<?php

			if ( ! empty( $args['options'] ) ) {
				foreach ( $args['options'] as $option => $label ) { ?>
					<# if (checked.<?php echo esc_attr( $option ); ?> === undefined) {
						checked.<?php echo esc_attr( $option ); ?> = false;
					} #>

					<input name="<?php echo esc_attr( $args['name'] ); ?>[<?php echo esc_attr( $option ); ?>]" id="<?php echo esc_attr( $args['id'] ); ?>_<?php echo esc_attr( $option ); ?>" type="checkbox" value="<?php echo esc_html( $option ); ?>" {{pumChecked(checked.<?php echo esc_attr( $option ); ?>, '<?php echo $option; ?>', true)}} />&nbsp;
					<label for="<?php echo esc_attr( $args['id'] ); ?>_<?php echo esc_attr( $option ); ?>"><?php echo esc_html( $label ); ?></label><br/><?php
				}
			}

			$this->field_after();
	}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.