Skip to content

Commit cfa925e

Browse files
committed
Option to add callback in the settings fields
1 parent e5ed957 commit cfa925e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class.settings-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function admin_init() {
141141
'type' => $type,
142142
);
143143

144-
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $this, 'callback_' . $type ), $section, $section, $args );
144+
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], (isset($option['callback']) ? $option['callback'] : array($this, 'callback_' . $type )), $section, $section, $args );
145145
}
146146
}
147147

0 commit comments

Comments
 (0)