2
0

(wordpress) Add the lib_version attribute to wp admin panel

Closes
This commit is contained in:
Baptiste Arnaud
2024-04-11 11:48:27 +02:00
parent 6594c56adf
commit f5508701fc
8 changed files with 45 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ class Typebot_Admin
public function register_typebot_settings()
{
register_setting('typebot', 'lib_version');
register_setting('typebot', 'init_snippet');
register_setting('typebot', 'excluded_pages');
}

View File

@@ -9,6 +9,11 @@
settings_fields('typebot');
do_settings_sections('typebot');
?>
<div style="display: flex; flex-direction: column">
<label>Library version:</label>
<input name="lib_version" value="<?php echo esc_attr(get_option('lib_version') !== null && get_option('lib_version') !== '' ? get_option('lib_version') : '0.2'); ?>" style="padding: .5rem" />
</div>
<div style="display: flex; flex-direction: column">
<label>If embedding as <strong>Popup</strong> or <strong>Bubble</strong>, paste the initialization snippet here:</label>
<textarea name="init_snippet" style="min-height: 150px; padding: 0.5rem; margin-top: 1rem"><?php echo esc_attr(get_option('init_snippet')); ?></textarea>