-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersian-calender.php
83 lines (72 loc) · 2.44 KB
/
persian-calender.php
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Plugin Name: persian Calendar
*
* Description: A plugin to manage calendar display on the calendar page.
*
* Version: 1.0.0
*
* Author: hassan Ali Askari
* Author URI: https://t.me/hassan7303
* Plugin URI: https://github.com/hassan7303
*
* License: MIT
* License URI: https://opensource.org/licenses/MIT
*
* Email: [email protected]
* Domain Path: https://hsnali.ir
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Displays the calendar content on the "calender" page.
*
* This function checks if the current request is for the "calender" page. If so,
* it includes the necessary styles and scripts, displays the calendar header
* with navigation buttons, and generates the structure for the calendar body,
* including the day names and days of the month.
*
* The calendar layout is built using HTML and will be populated with
* the appropriate date information via JavaScript.
*
* @return void
*/
function custom_calendar_display():void
{
$slug = $_SERVER['REQUEST_URI'];
if ($slug == '/calender/') {
get_header()
?>
<head>
<link href="<?php echo plugin_dir_url(__FILE__) . 'assets/css/style.css'; ?>" rel="stylesheet" type="text/css">
<script src="<?php echo plugin_dir_url(__FILE__) . 'assets/js/script.js'; ?>"></script>
<script src="<?php echo plugin_dir_url(__FILE__) . 'libs/jalaali-js/dist/jalaali.min.js'; ?>"></script>
</head>
<section class="body_calender">
<div class="calendar-container">
<div class="calendar-header">
<button id="prevMonth">ماه قبل</button>
<span id="month-year"></span>
<button id="nextMonth">ماه بعد</button>
</div>
<div class="calendar-body">
<div class="day-names">
<div>شنبه</div>
<div>یکشنبه</div>
<div>دوشنبه</div>
<div>سهشنبه</div>
<div>چهارشنبه</div>
<div>پنجشنبه</div>
<div>جمعه</div>
</div>
<div id="days" class="days"></div>
</div>
</div>
</section>
<?php
get_footer();
exit;
}
}
add_action('init', 'custom_calendar_display');