Skip to content

[website] Add filebrowser query API to open specific files and lines in Playground #3612

@fellyph

Description

@fellyph

During Contributor Day, I noticed that one of the key workflow items for PCP is the issues checker, which lists detected problems and points to the related file and line number.

It would be useful for WordPress Playground to support a small query API for the file browser, allowing external tools to open the editor directly at a specific file, and optionally at a specific line. This would make issue review and debugging workflows faster, especially for tools that already know the relevant file path and line number.

Proposed behavior

Open Playground with the file browser enabled:

https://playground.wordpress.net/?filebrowser

Open Playground with the file browser focused on a specific file:

https://playground.wordpress.net/?filebrowser=wp-content/plugins/my-plugin/index.php

Open Playground with the file browser focused on a specific file and line:

https://playground.wordpress.net/?filebrowser=wp-content/plugins/my-plugin/index.php:20

Use cases

This could be used by:

  • PCP issue checker workflows, where each issue already includes a file and line number.
  • Plugin and theme support, to share direct links to relevant source files.
  • WordPress Core debugging and reproduction workflows.
  • Documentation, tutorials, and bug reports that need to point users to specific files inside a Playground instance.

Expected outcome

When a filebrowser query parameter is present, Playground should open the file browser. If the parameter contains a path, the editor should open that file. If the path also includes a line number suffix, the editor should highlight or scroll to that line.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions