Make WordPress Core

Ticket #11927: TimeTranslationBug.php

File TimeTranslationBug.php, 834 bytes (added by mattifesto, 15 years ago)

Test Case Plugin (will insert test text before content while activated)

Line 
1<?php
2/*
3Plugin Name: Time Translation Test Case
4Plugin URI: http://mattifesto.com/
5Description: Test case for mysql2date time translation bug in WordPress 2.9.1
6Author: Matt Calkins - Mattifesto Design
7Version: 1.0.0
8Author URI: http://mattifesto.com/
9*/
10
11add_filter('the_content', 'TimeTranslationTestCase::FilterTheContent');
12
13class TimeTranslationTestCase
14{
15    public static function FilterTheContent($theContent)
16    {
17        $gmtMysqlString = current_time('mysql', 1);
18       
19        $output = '<p>Current MySQL GMT date/time: ' . $gmtMysqlString . '</p>'
20            . '<p>mysql2date translate=false: ' . mysql2date('H:i:s', $gmtMysqlString, false) . '</p>'
21            . '<p>mysql2date translate=true: ' . mysql2date('H:i:s', $gmtMysqlString, true) . '</p>';
22           
23        return $output . $theContent;
24    }
25}
26
27?>