Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme Edits Grayed Out #1658

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

marcinkrzeminski
Copy link
Collaborator

@marcinkrzeminski marcinkrzeminski commented Dec 20, 2024

Fixes #1657

Use alternative hook to track the theme files updates in the Dashboard.

Checklist

  • Project documentation has been updated to reflect the changes in this pull request, if applicable.
  • I have tested the changes in the local development environment (see contributing.md).
  • I have added phpunit tests.

Release Changelog

  • Fix Theme files changes are tracked as expected

@marcinkrzeminski marcinkrzeminski changed the title Fix/1657 theme edits grayed out 1657 Theme Edits Grayed Out Dec 20, 2024
@marcinkrzeminski marcinkrzeminski changed the title 1657 Theme Edits Grayed Out Theme Edits Grayed Out Dec 20, 2024
Copy link
Contributor

@tharsheblows tharsheblows left a comment

Choose a reason for hiding this comment

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

A couple of comments but this looks good. I looked it up and the ajax method was added in 4.9 so I think we're safe? It will still work with < WP 4.9 but won't record the changes.

Should we add a "Requires at least" header? I'm not really sure which version that would be though.

$this->edited_file = $this->get_plugin_data( $plugin_slug );
}

$this->log_changes( $location );
Copy link
Contributor

Choose a reason for hiding this comment

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

❓question
If there's no $location here, should we log anything? I don't think so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed that.

) {
$action = wp_stream_filter_input( INPUT_POST, 'action' );
$request_method = wp_stream_filter_input( INPUT_SERVER, 'REQUEST_METHOD' );

Copy link
Contributor

Choose a reason for hiding this comment

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

❗️issue
Can you add a nonce and capability check here? I think it can be the same capability check as is required to do the action.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed that as well.

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.

Theme Edits Grayed Out
2 participants