Skip to content

fix: remove unnecessary parameter from update_option for new attachments#1905

Open
shreyasikhar wants to merge 1 commit into
developfrom
fix/php-linter-errors
Open

fix: remove unnecessary parameter from update_option for new attachments#1905
shreyasikhar wants to merge 1 commit into
developfrom
fix/php-linter-errors

Conversation

@shreyasikhar
Copy link
Copy Markdown
Member

@shreyasikhar shreyasikhar commented May 28, 2026

Summary

This pull request updates the way the update_option function is called for the rtgodam_new_attachment option throughout the codebase. The main change is the removal of an unnecessary empty string argument, aligning the function usage with WordPress standards and improving code clarity.

Refactoring of update_option usage:

  • Replaced update_option( 'rtgodam_new_attachment', $data, '', true ) with update_option( 'rtgodam_new_attachment', $data, true ) in three locations:
    • In class-rtgodam-transcoder-rest-routes.php within the handle_callback method
    • In class-media-tracker.php within the track_new_attachment method
    • In class-media-tracker.php within the check_new_attachment_transcoding_status method

Issue

#1904

@shreyasikhar shreyasikhar self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 08:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the plugin’s usage of the WordPress core update_option() API for the rtgodam_new_attachment option by removing an extra (invalid) parameter, bringing the calls in line with the function’s expected signature and avoiding “too many arguments” warnings in newer PHP versions.

Changes:

  • Refactors three update_option( 'rtgodam_new_attachment', ..., '', true ) calls to update_option( 'rtgodam_new_attachment', ..., true ).
  • Keeps the intended autoload behavior explicit via the third $autoload argument.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
inc/classes/class-media-tracker.php Updates two update_option() calls related to tracking and updating new attachment transcoding status.
admin/class-rtgodam-transcoder-rest-routes.php Updates the callback handler’s update_option() call when marking the latest attachment transcoding status as successful.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shreyasikhar shreyasikhar requested a review from subodhr258 May 28, 2026 08:53
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.

2 participants