-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharea_calc.php
More file actions
44 lines (40 loc) · 1 KB
/
Copy patharea_calc.php
File metadata and controls
44 lines (40 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @package area_calc
* @version 1.0
*/
/*
Plugin Name: Alan Hesaplama
Plugin URI: #
Description: Cam Balkon alan hesaplama ve fiyat çıkarma eklentisi.
Author: Caner O.
Version: 1.0
Author URI: #
*/
function area_calc_shortcode($atts, $content = null)
{
//$atts = shortcode_atts( array('one' => 'default content'),$atts );
include( plugin_dir_path(__FILE__) . 'public_view.php');
return null;
}
add_shortcode('area-calc', 'area_calc_shortcode');
function calc_settings_page()
{
add_menu_page(
'Cam Balkon Alan Hesaplama',
'Alan Hesaplama',
'manage_options',
plugin_dir_path(__FILE__) . 'admin_view.php',
null,//function
null,//icon
20
);
}
add_action('admin_menu', 'calc_settings_page');
function calc_settings()
{
register_setting('area_calc','area_calc-one',array("default"=>"[{'name':'Sample','price':10}]"));
register_setting('area_calc','area_calc-two',array("default"=>"{'width':10,'heigth':10}"));
}
add_action('admin_init','calc_settings');
?>