wp_get_theme_file
Read the contents of a specified file from the active WordPress theme, using a path relative to the theme directory. Requires edit_themes permission.
Instructions
Read one theme file (PHP/CSS/JS) from the ACTIVE theme.
file is a path RELATIVE to the theme directory, e.g. "functions.php" or
"css/custom.css". Absolute paths and ".." are refused. Defaults to the active
(child) theme; pass theme for a specific stylesheet directory. Requires the REST
transport, wp-ops-connect 1.4.0+, and an app password whose user has edit_themes.
Sites with DISALLOW_FILE_EDIT set refuse this by design.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| theme | No | ||
| install | Yes |