/**
* Show rtmedia checkbox in admin options.
*
* @access static
*
* @param array $args
* @param bool $echo
*
* @return string $chkObj->get_switch( $args )
*/
public static function checkbox($args, $echo = true)
{
$defaults = array('key' => '', 'desc' => '', 'show_desc' => false);
$args = wp_parse_args($args, $defaults);
extract($args);
if (!isset($value)) {
trigger_error(esc_html__('Please provide a "value" in the argument.', 'buddypress-media'));
return;
}
if (!empty($key)) {
$args['name'] = 'rtmedia-options[' . $key . ']';
}
$args['rtForm_options'] = array(array('' => 1, 'checked' => $value));
$chkObj = new rtForm();
if ($echo) {
$chkObj->display_switch($args);
} else {
return $chkObj->get_switch($args);
}
return;
}