Skip to content

Commit be1bb69

Browse files
committed
Merge pull request #41 from roidayan/add_label_for
Add label_for arg for fields
2 parents 52f96ac + f4d590a commit be1bb69

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/class.settings-api.php

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ function admin_init() {
130130

131131
$args = array(
132132
'id' => $option['name'],
133+
'label_for' => $args['label_for'] = "{$section}[{$option['name']}]",
133134
'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
134135
'name' => $option['label'],
135136
'section' => $section,
@@ -139,6 +140,7 @@ function admin_init() {
139140
'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
140141
'type' => $type,
141142
);
143+
142144
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $this, 'callback_' . $type ), $section, $section, $args );
143145
}
144146
}

0 commit comments

Comments
 (0)