Skip to content

Commit

Permalink
WPCli start
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Jan 7, 2025
1 parent bd2fadf commit e04c7ee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MultisiteLanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,7 @@ function msls_get_query(): ?\lloc\Msls\MslsOptionsQuery {
}

lloc\Msls\MslsPlugin::init();
if ( defined( 'WP_CLI' ) && WP_CLI ) {
lloc\Msls\MslsCli::init();
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"require": {
"php": ">=7.4",
"composer/installers": "~2.3.0",
"wp-cli/wp-cli-bundle": "*",
"ext-json": "*"
},
"require-dev": {
Expand Down
14 changes: 14 additions & 0 deletions includes/MslsCli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace lloc\Msls;

class MslsCli {

public static function init(): void {
\WP_CLI::add_command( 'msls', array( __CLASS__, 'msls' ) );
}

public function msls( $args, $assoc_args ): void {
\WP_CLI::line( 'Hello, World!' );
}
}

0 comments on commit e04c7ee

Please sign in to comment.