PluginProbe
Button Generator – Easily Create Custom Buttons with Icons and Analytics / 2.3.9
Button Generator – Easily Create Custom Buttons with Icons and Analytics v2.3.9
trunk 1.1.1 2.0 2.1 2.2 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.2 3.2.1 3.2.2 3.2.3 All 28 releases
button-generation / admin / partials / include-data.php

include-data.php in Button Generator – Easily Create Custom Buttons with Icons and Analytics 2.3.9, at admin/partials/include-data.php

52 lines 1.5 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 Wow-Company <yoda@wow-company.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 if ( $act === "update" ) {
20 $rec_id = absint( $_REQUEST["id"] );
21 $query = $wpdb->prepare( "SELECT * FROM {$data} WHERE id=%d", absint( $rec_id ) );
22 $result = $wpdb->get_row( $query );
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 = absint( $_REQUEST["id"] );
33 $query = $wpdb->prepare( "SELECT * FROM {$data} WHERE id=%d", absint( $rec_id ) );
34 $result = $wpdb->get_row( $query );
35 $id = "";
36 $title = "";
37 $add_action = 1;
38 $btn = esc_attr__( 'Save', $this->plugin['text'] );
39 $last = $wpdb->get_col( "SELECT id FROM {$data}" );
40 $tool_id = ! empty( $last ) ? max( $last ) + 1 : 1;
41 $param = ( $result ) ? unserialize( $result->param ) : '';
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