PluginProbe
WP Coder – Insert & Manage Code Snippets / 2.5.5
WP Coder – Insert & Manage Code Snippets v2.5.5
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | admin/partials/include-data.php +46 -46 2.5.22.5.5 View file →
@@ -1,49 +1,49 @@
1 -<?php
2 -
3 - /**
4 - * Include data param for Wow Plugin
5 - *
6 - * @package Wow_Plugin
7 - * @copyright Copyright (c) 2018, Dmytro Lobov
8 - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 - * @since 1.0
10 - */
11 - if ( ! defined( 'ABSPATH' ) ) exit;
12 -
13 - $act = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : '';
14 - if ($act == "update") {
15 - $recid = absint( $_REQUEST["id"] );
16 - $result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid");
17 - if ($result){
18 - $id = $result->id;
19 - $title = $result->title;
20 - $param = unserialize( $result->param );
21 - $tool_id = $id;
22 - $hidval = 2;
23 - $btn = __( 'Update', 'wpcoder' );
24 - }
1 +<?php
2 +
3 +/**
4 + * Include data param for Wow Plugin
5 + *
6 + * @package Wow_Plugin
7 + * @copyright Copyright (c) 2018, Dmytro Lobov
8 + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 + * @since 1.0
10 + */
11 +if ( ! defined( 'ABSPATH' ) ) {
12 + exit;
13 +}
14 +
15 +$act = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : '';
16 +if ( $act === "update" ) {
17 + $recid = absint( $_REQUEST["id"] );
18 + $sSQL = $wpdb->prepare( "select * from $data WHERE id = %d", $recid );
19 + $result = $wpdb->get_row( $sSQL );
20 + if ( $result ) {
21 + $id = $result->id;
22 + $title = $result->title;
23 + $param = unserialize( $result->param );
24 + $tool_id = $id;
25 + $hidval = 2;
26 + $btn = __( 'Update', 'wpcoder' );
25 27 }
26 - else if ($act == "duplicate") {
27 - $recid = $_REQUEST["id"];
28 - $result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid");
29 - if ($result){
30 - $id = "";
31 - $title = "";
32 - $param = unserialize($result->param);
33 - $last = $wpdb->get_col( "SELECT id FROM $data" );;
34 - $tool_id = max( $last ) + 1;
35 - $hidval = 1;
36 - $btn = __( 'Save', 'wpcoder' );
37 - }
38 - }
39 - else {
40 - $id = "";
41 - $title = "";
28 +} elseif ( $act === "duplicate" ) {
29 + $recid = absint( $_REQUEST["id"] );
30 + $sSQL = $wpdb->prepare( "select * from $data WHERE id = %d", $recid );
31 + $result = $wpdb->get_row( $sSQL );
32 + if ( $result ) {
33 + $id = "";
34 + $title = "";
35 + $param = unserialize( $result->param );
42 36 $last = $wpdb->get_col( "SELECT id FROM $data" );
43 - $tool_id = !empty($last) ? max( $last ) + 1 : 1;
44 - $param = '';
45 - $hidval = 1;
46 - $btn = __( 'Save', 'wpcoder' );
37 + $tool_id = max( $last ) + 1;
38 + $hidval = 1;
39 + $btn = __( 'Save', 'wpcoder' );
47 40 }
48 -
49 -?>
41 +} else {
42 + $id = "";
43 + $title = "";
44 + $last = $wpdb->get_col( "SELECT id FROM $data" );
45 + $tool_id = ! empty( $last ) ? max( $last ) + 1 : 1;
46 + $param = '';
47 + $hidval = 1;
48 + $btn = __( 'Save', 'wpcoder' );
49 +}