મુખ્ય સામગ્રીને બાયપાસ કરો

WriteFilesStep <DirectoryResource>

Writes multiple files to a specified directory in the Playground filesystem.

my-plugin/
├── index.php
└── public/
└── style.css
@hasRunnableExample
@landingPage

/test.php

@example
<code>
{
"step": "writeFiles",
"writeToPath": "/wordpress/wp-content/plugins/my-plugin",
"filesTree": {
"name": "my-plugin",
"files": {
"index.php": "<?php echo '<a>Hello World!</a>'; ?>",
"public": {
"style.css": "a { color: red; }"
}
}
}
}
</code>

Index

Properties

filesTree

filesTree: DirectoryResource | (Directory & { resource?: literal:directory })

The 'filesTree' defines the directory structure. Inline directories can provide 'name' and 'files' without a 'resource' property. Explicit 'literal:directory' and 'git:directory' resources are also supported. The 'name' represents the root directory, while 'files' maps file paths to contents or nested subdirectories.

step

step: writeFiles

writeToPath

writeToPath: string

The path of the file to write to

Page Options