CreateTemplate
class CreateTemplate
Processes the wp gpdf create-template
WP CLI Command
Methods
__construct(string $workingDirectory, object $cli)
No description
__invoke(array $templateArray, array $args = [])
Generates a PDF template in the PDF Working Directory
Details
at line 64
__construct(string $workingDirectory, object $cli)
at line 110
__invoke(array $templateArray, array $args = [])
Generates a PDF template in the PDF Working Directory
OPTIONS
- The name of the PDF template you'd like to create.
- [--enable-config]
- When included, a configuration file will be created alongside your template
- [--enable-toolkit]
- When included, the Dev Toolkit classes will be injected into your PDF template and the sandbox disabled.
- [--skip-headers]
- When included, we will not ask you any additional questions about the PDF template.
EXAMPLES
# Create a PDF template called 'my-custom-template.php'
$ wp gpdf create-template "My Custom Template"
# Create a PDF template called 'my-custom-template.php', as well as an associated config file '/config/my-custom-template.php'
$ wp gpdf create-template "My Custom Template" --enable-config
# Create a PDF template called 'my-custom-template.php' using the Toolkit
$ wp gpdf create-template "My Custom Template" --enable-toolkit
# Create a PDF template called 'my-custom-template.php' using the Toolkit, as well as an associated config file '/config/my-custom-template.php'
$ wp gpdf create-template "My Custom Template" --enable-config --enable-toolkit
# Create a PDF template called 'my-custom-template.php' without asking any additional questions about the template
$ wp gpdf create-template "My Custom Template" --skip-headers