PluginProbe
Floating Button – Easily Create Sticky, Fixed & Floating Buttons / 4.1.2
Floating Button – Easily Create Sticky, Fixed & Floating Buttons v4.1.2
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 / admin / partials / include-data.php

include-data.php in Floating Button – Easily Create Sticky, Fixed & Floating Buttons 4.1.2, at admin/partials/include-data.php

52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Include data param for Wow Plugin
4 *
5 * @package Wow_Plugin
6 * @subpackage Admin/Data_Item
7 * @author Dmytro Lobov <d@dayes.dev>
8 * @copyright 2019 Wow-Company
9 * @license GNU Public License
10 * @version 1.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 $act = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : '';
18
19
20 if ( $act == "update" ) {
21 $rec_id = absint( $_REQUEST["id"] );
22 $result = $wpdb->get_row( "SELECT * FROM $data WHERE id=$rec_id" );
23 if ( $result ) {
24 $id = $result->id;
25 $title = $result->title;
26 $param = unserialize( $result->param );
27 $tool_id = $id;
28 $add_action = 2;
29 $btn = esc_attr__( 'Update', $this->plugin['text'] );
30 }
31 } elseif ( $act == "duplicate" ) {
32 $rec_id = $_REQUEST["id"];
33 $result = $wpdb->get_row( "SELECT * FROM $data WHERE id=$rec_id" );
34 if ( $result ) {
35 $id = "";
36 $title = "";
37 $param = unserialize( $result->param );
38 $last = $wpdb->get_col( "SELECT id FROM $data" );;
39 $tool_id = max( $last ) + 1;
40 $add_action = 1;
41 $btn = esc_attr__( 'Save', $this->plugin['text'] );
42 }
43 } else {
44 $id = "";
45 $title = "";
46 $last = $wpdb->get_col( "SELECT id FROM $data" );
47 $tool_id = !empty($last) ? max( $last ) + 1 : 1;
48 $param = '';
49 $add_action = 1;
50 $btn = esc_attr__( 'Save', $this->plugin['text'] );
51 }
52