Skip to content

Photo Directory: Fix the minutes in rejection times - #1100

Open
ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/photo-rejection-time-format
Open

ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/photo-rejection-time-format

Conversation

@ekamran

@ekamran ekamran commented Oct 24, 2026 •

Copy link
Copy Markdown

The time a photo was rejected shows the wrong minutes in both places the admin shows it.

  • The "Rejected on" column on the rejected photos list uses the default format of get_rejection_date(), Y/m/d g:s a. s is seconds, so a photo rejected at 09:07:45 shows 2026/10/24 9:45 am.
  • The "Rejected on" line in the edit screen's publish box uses Y-m-d H:m:s. m is the month, so the same photo shows 2026-10-24 09:10:45.

Both formats came in with the plugin's first public commit, r11679.

This changes s to i in the first format and m to i in the second, and updates the docblock default. Each place keeps its own format otherwise.

Testing

In a local WordPress trunk site, I loaded the plugin's registrations.php and rejection.php, created a rejected photo, set its rejected_on meta, and captured the output of custom_rejection_columns() and show_rejection_info():

Stored rejected_on List column, before List column, after Publish box, before Publish box, after
2026-10-24 09:07:45 2026/10/24 9:45 am 2026/10/24 9:07 am 2026-10-24 09:10:45 2026-10-24 09:07:45
2026-03-05 21:04:58 2026/03/05 9:58 pm 2026/03/05 9:04 pm 2026-03-05 21:03:58 2026-03-05 21:04:58
  • The results are the same with the site timezone set to UTC and to Asia/Kolkata. log_rejection() stores current_time( 'mysql' ), and mysql2date() reads and formats it in the same site timezone, so the time shown is the stored local time.
  • After a real log_rejection() call, both places show the stored time.
  • With no stored date, the output is unchanged.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Finding the bug while reading the plugin, the local tests, and the wording of this description. I reviewed the change and the results, and I take responsibility for the contribution.

Summary by CodeRabbit

  • Bug Fixes
    • Rejection dates now display minutes instead of seconds by default.
    • Rejection information now displays the correct 24-hour time, including minutes and seconds.

The rejected photos list used `g:s` (seconds) and the publish box used `H:m` (month) where the minutes belong. Both now use `i`.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props ekamran.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1a5fd527-eaf4-4408-86bb-00da1d85d2e6
Commits

Reviewing files that changed from the base of the PR and between b2f125f and f1319c0.

Files selected for processing: 1
  • wordpress.org/public_html/wp-content/plugins/photo-directory/inc/rejection.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The rejection date default format now uses minutes instead of seconds. The rejection information display format now uses minutes instead of the month field.

Changes: Rejection date formats

Layer / File(s) Summary
Correct rejection date format tokens
wordpress.org/public_html/wp-content/plugins/photo-directory/inc/rejection.php
The default format changes from g:s a to g:i a. The display format changes from H:m:s to H:i:s.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: coffee2code, obenland

Merge Risk: Minimal · up to f1319

The PR corrects the rejection-time displays without introducing an identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: correcting minute formatting in rejection times.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant