Edit: template.php
<?php require_once __DIR__ . '/dashicons.php'; require_once __DIR__ . '/settings.php'; require_once __DIR__ . '/google-fonts.php'; require_once __DIR__ . '/default-settings.php'; $properties = array( 'top', 'bottom', 'left', 'right' ); // Get saved settings and merge with defaults $saved_settings = get_option( 'dnxte_back_to_top_settings', array() ); $back_to_top_settings = wp_parse_args( $saved_settings, $dnxte_default_settings ); ?> <div class="wrap dnxte-back-to-top-settings"> <h1><?php esc_html_e( 'Back To Top Settings', 'dnxte-divi-essential' ); ?></h1> <div class="dnxte-settings-container"> <div class="dnxte-settings-form"> <div class="dnxte-tabs-wrapper"> <div class="dnxte-tabs-nav"> <button class="dnxte-tab-button active" data-tab="content-style"> <span class=""> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="m16.84 11.192-.623-.514a.88.88 0 0 1 0-1.357l.624-.513c.444-.366.558-.993.27-1.49l-1.232-2.135a1.17 1.17 0 0 0-1.426-.512l-.757.284a.88.88 0 0 1-1.175-.679l-.133-.797a1.17 1.17 0 0 0-1.156-.979H8.768c-.576 0-1.062.412-1.156.98l-.133.796a.88.88 0 0 1-1.176.68l-.756-.285a1.17 1.17 0 0 0-1.426.512L2.888 7.317a1.17 1.17 0 0 0 .27 1.49l.624.514a.88.88 0 0 1 0 1.358l-.624.513a1.17 1.17 0 0 0-.27 1.49l1.233 2.135c.287.498.887.713 1.426.511l.756-.283a.88.88 0 0 1 1.176.678l.133.798c.094.567.58.979 1.156.979h2.464c.575 0 1.061-.412 1.156-.98l.133-.796a.88.88 0 0 1 1.175-.679l.757.284a1.17 1.17 0 0 0 1.426-.512l1.232-2.134a1.17 1.17 0 0 0-.27-1.49m-1.976 3.04-.757-.284a2.05 2.05 0 0 0-2.742 1.583l-.133.797H8.768l-.133-.797a2.05 2.05 0 0 0-2.743-1.583l-.757.283-1.232-2.134.624-.514a2.05 2.05 0 0 0 0-3.166l-.624-.514L5.135 5.77l.757.283A2.05 2.05 0 0 0 8.635 4.47l.133-.797h2.464l.133.797a2.05 2.05 0 0 0 2.742 1.583l.757-.283 1.232 2.134-.624.514a2.05 2.05 0 0 0 0 3.166l.624.514zM10 7.108A2.894 2.894 0 0 0 7.11 10 2.894 2.894 0 0 0 10 12.89 2.894 2.894 0 0 0 12.89 10 2.894 2.894 0 0 0 10 7.11m0 4.61A1.72 1.72 0 0 1 8.28 10 1.72 1.72 0 0 1 10 8.281 1.72 1.72 0 0 1 11.719 10a1.72 1.72 0 0 1-1.72 1.719" fill="#586892"/></g><defs><clipPath id="a"><path fill="#fff" d="M2.5 2.5h15v15h-15z"/></clipPath></defs></svg> </span> <?php esc_html_e( 'Content Style', 'dnxte-divi-essential' ); ?> </button> <button class="dnxte-tab-button" data-tab="button-customization"> <span class=""> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M5.56 4.229H5.4V3.086a.586.586 0 1 0-1.171 0v1.143h-.16c-.867 0-1.569.701-1.569 1.569v1.49c0 .867.702 1.57 1.57 1.57h.159v8.056a.586.586 0 1 0 1.171 0V8.857c.072-.012.718.092 1.27-.46.296-.296.459-.69.459-1.11V5.799a1.57 1.57 0 0 0-1.57-1.57m.397 3.059c0 .22-.178.398-.398.398H4.07a.397.397 0 0 1-.397-.398v-1.49c0-.22.178-.398.398-.398h1.49c.22 0 .397.178.397.398zm9.974-1.331h-.16V3.086a.586.586 0 1 0-1.171 0v2.871h-.16a1.57 1.57 0 0 0-1.569 1.57v1.49c0 .867.702 1.569 1.57 1.569h.159v6.328a.586.586 0 1 0 1.172 0v-6.328h.159c.867 0 1.569-.702 1.569-1.57v-1.49c0-.867-.702-1.569-1.57-1.569m.397 3.06c0 .22-.178.397-.397.397h-1.49a.397.397 0 0 1-.398-.398v-1.49c0-.219.178-.397.398-.397h1.49c.22 0 .397.178.397.398zm-5.583 2.126h-.16V3.086a.586.586 0 1 0-1.17 0v8.057h-.16c-.867 0-1.57.701-1.57 1.57v1.489c0 .867.702 1.57 1.57 1.57h.16v1.142a.586.586 0 0 0 1.17 0v-1.143h.16a1.57 1.57 0 0 0 1.57-1.569v-1.49a1.57 1.57 0 0 0-1.57-1.57m.398 3.059c0 .22-.178.398-.398.398h-1.49a.397.397 0 0 1-.398-.398v-1.49c0-.22.178-.397.398-.397h1.49c.22 0 .398.177.398.397z" fill="#586892"/></g><defs><clipPath id="a"><path fill="#fff" d="M2.5 2.5h15v15h-15z"/></clipPath></defs></svg> </span> <?php esc_html_e( 'Button Customization', 'dnxte-divi-essential' ); ?> </button> <button class="dnxte-tab-button" data-tab="button-position"> <span class=""> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M15.21 4.805A2.347 2.347 0 0 0 12.866 2.5H4.844A2.346 2.346 0 0 0 2.5 4.844v8.008a2.346 2.346 0 0 0 2.29 2.343A2.347 2.347 0 0 0 7.134 17.5h8.022a2.346 2.346 0 0 0 2.344-2.344V7.148a2.346 2.346 0 0 0-2.29-2.343m-9.834 9.218h-.532a1.173 1.173 0 0 1-1.172-1.171V4.844c0-.646.526-1.172 1.172-1.172h8.022c.646 0 1.172.526 1.172 1.172v8.008c0 .646-.526 1.171-1.172 1.171zm10.952 1.133c0 .646-.526 1.172-1.172 1.172H7.134c-.633 0-1.15-.505-1.171-1.133h6.903a2.346 2.346 0 0 0 2.344-2.343V5.978a1.173 1.173 0 0 1 1.118 1.17z" fill="#586892"/></g><defs><clipPath id="a"><path fill="#fff" d="M2.5 2.5h15v15h-15z"/></clipPath></defs></svg> </span> <?php esc_html_e( 'Button Position', 'dnxte-divi-essential' ); ?> </button> </div> </div> <form id="dnxte-back-to-top-form" method="post"> <?php wp_nonce_field( 'dnxte_back_to_top_nonce', 'dnxte_back_to_top_nonce' ); ?> <div class="dnxte-settings-preview"> <h2 class="section-heading"> <img src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/btp-preview.svg' ); ?>" alt="Content Style"> <?php esc_html_e( 'Back To Top Button - Preview', 'dnxte-divi-essential' ); ?> </h2> <div class="dnxte-preview-container"> <div id="dnxte-back-to-top-preview" class="dnxte-back-to-top-button"> <?php $is_custom_link = ( 1 === $back_to_top_settings['custom_back_to_top'] && ! empty( $back_to_top_settings['custom_back_to_top_link'] ) ); if ( $is_custom_link ) : ?> <a href="<?php echo esc_url( $back_to_top_settings['custom_back_to_top_link'] ); ?>"> <?php endif; ?> <div class="button-content"> <?php // Display icon if content is icon or both AND icon placement is left if ( ( 'icon' === $back_to_top_settings['button_content'] || ( 'both' === $back_to_top_settings['button_content'] && 'left' === $back_to_top_settings['icon_placement'] ) ) ) : ?> <?php if ( 'dashicon' === $back_to_top_settings['button_icon_type'] ) : ?> <i class="dashicons <?php echo esc_attr( $back_to_top_settings['button_dashicon'] ); ?>"></i> <?php elseif ( 'custom_image' === $back_to_top_settings['button_icon_type'] && ! empty( $back_to_top_settings['button_custom_image'] ) ) : ?> <img src="<?php echo esc_url( $back_to_top_settings['button_custom_image'] ); ?>" alt="Icon"> <?php elseif ( 'external_url' === $back_to_top_settings['button_icon_type'] && ! empty( $back_to_top_settings['button_external_url'] ) ) : ?> <img src="<?php echo esc_url( $back_to_top_settings['button_external_url'] ); ?>" alt="Icon"> <?php else : ?> <i class="<?php echo esc_attr( $back_to_top_settings['button_icon'] ); ?>"></i> <?php endif; ?> <?php endif; ?> <?php if ( 'text' === $back_to_top_settings['button_content'] || 'both' === $back_to_top_settings['button_content'] ) : ?> <span><?php echo esc_html( $back_to_top_settings['icon_text'] ); ?></span> <?php endif; ?> <?php // Display icon if content is icon or both AND icon placement is right if ( ( 'icon' === $back_to_top_settings['button_content'] || ( 'both' === $back_to_top_settings['button_content'] && 'right' === $back_to_top_settings['icon_placement'] ) ) ) : ?> <?php if ( 'dashicon' === $back_to_top_settings['button_icon_type'] ) : ?> <i class="dashicons <?php echo esc_attr( $back_to_top_settings['button_dashicon'] ); ?>"></i> <?php elseif ( 'custom_image' === $back_to_top_settings['button_icon_type'] && ! empty( $back_to_top_settings['button_custom_image'] ) ) : ?> <img src="<?php echo esc_url( $back_to_top_settings['button_custom_image'] ); ?>" alt="Icon"> <?php elseif ( 'external_url' === $back_to_top_settings['button_icon_type'] && ! empty( $back_to_top_settings['button_external_url'] ) ) : ?> <img src="<?php echo esc_url( $back_to_top_settings['button_external_url'] ); ?>" alt="Icon"> <?php else : ?> <i class="<?php echo esc_attr( $back_to_top_settings['button_icon'] ); ?>"></i> <?php endif; ?> <?php endif; ?> </div> <?php if ( $is_custom_link ) : ?> </a> <?php endif; ?> </div> </div> </div> <!-- Organize your settings into tab content sections --> <?php // Organize settings into tabs $tab_sections = array( 'content-style' => array( 'content', // 'icon', ), 'button-customization' => array( 'customization', ), 'button-position' => array( 'position', // Add other position-related section IDs ), ); // Loop through each tab foreach ( $tab_sections as $tab_id => $section_ids ) : ?> <div class="dnxte-tab-content <?php echo 'content-style' === $tab_id ? 'active' : ''; ?>" id="<?php echo esc_attr( $tab_id ); ?>"> <?php // Loop through sections for this tab foreach ( $section_ids as $section_id ) { if ( isset( $GLOBALS['dnxte_settings_fields'][ $section_id ] ) ) { $section = $GLOBALS['dnxte_settings_fields'][ $section_id ]; ?> <div class="dnxte-settings-section" id="dnxte-section-<?php echo esc_attr( $section_id ); ?>"> <table class="form-table"> <tbody> <?php foreach ( $section['fields'] as $field_id => $field ) : ?> <?php // Check dependencies $show_field = true; if ( isset( $field['dependency'] ) ) { $dep_field = $field['dependency'][0]; $dep_value = $field['dependency'][1]; if ( is_array( $dep_value ) ) { $show_field = in_array( $back_to_top_settings[ $dep_field ], $dep_value ); } else { $show_field = ( $back_to_top_settings[ $dep_field ] === $dep_value ); } } if ( ! $show_field ) { $style = 'style="display:none;"'; } else { $style = ''; } ?> <tr valign="top" <?php echo wp_kses_post( $style ); ?> class="dnxte-field-row dnxte-field-<?php echo esc_attr( $field_id ); ?>" data-field="<?php echo esc_attr( $field_id ); ?>"> <th scope="row" valign="top"> <label for="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>"> <?php echo esc_html( $field['label'] ); ?> <?php if ( 'hide_on_mobile_size' === $field_id ) : ?> <div class="dnxte-tooltip-container">? <span class="tooltip-text"> <?php esc_html_e( 'Controls how far users must scroll (in pixels) before the button appears on mobile.', 'dnxte-divi-essential' ); ?> </span> </div> <?php endif; ?> </label> <?php if ( ! empty( $field['tooltip'] ) ) : ?> <span class="dnxte-tooltip-icon" title="<?php echo esc_attr( $field['tooltip'] ); ?>"> <span class="dashicons dashicons-editor-help"></span> </span> <?php endif; ?> </th> <td> <?php if ( 'font' === $field['type'] ) : ?> <div class="dnxte-font-field"> <?php echo dnext_display_google_fonts_dropdown( $back_to_top_settings[ $field_id ] ); // phpcs:ignore ?> </div> <?php elseif ( 'dimension' === $field['type'] ) : ?> <div class="dnxte-dimension-field" data-field-id="<?php echo esc_attr( $field_id ); ?>"> <?php $field_html_id_prefix = 'dnxte-back-to-top-'; $field_name_prefix = $field_id; // Top Input $prop_top = 'top'; $input_id_top = $field_html_id_prefix . $prop_top . '-' . $field_id; $input_name_top = $field_name_prefix . '_' . $prop_top; $input_value_top = $back_to_top_settings[ $input_name_top ] ?? ''; ?> <div class="dnxte-dimension-field-input_item"> <input id="<?php echo esc_attr( $input_id_top ); ?>" name="<?php echo esc_attr( $input_name_top ); ?>" type="number" value="<?php echo esc_attr( $input_value_top ); ?>" class="dnxte-dimension-field-input dnxte-dimension-input-top" placeholder="<?php echo esc_attr( ucfirst( $prop_top ) ); ?>" data-dimension-part="top" /> <span><?php echo esc_html( ucfirst( $prop_top ) ); ?></span> </div> <!-- Vertical Link Button --> <?php $linked_vertical_setting_key = $field_name_prefix . '_linked_vertical'; // Ensure value from settings is treated as string for comparison with '1' $linked_vertical_val = isset( $back_to_top_settings[ $linked_vertical_setting_key ] ) ? (string) $back_to_top_settings[ $linked_vertical_setting_key ] : '0'; $linked_vertical_icon_class = ( '1' === $linked_vertical_val ) ? 'dashicons-admin-links' : 'dashicons-editor-unlink'; ?> <div class="dnxte-dimension-link-toggle-container dnxte-dimension-link-vertical"> <input type="checkbox" id="<?php echo esc_attr( $linked_vertical_setting_key . '_checkbox' ); ?>" name="<?php echo esc_attr( $linked_vertical_setting_key ); ?>" value="1" class="dnxte-dimension-link-checkbox" data-link-pair="vertical" <?php checked( $linked_vertical_val, '1' ); ?> style="position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;" > <button type="button" class="dnxte-dimension-link-button button-link" data-controls-checkbox="<?php echo esc_attr( $linked_vertical_setting_key . '_checkbox' ); ?>" aria-pressed="<?php echo ( '1' === $linked_vertical_val ) ? 'true' : 'false'; ?>" title="<?php esc_attr_e( 'Link Top & Bottom values', 'dnxte-divi-essential' ); ?>"> <span class="dashicons <?php echo esc_attr( $linked_vertical_icon_class ); ?>"></span> </button> </div> <?php // Bottom Input $prop_bottom = 'bottom'; $input_id_bottom = $field_html_id_prefix . $prop_bottom . '-' . $field_id; $input_name_bottom = $field_name_prefix . '_' . $prop_bottom; $input_value_bottom = $back_to_top_settings[ $input_name_bottom ] ?? ''; ?> <div class="dnxte-dimension-field-input_item"> <input id="<?php echo esc_attr( $input_id_bottom ); ?>" name="<?php echo esc_attr( $input_name_bottom ); ?>" type="number" value="<?php echo esc_attr( $input_value_bottom ); ?>" class="dnxte-dimension-field-input dnxte-dimension-input-bottom" placeholder="<?php echo esc_attr( ucfirst( $prop_bottom ) ); ?>" data-dimension-part="bottom" /> <span><?php echo esc_html( ucfirst( $prop_bottom ) ); ?></span> </div> <?php // Left Input $prop_left = 'left'; $input_id_left = $field_html_id_prefix . $prop_left . '-' . $field_id; $input_name_left = $field_name_prefix . '_' . $prop_left; $input_value_left = $back_to_top_settings[ $input_name_left ] ?? ''; ?> <div class="dnxte-dimension-field-input_item"> <input id="<?php echo esc_attr( $input_id_left ); ?>" name="<?php echo esc_attr( $input_name_left ); ?>" type="number" value="<?php echo esc_attr( $input_value_left ); ?>" class="dnxte-dimension-field-input dnxte-dimension-input-left" placeholder="<?php echo esc_attr( ucfirst( $prop_left ) ); ?>" data-dimension-part="left" /> <span><?php echo esc_html( ucfirst( $prop_left ) ); ?></span> </div> <!-- Horizontal Link Button --> <?php $linked_horizontal_setting_key = $field_name_prefix . '_linked_horizontal'; $linked_horizontal_val = isset( $back_to_top_settings[ $linked_horizontal_setting_key ] ) ? (string) $back_to_top_settings[ $linked_horizontal_setting_key ] : '0'; $linked_horizontal_icon_class = ( '1' === $linked_horizontal_val ) ? 'dashicons-admin-links' : 'dashicons-editor-unlink'; ?> <div class="dnxte-dimension-link-toggle-container dnxte-dimension-link-horizontal"> <input type="checkbox" id="<?php echo esc_attr( $linked_horizontal_setting_key . '_checkbox' ); ?>" name="<?php echo esc_attr( $linked_horizontal_setting_key ); ?>" value="1" class="dnxte-dimension-link-checkbox" data-link-pair="horizontal" <?php checked( $linked_horizontal_val, '1' ); ?> style="position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;" > <button type="button" class="dnxte-dimension-link-button button-link" data-controls-checkbox="<?php echo esc_attr( $linked_horizontal_setting_key . '_checkbox' ); ?>" aria-pressed="<?php echo ( '1' === $linked_horizontal_val ) ? 'true' : 'false'; ?>" title="<?php esc_attr_e( 'Link Left & Right values', 'dnxte-divi-essential' ); ?>"> <span class="dashicons <?php echo esc_attr( $linked_horizontal_icon_class ); ?>"></span> </button> </div> <?php // Right Input $prop_right = 'right'; $input_id_right = $field_html_id_prefix . $prop_right . '-' . $field_id; $input_name_right = $field_name_prefix . '_' . $prop_right; $input_value_right = $back_to_top_settings[ $input_name_right ] ?? ''; ?> <div class="dnxte-dimension-field-input_item"> <input id="<?php echo esc_attr( $input_id_right ); ?>" name="<?php echo esc_attr( $input_name_right ); ?>" type="number" value="<?php echo esc_attr( $input_value_right ); ?>" class="dnxte-dimension-field-input dnxte-dimension-input-right" placeholder="<?php echo esc_attr( ucfirst( $prop_right ) ); ?>" data-dimension-part="right" /> <span><?php echo esc_html( ucfirst( $prop_right ) ); ?></span> </div> <span>PX</span> </div> <?php elseif ( 'checkbox' === $field['type'] ) : ?> <label class="toggle" for="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>"> <input id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" type="checkbox" value="1" class="toggle-checkbox dnxte-checkbox-field" <?php checked( $back_to_top_settings[ $field_id ], 1 ); ?> /> <div class="toggle-switch"></div> </label> <?php elseif ( 'color' === $field['type'] ) : ?> <input id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" type="text" data-alpha-enabled="true" class="dnxte-color-picker" value="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" data-default-color="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" /> <?php elseif ( 'select' === $field['type'] ) : ?> <select id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" class="dnxte-select-field regular-text" > <?php foreach ( $field['options'] as $option_value => $option_label ) : ?> <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $back_to_top_settings[ $field_id ], $option_value ); ?> > <?php echo esc_html( $option_label ); ?> </option> <?php endforeach; ?> </select> <?php elseif ( 'text' === $field['type'] ) : ?> <input id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" type="text" class="regular-text dnxte-text-field" value="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ?? '' ); ?>" /> <?php elseif ( 'number' === $field['type'] ) : ?> <input id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" type="number" step="any" class="regular-text dnxte-text-field <?php echo 'button_line_height' === esc_attr( $field_id ) ? 'dnxte-line-height' : ''; ?>" value="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ?? '' ); ?>" /> <span>PX</span> <?php elseif ( 'radio' === $field['type'] ) : ?> <fieldset class="dnxte-radio-group"> <legend class="screen-reader-text"><?php echo esc_html( $field['label'] ); ?></legend> <?php foreach ( $field['options'] as $option_value => $option_label ) : ?> <label class="dnxte-radio-label"> <input type="radio" name="<?php echo esc_attr( $field_id ); ?>" value="<?php echo esc_attr( $option_value ); ?>" <?php checked( $back_to_top_settings[ $field_id ], $option_value ); ?> class="dnxte-radio-field" > <span><?php echo esc_html( $option_label ); ?></span> </label> <?php endforeach; ?> </fieldset> <?php elseif ( 'dashicon' === $field['type'] ) : ?> <div class="dnxte-dashicon-selector"> <div class="dnxte-selected-dashicon"> <i class="dashicons <?php echo esc_attr( $back_to_top_settings['button_dashicon'] ); ?>"></i> <span class="dnxte-dashicon-name"><?php echo esc_html( $back_to_top_settings['button_dashicon'] ); ?></span> </div> <button type="button" class="button dnxte-open-dashicon-picker"><?php esc_html_e( 'Select Icon', 'dnxte-divi-essential' ); ?></button> <input type="hidden" id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" value="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" > <div class="dnxte-dashicon-picker-container" style="display:none;"> <div class="dnxte-dashicon-picker-header"> <input type="text" class="dnxte-dashicon-search" placeholder="<?php esc_attr_e( 'Search icons...', 'dnxte-divi-essential' ); ?>"> <button type="button" class="dnxte-close-dashicon-picker">×</button> </div> <div class="dnxte-dashicon-list"> <?php // List of common Dashicons - you can expand this list foreach ( $dashicons as $dashicon ) { $selected = ( $dashicon === $back_to_top_settings['button_dashicon'] ) ? ' selected' : ''; echo '<div class="dnxte-dashicon-item' . esc_attr( $selected ) . '" data-icon="' . esc_attr( $dashicon ) . '">'; echo '<i class="dashicons ' . esc_attr( $dashicon ) . '"></i>'; echo '</div>'; } ?> </div> </div> </div> <?php elseif ( 'image' === $field['type'] ) : ?> <div class="dnxte-image-uploader"> <div class="dnxte-custom-image-preview"> <?php if ( ! empty( $back_to_top_settings[ $field_id ] ) ) : ?> <img width="32" height="32" src="<?php echo esc_url( $back_to_top_settings[ $field_id ] ); ?>" alt="<?php esc_attr_e( 'Custom Icon', 'dnxte-divi-essential' ); ?>"> <?php else : ?> <div class="dnxte-no-image"><?php esc_html_e( 'No image selected', 'dnxte-divi-essential' ); ?></div> <?php endif; ?> </div> <input type="hidden" id="dnxte-back-to-top-<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>" value="<?php echo esc_attr( $back_to_top_settings[ $field_id ] ); ?>" > <button type="button" class="button dnxte-upload-image" data-field="<?php echo esc_attr( $field_id ); ?>"><?php esc_html_e( 'Upload Image', 'dnxte-divi-essential' ); ?></button> <button type="button" class="button dnxte-remove-image" data-field="<?php echo esc_attr( $field_id ); ?>" <?php echo empty( $back_to_top_settings[ $field_id ] ) ? 'style="display:none;"' : ''; ?>><?php esc_html_e( 'Remove Image', 'dnxte-divi-essential' ); ?></button> </div> <?php endif; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php } } ?> </div> <?php endforeach; ?> <p class="submit"> <button id="dnxte-back-to-top-save" class="button button-primary"> <?php esc_html_e( 'Save Changes', 'dnxte-divi-essential' ); ?> </button> </p> </form> </div> </div> </div> <script> </script>
Save
Back