BP_Admin_Tab::render_checkbox_field_html( $args )
Output the checkbox field html based on the arguments
Description
Source
File: bp-core/classes/class-bp-admin-tab.php
public function render_checkbox_field_html( $args ) {
$input_value = is_null( $args['input_value'] )? $args['input_default'] : $args['input_value'];
printf(
'
<input id="%1$s" name="%2$s" type="hidden" value="0" />
<input id="%1$s" name="%2$s" type="checkbox" value="1" %3$s %4$s autocomplete="off"/>
<label for="%1$s">%5$s</label>
%6$s
',
$args['input_id'],
$args['input_name'],
checked( (bool) $input_value, true, false ),
$args['input_run_js']? "data-run-js-condition=\"{$args['input_run_js']}\"" : '',
$args['input_text'],
$args['input_description']? $this->render_input_description( $args['input_description'] ) : ''
);
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.