PluginProbe
Floating Button – Easily Create Sticky, Fixed & Floating Buttons / 5.1.1
Floating Button – Easily Create Sticky, Fixed & Floating Buttons v5.1.1
trunk 2.0.2 3.0 4.0 4.1.2 4.3 5.0 5.0.1 5.1 5.1.1 5.2 5.3 5.3.1 6.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 All 31 releases
floating-button / public / partials / public.php

public.php in Floating Button – Easily Create Sticky, Fixed & Floating Buttons 5.1.1, at public/partials/public.php

110 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Public code
4 *
5 * @package Wow_Plugin
6 * @copyright Copyright (c) 2018, Dmytro Lobov
7 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8 * @since 1.0
9 */
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 $menu_icon = '<i class="' . $param['button_icon'] . '"></i>';
15
16
17 $menu = '<div class="flBtn flBtn-position-br flBtn-size-medium flBtn-shape-circle" id="floatBtn-' . $id . '">';
18 $menu .= '<label for="floating-main-button-' . $id . '" class="flBtn-screen-reader-text">' . esc_attr__( 'Floating button', 'floating-button' ) . '</label>';
19 $menu .= '<input type="checkbox" id="floating-main-button-' . $id . '">';
20 $menu .= '<a role="button" data-role="main">' . $menu_icon . '</a>';
21
22 // Build Vertical button menu
23
24 if ( ! empty( $param['menu_1']['item_type'] ) ) :
25 $menu .= '<ul class="flBtn-first">';
26 $count_i = count( $param['menu_1']['item_type'] );
27
28 for ( $i = 0; $i < $count_i; $i ++ ) {
29 $menu .= '<li>';
30
31 $icon = '<i class="' . $param['menu_1']['item_icon'][ $i ] . '"></i>';
32
33 if ( ! empty( $param['menu_1']['item_tooltip_include'][ $i ] ) ) {
34 $tooltip = ' data-tooltip="' . $param['menu_1']['item_tooltip'][ $i ] . '"';
35 } else {
36 $tooltip = '';
37 }
38
39 $item_type = $param['menu_1']['item_type'][ $i ];
40 $link_param = $tooltip;
41 $link = $param['menu_1']['item_link'][ $i ];
42
43 switch ( $item_type ) {
44 case 'link':
45 $menu .= '<a href="' . $link . '" ' . $link_param . '>' . $icon . '</a>';
46 break;
47 case 'login':
48 $menu .= '<a rel="nofollow" href="' . wp_login_url( $link ) . '" ' . $link_param . '>' . $icon . '</a>';
49 break;
50 case 'logout':
51 $menu .= '<a rel="nofollow" href="' . wp_logout_url( $link ) . '" ' . $link_param . '>' . $icon
52 . '</a>';
53 break;
54 case 'register':
55 $menu .= '<a rel="nofollow" href="' . wp_registration_url() . '" ' . $link_param . '>' . $icon . '</a>';
56 break;
57 case 'lostpassword':
58 $menu .= '<a rel="nofollow" href="' . wp_lostpassword_url( $link ) . '" ' . $link_param . '>' . $icon
59 . '</a>';
60 break;
61
62 }
63 $menu .= '</li>';
64 }
65 $menu .= '</ul>';
66 endif;
67
68 // Build Horizontal button menu
69 if ( ! empty( $param['menu_2']['item_type'] ) ) :
70 $menu .= '<ul class="flBtn-second">';
71 $count_i = count( $param['menu_2']['item_type'] );
72 for ( $i = 0; $i < $count_i; $i ++ ) {
73 $menu .= '<li>';
74 $icon = '<i class="' . $param['menu_2']['item_icon'][ $i ] . '"></i>';
75 if ( ! empty( $param['menu_2']['item_tooltip_include'][ $i ] ) ) {
76
77 $tooltip = ' data-tooltip="' . $param['menu_2']['item_tooltip'][ $i ] . '"';
78 } else {
79 $tooltip = '';
80 }
81 $item_type = $param['menu_2']['item_type'][ $i ];
82 $link_param = $tooltip;
83 $link = $param['menu_2']['item_link'][ $i ];
84
85 switch ( $item_type ) {
86 case 'link':
87 $menu .= '<a href="' . $link . '" ' . $link_param . '>' . $icon . '</a>';
88 break;
89 case 'login':
90 $menu .= '<a rel="nofollow" href="' . wp_login_url( $link ) . '" ' . $link_param . '>' . $icon . '</a>';
91 break;
92 case 'logout':
93 $menu .= '<a rel="nofollow" href="' . wp_logout_url( $link ) . '" ' . $link_param . '>' . $icon
94 . '</a>';
95 break;
96 case 'register':
97 $menu .= '<a rel="nofollow" href="' . wp_registration_url() . '" ' . $link_param . '>' . $icon . '</a>';
98 break;
99 case 'lostpassword':
100 $menu .= '<a rel="nofollow" href="' . wp_lostpassword_url( $link ) . '" ' . $link_param . '>' . $icon
101 . '</a>';
102 break;
103 }
104 $menu .= '</li>';
105 }
106 $menu .= '</ul>';
107 endif;
108 $menu .= '</div>';
109
110