PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / addon-api / fields / date.php
wp-all-export / addon-api / fields Last commit date
checkbox.php 3 weeks ago date.php 3 weeks ago datetime.php 3 weeks ago field.php 3 weeks ago gallery.php 3 weeks ago media.php 3 weeks ago number.php 3 weeks ago post.php 3 weeks ago radio.php 3 weeks ago repeater.php 3 weeks ago select.php 3 weeks ago switcher.php 3 weeks ago text.php 3 weeks ago time.php 3 weeks ago toggle.php 3 weeks ago user.php 3 weeks ago
date.php
37 lines
1 <?php
2
3 namespace Wpae\AddonAPI;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 class PMXE_Addon_Date_Field extends PMXE_Addon_Field {
8
9 public function isTimestamp( $string ) {
10 try {
11 new \DateTime( '@' . $string );
12 } catch ( \Exception $e ) {
13 return false;
14 }
15
16 return true;
17 }
18
19 public function toString() {
20 if ( ! $this->value ) {
21 return '';
22 }
23
24 $timestamp = $this->isTimestamp( $this->value ) ?
25 $this->value : strtotime( $this->value );
26
27 // We need a default value for the settings if they're blank.
28 $this->settings = $this->settings ?: 'Y-m-d';
29
30 return prepare_date_field_value(
31 $this->settings,
32 $timestamp,
33 "Y-m-d"
34 );
35 }
36 }
37