Making WordPress.org

Changeset 14191


Ignore:
Timestamp:
11/21/2024 10:05:04 PM (2 months ago)
Author:
coffee2code
Message:

Photo Directory, CLI: Add --force option to init command to allow bypassing confirmation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/cli.php

    r11679 r14191  
    1919     * - Taxonomy terms (categories, colors, orientations)
    2020     *
     21     * ## OPTIONS
     22     *
     23     * [--force]
     24     * : Start initialize without prompting for confirmation.
     25     *
    2126     * ## EXAMPLES
    2227     *
     
    2732     */
    2833    public function init( $args, $assoc_args ) {
    29         WP_CLI::confirm( 'Continue with site initialization (to include creation of pages, taxonomy terms, and more)?' );
     34        $force = $assoc_args['force'] ?? false;
     35
     36        if ( ! $force ) {
     37            WP_CLI::confirm( 'Continue with site initialization (to include creation of pages, taxonomy terms, and more)?' );
     38        }
    3039
    3140        // Create pages.
Note: See TracChangeset for help on using the changeset viewer.