Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generate:settings:page] New Command #32

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/services/wp-console/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ services:
console.generate_cron_single:
class: WP\Console\Command\Generate\CronSingleCommand
arguments: ['@console.cron_base_generator', '@console.extension_manager', '@console.validator', '@console.string_converter']
tags:
- { name: wordpress.command }
console.generate_settings_page:
class: WP\Console\Command\Generate\SettingsPageCommand
arguments: ['@console.settings_page_generator', '@console.extension_manager', '@console.validator', '@console.string_converter', '@console.wordpress_api']
tags:
- { name: wordpress.command }
5 changes: 5 additions & 0 deletions config/services/wp-console/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@ services:
console.cron_base_generator:
class: WP\Console\Generator\CronBaseGenerator
arguments: ['@console.extension_manager']
tags:
- { name: wordpress.generator }
console.settings_page_generator:
class: WP\Console\Generator\SettingsPageGenerator
arguments: ['@console.extension_manager']
tags:
- { name: wordpress.generator }
49 changes: 49 additions & 0 deletions config/translations/en/generate.settings.page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
description: 'Generate a new custom settings page.'
help: 'The <info>generate:settings:page</info> command helps you generates a new Settings page.'
welcome: 'Welcome to the Wordpress Settings page generator'
options:
plugin: 'The Plugin name.'
class-name: 'The settings page function name'
setting-group: 'Name of the settings group used in register_setting'
setting-name: 'Name of the options saved in the database.'
page-title: 'Setting Page title'
menu-title: 'Admin sidebar menu title.'
capability: 'Access permission.'
slug: 'Unique slug for the admin page'
callback-function: 'The name of the layout function.'
section-field: 'Section to add fields.'
fields: 'Setting Page fields.'
text-domain: 'Translations file.'
questions:
plugin: 'The plugin name'
class-name: 'Enter settings page class name'
setting-group: 'Enter the name of the settings group used in register_setting'
setting-name: 'Enter the name of the options saved in the database'
page-title: 'Enter the setting Page title'
menu-title: 'Enter the admin sidebar menu title'
capability: 'Choice the capability to give access permission'
slug: 'Enter the slug for the admin page'
callback-function: 'Enter the name of the layout function'
section-add: 'Do you want add section to fields'
section-name: 'Enter the name to the new section'
section-add-another: 'Do you want to add another section'
fields:
fields-add: 'Do you want to generate the fields'
type: 'Enter field type'
id: 'Enter field id'
label: 'Enter field label'
description: 'Enter field description'
placeholder: 'Enter field placeholder'
default-value: 'Enter field default value'
src_image: 'Enter the image path'
section-id: 'Choice the section to add the field'
fields-add-another: 'Do you want to add another field'
multiple-label: 'Enter the label for option for '
multiple-value: 'Enter the value for option for '
multiple-options-add: 'Do you want to add another option for '
text-domain: 'Enter the text-domain to translation file'
warnings:
plugin-unavailable: 'Warning The following plugin are not already available in your local environment "%s"'
errors:
directory-exists: 'The target directory "%s" is not empty.'
interval-invalid: 'The interval must be a number'
Loading