PluginProbe
Bubble Menu – Floating Button Menu with Sticky Navigation / 2.2
Bubble Menu – Floating Button Menu with Sticky Navigation v2.2
trunk 1.3 2.0 2.2 2.2.1 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.1 4.1.1
bubble-menu / admin / partials / include-data.php

include-data.php in Bubble Menu – Floating Button Menu with Sticky Navigation 2.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 <i@wpbiker.com>
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