-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example: Add example for the tab field
- Loading branch information
1 parent
29cfc5c
commit 1d07780
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<h4>Example</h4> | ||
|
||
<div class="tangible-settings-row"> | ||
<?= $fields->render_field('tab', [ | ||
'label' => 'Tab field', | ||
'type' => 'tab', | ||
'value' => $fields->fetch_value('tab'), | ||
'tabs' => [ | ||
'tab-name-1' => [ | ||
'title' => 'Tab name 1', | ||
'fields' => [ | ||
[ | ||
'label' => 'Text field', | ||
'type' => 'text', | ||
'name' => 'text-field' | ||
], | ||
[ | ||
'label' => 'Code field', | ||
'type' => 'code', | ||
'name' => 'code-field' | ||
], | ||
] | ||
], | ||
'tab-name-2' => [ | ||
'title' => 'Tab name 2', | ||
'fields' => [ | ||
[ | ||
'label' => 'Color field', | ||
'type' => 'color-picker', | ||
'name' => 'color-field' | ||
], | ||
[ | ||
'label' => 'Number field', | ||
'type' => 'number', | ||
'name' => 'number-field' | ||
], | ||
] | ||
] | ||
] | ||
]) ?> | ||
</div> | ||
|
||
<div class="tangible-settings-row"> | ||
<?php submit_button() ?> | ||
</div> | ||
|
||
<h4>Value</h4> | ||
|
||
<?php tangible\see( | ||
$fields->fetch_value('tab') | ||
); ?> | ||
|
||
<h4>Code</h4> | ||
|
||
<pre> | ||
<code> | ||
$fields = tangible_fields(); | ||
<?php $plugin->render_registation_message(); ?> | ||
|
||
echo $fields->render_field('name', [ | ||
'label' => 'Tab field', | ||
'type' => 'tab', | ||
'value' => $fields->fetch_value('name'), | ||
'tabs' => [ | ||
'tab-name-1' => [ | ||
'title' => 'Tab name 1', | ||
'fields' => [ | ||
[ | ||
'label' => 'Text field', | ||
'type' => 'text', | ||
'name' => 'text-field' | ||
], | ||
[ | ||
'label' => 'Code field', | ||
'type' => 'code', | ||
'name' => 'code-field' | ||
], | ||
] | ||
], | ||
'tab-name-2' => [ | ||
'title' => 'Tab name 2', | ||
'fields' => [ | ||
[ | ||
'label' => 'Color field', | ||
'type' => 'color-picker', | ||
'name' => 'color-field' | ||
], | ||
[ | ||
'label' => 'Number field', | ||
'type' => 'number', | ||
'name' => 'number-field' | ||
], | ||
] | ||
] | ||
] | ||
]); | ||
</code> | ||
</pre> |