PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / includes / admin / views / metaboxes / campaign-end-date.php

campaign-end-date.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at includes/admin/views/metaboxes/campaign-end-date.php

44 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8
9 /**
10 * Renders the end date field for the Campaign post type.
11 *
12 * @author WP Charitable LLC
13 * @package Charitable/Admin Views/Metaboxes
14 * @since 1.0.0
15 * @version 1.6.53
16 * @version 1.8.8.6
17 */
18
19 global $post;
20
21 $charitable_i18n = charitable()->registry()->get( 'i18n' );
22 $charitable_php_format = $charitable_i18n->get_datepicker_format( 'F d, Y' );
23 $charitable_js_format = $charitable_i18n->get_js_datepicker_format( 'MM d, yy' );
24
25 $charitable_end_date = get_post_meta( $post->ID, '_campaign_end_date', true );
26 $charitable_end_time = strtotime( $charitable_end_date );
27 $charitable_end_date_formatted = ! $charitable_end_date ? '' : date_i18n( $charitable_php_format, $charitable_end_time );
28 $title = array_key_exists( 'title', $view_args ) ? $view_args['title'] : ''; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
29 $charitable_description = array_key_exists( 'description', $view_args ) ? $view_args['description'] : '';
30
31 ?>
32 <div id="charitable-campaign-end-date-metabox-wrap" class="charitable-metabox-wrap">
33 <label for="campaign_end_date"><?php echo wp_kses_post( $title ); ?></label>
34 <input type="text" id="campaign_end_date" name="_campaign_end_date" placeholder="&#8734;" class="charitable-datepicker" autocomplete="off" data-date="<?php echo esc_attr( $charitable_end_date_formatted ); ?>" data-format="<?php echo esc_attr( $charitable_js_format ); ?>" />
35 <?php if ( $charitable_end_date ) : ?>
36 <span class="charitable-end-time"><?php echo esc_html( date_i18n( '@ G:i A', $charitable_end_time ) ); ?></span>
37 <input type="hidden" id="campaign_end_time" name="_campaign_end_time" value="<?php echo esc_attr( date_i18n( 'H:i:s', $charitable_end_time ) ); ?>" />
38 <?php else : ?>
39 <span class="charitable-end-time" style="display: none;">=</span>
40 <input type="hidden" id="campaign_end_time" name="_campaign_end_time" value="0" />
41 <?php endif ?>
42 <span class="charitable-helper"><?php echo $charitable_description; // phpcs:ignore ?></span>
43 </div>
44