'date_i18n( get_option( \'date_format\' ) )', '/[^get_]the_date\(\s?["|\'][A-Za-z\s]+\s?["|\']\)/' => 'the_date( get_option( \'date_format\' ) )', '/[^get_]the_time\(\s?["|\'][A-Za-z\s]+\s?["|\']\)/' => 'the_time( get_option( \'date_format\' ) )' ); foreach ( $php_files as $php_key => $phpfile ) { foreach ( $checks as $key => $check ) { checkcount(); if ( preg_match( $key, $phpfile, $matches ) ) { $filename = tc_filename( $php_key ); $matches[0] = str_replace(array('"',"'"),'', $matches[0]); $error = trim( esc_html( rtrim( $matches[0], '(' ) ) ); $this->error[] = sprintf( '' . __( 'INFO', 'theme-check' ) . ': ' . __( 'At least one hard coded date was found in the file %1$s. Consider %2$s instead.', 'theme-check' ), '' . $filename . '', "get_option( 'date_format' )" ); } } } return $ret; } function getError() { return $this->error; } } $themechecks[] = new Time_Date;