103 | | foreach ( array( 'Y', 'y', 'o' ) as $year_token ) { |
104 | | $date_format = preg_replace( '/(?<!\\\\)' . $year_token . '/', '%1$s', $date_format ); |
| 103 | $date_format = preg_replace( '/(?<!\\\\)[Yyo]/', '%1$s', $date_format ); |
| 104 | $date_format = preg_replace( '/(?<!\\\\)[FmMn]/', '%2$s', $date_format ); |
| 105 | $date_format = preg_replace( '/(?<!\\\\)[jd]/', '%3$s', $date_format ); |
| 106 | |
| 107 | // Fallback to locate default format if year, month, or day are missing from the date format. |
| 108 | if ( 1 !== substr_count( $date_format, '%1$s' ) || 1 !== substr_count( $date_format, '%2$s' ) || 1 !== substr_count( $date_format, '%3$s' ) ) { |
| 109 | /* translators: 1: year, 2: month, 3: day */ |
| 110 | $date_format = __( '%1$s-%2$s-%3$s' ); |