File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,15 @@ function form_list( $args, $assoc_args ) {
113113 * [--porcelain]
114114 * : Overrides the standard success message with just the export file path
115115 *
116+ * [--filename=<filename>]
117+ * : The filename for the form to export. Defaults to the current date.
118+ *
116119 * ## EXAMPLES
117120 *
118121 * wp gf form export 1
119122 * wp gf form export
120123 *
121- * @synopsis [<form-id>] [--dir=<dir>] [--porcelain]
124+ * @synopsis [<form-id>] [--dir=<dir>] [--porcelain] [--filename=<filename>]
122125 */
123126 function export ( $ args , $ assoc_args ) {
124127
@@ -138,7 +141,11 @@ function export( $args, $assoc_args ) {
138141 $ forms_json = json_encode ( $ forms );
139142
140143 // Set the filename of the export
141- $ filename = 'gravityforms-export- ' . date ( 'Y-m-d ' ) . '.json ' ;
144+ if ( isset ( $ assoc_args ['filename ' ] ) ) {
145+ $ filename = $ assoc_args ['filename ' ];
146+ } else {
147+ $ filename = 'gravityforms-export- ' . date ( 'Y-m-d ' ) . '.json ' ;
148+ }
142149
143150 // If the export directory is set
144151 if ( isset ( $ assoc_args ['dir ' ] ) ) {
You can’t perform that action at this time.
0 commit comments