PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / 2.3.1
پارسی دیت – Parsi Date v2.3.1
6.1 5.1.6 5.1.7 5.1.8 5.1.8.2 6.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.0.0-alpha 2.1 2.1.1 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0.1 2.3.0.2 2.3.1 2.3.2 2.3.3 2.3.4 3.0.1 3.0.2 3.0.3 4.0.0 4.0.1 4.0.2 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5
wp-parsidate / includes / widget / widget_calendar.php
wp-parsidate / includes / widget Last commit date
widget_archive.php 9 years ago widget_calendar.php 9 years ago
widget_calendar.php
53 lines
1 <?php
2
3 /**
4 * @author lord_viper
5 * @copyright 2013
6 */
7 class parsidate_calendar extends WP_Widget {
8 public function __construct() {
9 global $wp_version;
10 if ( version_compare( $wp_version, '4.3', '>=' ) ) {
11 parent::__construct( false, __( 'Jalali Date Calender', 'wp-parsidate' ), 'description=' . __( 'Jalali Date Calender', 'wp-parsidate' ) );
12 } else {
13 parent::WP_Widget( false, __( 'Jalali Date Calender', 'wp-parsidate' ), 'description=' . __( 'Jalali Date Calender', 'wp-parsidate' ) );
14 }
15 }
16
17 public function form( $instance ) {
18 global $wpp_settings;
19 ?>
20 <p style="text-align:right; direction:rtl">
21 <label><?php _e( 'Title:', 'wp-parsidate' ) ?></label>
22 <input style="width: 200px;" id="<?php echo $this->get_field_id( 'parsidate_calendar_title' ); ?>"
23 name="<?php echo $this->get_field_name( 'parsidate_calendar_title' ); ?>" type="text"
24 value="<?php echo( empty( $instance['parsidate_calendar_title'] ) ? __( 'Jalali Date Calender', 'wp-parsidate' ) : $instance['parsidate_calendar_title'] ) ?>"/>
25 </p>
26 <?php
27 if ( $wpp_settings['conv_permalinks'] == 'disable' ) {
28 echo "<p style='color: #ff8153'>" . __( 'For use widget, active "Fix permalinks dates" option in plugin settings.', 'wp-parsidate' ) . "</p>";
29 }
30 }
31
32 public function update( $new_instance, $old_instance ) {
33 $instance = $old_instance;
34 $instance['parsidate_calendar_title'] = strip_tags( $new_instance['parsidate_calendar_title'] );
35
36 return $instance;
37 }
38
39 public function widget( $args, $instance ) {
40 global $wpp_settings;
41 if ( $wpp_settings['conv_permalinks'] == 'disable' ) {
42 return;
43 }
44 echo $args['before_widget'];
45 if ( ! empty( $instance['parsidate_calendar_title'] ) ) {
46 echo $args['before_title'] . apply_filters( 'widget_title', $instance['parsidate_calendar_title'] ) . $args['after_title'];
47 }
48 wpp_get_calendar();
49 echo $args['after_widget'];
50 }
51 }
52
53 ?>