# wp-coder/1.1/admin/partials/include/data.php

WP Coder – Insert &amp; Manage Code Snippets, version 1.1. 36 lines.

- Page: https://pluginprobe.com/plugins/wp-coder/1.1/code/admin/partials/include/data.php
- Raw: https://pluginprobe.com/plugins/wp-coder/1.1/raw/admin/partials/include/data.php
- Modified: 2018-11-08T15:54:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-coder/1.1/code/admin/partials/include/data.php#L10-L20`.

```php
<?php if ( ! defined( 'ABSPATH' ) ) exit; 
$act = (isset($_REQUEST["act"])) ? $_REQUEST["act"] : '';
if ($act == "update") {
	$recid = $_REQUEST["id"];
	$result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid");
	if ($result){
        $id = $result->id;
        $title = $result->title;
		$param = unserialize($result->param);		
		$btn = "Update";
        $hidval = 2;
    }
}
else if ($act == "duplicate") {
	$recid = $_REQUEST["id"];
	$result = $wpdb->get_row("SELECT * FROM $data WHERE id=$recid");
	if ($result){
        $id = "";
        $title = "";
        $param = unserialize($result->param);				
		$btn = "Save";
        $hidval = 1;
    }
}
 else {
    $btn = "Save";
    $id = "";
	$param['item_user'] = 1;
	$param['lang'] = '';
	$param['show'] = '';
    $title = "";		
    $hidval = 1;
	
}

?>
```
