diff --git a/includes/class-gf-cli-form.php b/includes/class-gf-cli-form.php index e743446..05cbfe4 100644 --- a/includes/class-gf-cli-form.php +++ b/includes/class-gf-cli-form.php @@ -113,12 +113,15 @@ function form_list( $args, $assoc_args ) { * [--porcelain] * : Overrides the standard success message with just the export file path * + * [--filename=] + * : The filename for the form to export. Defaults to the current date. + * * ## EXAMPLES * * wp gf form export 1 * wp gf form export * - * @synopsis [] [--dir=] [--porcelain] + * @synopsis [] [--dir=] [--porcelain] [--filename=] */ function export( $args, $assoc_args ) { @@ -138,7 +141,11 @@ function export( $args, $assoc_args ) { $forms_json = json_encode( $forms ); // Set the filename of the export - $filename = 'gravityforms-export-' . date( 'Y-m-d' ) . '.json'; + if ( isset( $assoc_args['filename'] ) ) { + $filename = $assoc_args['filename']; + } else { + $filename = 'gravityforms-export-' . date( 'Y-m-d' ) . '.json'; + } // If the export directory is set if ( isset( $assoc_args['dir'] ) ) {