# floating-button/6.0.6/includes/settings/options/main-button.php

Floating Button – Easily Create Sticky, Fixed &amp; Floating Buttons, version 6.0.6. 243 lines.

- Page: https://pluginprobe.com/plugins/floating-button/6.0.6/code/includes/settings/options/main-button.php
- Raw: https://pluginprobe.com/plugins/floating-button/6.0.6/raw/includes/settings/options/main-button.php
- Modified: 2024-09-18T12:39:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/floating-button/6.0.6/code/includes/settings/options/main-button.php#L10-L20`.

```php
<?php

use FloatingButton\Dashboard\FieldHelper;

defined( 'ABSPATH' ) || exit;

$icon_type = ( ! empty( $default['param']['custom_icon'] ) ) ? 'img' : 'default';

$main_type = [
	'main' => __( 'Main Button', 'floating-button' ),
];
$def_type  = array_merge( $main_type, FieldHelper::item_type() );

return [
	// Tooltip options
	'label' => [
		'type'  => 'text',
		'name'  => '[item_tooltip]',
		'title' => __( 'Label Text', 'floating-button' ),
		'class' => 'label-text',
	],

	'label_on' => [
		'type'  => 'checkbox',
		'name'  => '[item_tooltip_include]',
		'title' => __( 'Tooltip', 'floating-button' ),
		'class' => 'tooltip-checkbox',
		'text'  => __( 'Enable', 'floating-button' ),
	],

	'label_open' => [
		'type'  => 'checkbox',
		'name'  => '[item_tooltip_open]',
		'title' => __( 'Hold open', 'floating-button' ),
		'class' => 'tooltip-open',
		'text'  => __( 'Enable', 'floating-button' ),
	],

	// Type options
	'btn_type'   => [
		'type'    => 'select',
		'name'    => '[item_type]',
		'title'   => __( 'Button type', 'floating-button' ),
		'class'   => 'button-type',
		'options' => $def_type,
	],

	'btn_open' => [
		'type'  => 'checkbox',
		'name'  => '[hold_buttons_open]',
		'title' => __( 'Hold open', 'floating-button' ),
		'class' => 'button-type-main',
		'text'  => __( 'Enable', 'floating-button' ),
	],

	'link' => [
		'type'  => 'text',
		'name'  => '[item_link]',
		'title' => __( 'Link', 'floating-button' ),
		'class' => 'button-type-link',
	],

	'share' => [
		'type'    => 'select',
		'name'    => '[item_share]',
		'title'   => __( 'Social Networks', 'floating-button' ),
		'class'   => 'button-type-share',
		'options' => FieldHelper::share_services(),
	],

	'link_open' => [
		'type'  => 'checkbox',
		'name'  => '[new_tab]',
		'title' => __( 'Open in a new tab', 'floating-button' ),
		'class' => 'button-type-link-open',
		'text'  => __( 'Enable', 'floating-button' ),
	],

	'translate' => [
		'type'    => 'select',
		'name'    => '[gtranslate]',
		'title'   => __( 'Select Language', 'floating-button' ),
		'class'   => 'button-type-gtranslate',
		'options' => FieldHelper::gtranslate(),
	],

	'menu'      => [
		'type'    => 'select',
		'name'    => '[item_menu]',
		'title'   => __( 'Menus', 'floating-button' ),
		'class'   => 'button-type-menus',
		'options' => FieldHelper::site_menus(),
	],

	// Icon options
	'icon_type' => [
		'type'    => 'select',
		'name'    => '[button_icon_type]',
		'title'   => __( 'Icon type', 'floating-button' ),
		'class'   => 'icon-type',
		'default' => 'default',
		'options' => FieldHelper::icon_type(),
	],

	'btn_icon' => [
		'type'    => 'select',
		'name'    => '[button_icon]',
		'title'   => __( 'Icon', 'floating-button' ),
		'class'   => 'icon-type-default choose-icon',
		'default' => 'fas fa-hand-point-up',
		'options' => FieldHelper::icons(),
	],

	'btn_animation' => [
		'type'    => 'select',
		'name'    => '[button_icon_anomate]',
		'title'   => __( 'Animation', 'floating-button' ),
		'class'   => 'icon-type-default',
		'options' => FieldHelper::btn_self_anim(),
	],

	'img_url' => [
		'type'  => 'url',
		'name'  => '[custom_icon_url]',
		'title' => __( 'Image URL', 'floating-button' ),
		'class' => 'icon-type-img icon-type-img-url',
	],

	'img_alt' => [
		'type'  => 'text',
		'name'  => '[custom_icon_alt]',
		'title' => __( 'Image Alt', 'floating-button' ),
		'class' => 'icon-type-img icon-type-img-alt',
	],

	'emoji' => [
		'type'  => 'text',
		'name'  => '[custom_icon_emoji]',
		'title' => __( 'Emoji, Symbol', 'floating-button' ),
		'class' => 'icon-type-emoji',
	],

	'icon_class' => [
		'type'  => 'text',
		'name'  => '[custom_icon_class]',
		'title' => __( 'Set Class', 'floating-button' ),
		'class' => 'icon-type-class',
	],

	'icon_close_on' => [
		'type'  => 'checkbox',
		'name'  => '[close_button_enable]',
		'title' => __( 'Close Icon', 'floating-button' ),
		'class' => 'icon-type-close',
		'text'  => __( 'Enable', 'floating-button' ),
	],

	'icon_close' => [
		'type'    => 'select',
		'name'    => '[close_button_icon]',
		'title'   => __( 'Icon', 'floating-button' ),
		'class'   => 'icon-type-close-choose',
		'default' => 'fas fa-xmark',
		'options' => FieldHelper::icons(),
	],

	// Style options
	'button_animation' => [
		'type'    => 'select',
		'name'    => '[button_animation]',
		'title'   => __( 'Button animation', 'floating-button' ),
		'options' => FieldHelper::btn_self_animation(),
	],

	'btn_anim_count' => [
		'type'    => 'number',
		'name'    => '[btn_anim_count]',
		'title'   => __( 'Animation count', 'floating-button' ),
		'default' => '0',
		'class' => 'has-addon-right has-background btn-animation',
		'addon' => 'num',
	],

	'btn_anim_delay' => [
		'type'    => 'number',
		'name'    => '[btn_anim_delay]',
		'title'   => __( 'Animation delay', 'floating-button' ),
		'default' => '0',
		'class' => 'has-addon-right has-background btn-animation',
		'addon' => 'ms',
	],


	'btn_color' => [
		'type'    => 'color',
		'name'    => '[button_color]',
		'title'   => __( 'Button color', 'floating-button' ),
		'default' => '#009688',
		'class'   => 'item-icon-bg',
	],

	'btn_hover_color' => [
		'type'    => 'color',
		'name'    => '[button_hcolor]',
		'title'   => __( 'Button hover color', 'floating-button' ),
		'default' => '#009688',
	],

	'icon_color' => [
		'type'    => 'color',
		'name'    => '[icon_color]',
		'title'   => __( 'Icon color', 'floating-button' ),
		'class'   => 'item-icon-color',
		'default' => '#ffffff',
	],

	'icon_hover_color' => [
		'type'    => 'color',
		'name'    => '[icon_hcolor]',
		'title'   => __( 'Icon hover color', 'floating-button' ),
		'default' => '#ffffff',
	],

	// Attributes
	'btn_class'     => [
		'type'  => 'text',
		'name'  => '[main_button_class]',
		'title' => __( 'Class for element', 'floating-button' ),
	],

	'link_rel' => [
		'type'  => 'text',
		'name'  => '[link_rel]',
		'title' => __( 'Attribute: rel', 'floating-button' ),
	],

	'extra_class' => [
		'type'  => 'text',
		'name'  => '[extra_checkbox_class]',
		'title' => __( 'Extra class', 'floating-button' ),
	],

];
```
