Skip to content

Commit

Permalink
Remove unused function, fixed some output escape warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 4, 2023
1 parent f813c61 commit 04f146a
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions src/Admin/AdminModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,52 +201,6 @@ public function maybe_redirect() {
exit;
}

/**
* Input checkbox.
*
* @param array $args Arguments.
* @return void
*/
public static function input_checkbox( $args ) {
$defaults = [
'label_for' => '',
'type' => 'text',
'label' => '',
];

$args = wp_parse_args( $args, $defaults );

$id = $args['label_for'];
$value = get_option( $id );

$legend = sprintf(
'<legend class="screen-reader-text"><span>%s</span></legend>',
esc_html( $args['label'] )
);

$input = sprintf(
'<input name="%s" id="%s" type="%s" value="%s" %s />',
esc_attr( $id ),
esc_attr( $id ),
esc_attr( 'checkbox' ),
esc_attr( '1' ),
checked( $value, true, false )
);

$label = sprintf(
'<label for="%s">%s %s</label>',
esc_attr( $id ),
$input,
esc_html( $args['label'] )
);

printf(
'<fieldset>%s %s</fieldset>',
$legend,
$label
);
}

/**
* Sanitize the specified value to a boolean.
*
Expand Down

0 comments on commit 04f146a

Please sign in to comment.