Edit File by line
/home/barbar84/www/wp-conte.../plugins/ninja-fo.../includes/Fields
File: Date.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class NF_Fields_Date
[3] Fix | Delete
*/
[4] Fix | Delete
class NF_Fields_Date extends NF_Fields_Textbox
[5] Fix | Delete
{
[6] Fix | Delete
protected $_name = 'date';
[7] Fix | Delete
[8] Fix | Delete
protected $_nicename = 'Date';
[9] Fix | Delete
[10] Fix | Delete
protected $_section = 'common';
[11] Fix | Delete
[12] Fix | Delete
protected $_icon = 'calendar';
[13] Fix | Delete
[14] Fix | Delete
protected $_type = 'date';
[15] Fix | Delete
[16] Fix | Delete
protected $_templates = 'date';
[17] Fix | Delete
[18] Fix | Delete
protected $_test_value = '12/12/2022';
[19] Fix | Delete
[20] Fix | Delete
protected $_settings = array( 'date_default', 'date_format', 'year_range' );
[21] Fix | Delete
[22] Fix | Delete
protected $_settings_exclude = array( 'default', 'input_limit_set', 'disable_input' );
[23] Fix | Delete
[24] Fix | Delete
public function __construct()
[25] Fix | Delete
{
[26] Fix | Delete
parent::__construct();
[27] Fix | Delete
[28] Fix | Delete
$this->_nicename = esc_html__( 'Date', 'ninja-forms' );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public function process( $field, $data )
[32] Fix | Delete
{
[33] Fix | Delete
return $data;
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
private function get_format( $format )
[37] Fix | Delete
{
[38] Fix | Delete
$lookup = array(
[39] Fix | Delete
'MM/DD/YYYY' => esc_html__( 'm/d/Y', 'ninja-forms' ),
[40] Fix | Delete
'MM-DD-YYYY' => esc_html__( 'm-d-Y', 'ninja-forms' ),
[41] Fix | Delete
'MM.DD.YYYY' => esc_html__( 'm.d.Y', 'ninja-forms' ),
[42] Fix | Delete
'DD/MM/YYYY' => esc_html__( 'm/d/Y', 'ninja-forms' ),
[43] Fix | Delete
'DD-MM-YYYY' => esc_html__( 'd-m-Y', 'ninja-forms' ),
[44] Fix | Delete
'DD.MM.YYYY' => esc_html__( 'd.m.Y', 'ninja-forms' ),
[45] Fix | Delete
'YYYY-MM-DD' => esc_html__( 'Y-m-d', 'ninja-forms' ),
[46] Fix | Delete
'YYYY/MM/DD' => esc_html__( 'Y/m/d', 'ninja-forms' ),
[47] Fix | Delete
'YYYY.MM.DD' => esc_html__( 'Y.m.d', 'ninja-forms' ),
[48] Fix | Delete
'dddd, MMMM D YYYY' => esc_html__( 'l, F d Y', 'ninja-forms' ),
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
return ( isset( $lookup[ $format ] ) ) ? $lookup[ $format ] : $format;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function