You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
Currently when running PHPCS checks in the admin, it will mention the file and line number that an issue occurs on. However, it could go further by adding a link to open that line of code in the plugin editor so that the user could fix the issue right there (such as if they are a developer).
We implemented this in the AMP plugin, so that when an AMP validation error occurs the user can jump to the responsible code. We also provide a filter so that the user's own IDE can be opened to the responsible line of code.
Thank you, @westonruter, for the report. Personally, I like the idea of adding the Plugin Editor link for issues. I would like to hear @felixarntz and @spacedmonkey's thoughts here.
@westonruter@mukeshpanchal27 I like that idea. How would we visually handle this? A new column on each result with the link, something like "View in code editor"?
One technical caveat I just want to ensure we keep in mind is that we'll have to make sure to only show those links/columns conditionally if the site is configured to support the Plugin Editor (which is disabled on many sites for e.g. security reasons).
Is your enhancement related to a problem? Please describe.
Currently when running PHPCS checks in the admin, it will mention the file and line number that an issue occurs on. However, it could go further by adding a link to open that line of code in the plugin editor so that the user could fix the issue right there (such as if they are a developer).
We implemented this in the AMP plugin, so that when an AMP validation error occurs the user can jump to the responsible code. We also provide a filter so that the user's own IDE can be opened to the responsible line of code.
Here's the logic for constructing the editor link: https://github.com/ampproject/amp-wp/blob/956c8d298764e4b22b936347d7c8b591b2fadfc2/includes/validation/class-amp-validation-error-taxonomy.php#L2356-L2473
Here's the logic for jumping to the line of code since core doesn't support that itself: https://github.com/ampproject/amp-wp/blob/956c8d298764e4b22b936347d7c8b591b2fadfc2/includes/validation/class-amp-validation-error-taxonomy.php#L1034-L1062
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: