-
Notifications
You must be signed in to change notification settings - Fork 2
Control: Callback
Ale Mostajo edited this page Feb 22, 2020
·
1 revision
The control used a field type to output and render custom HTML.
See example:
// Namespace and use statement...
class Settings extends Model
{
// Class properties...
protected function init()
{
// Other properties...
$this->tabs = [
'app' => [
'title' => __( 'React App' ),
'submit' => false,
'show_title' => false,
'fields' => [
uniqid() => [
'type' => 'callback',
'callback' => function( $settings_model, $field_id ) {
echo '<p>Custom HTML rendering.</p>';
echo '<pre style="background-color: #444444;color: #fff;padding: 10px;overflow: auto;">';
print_r( $settings_model );
echo '</pre>';
},
],
],
],
];
}
}(c) 2020 10 Quality Studio.