Support » Developing with WordPress » Error: ‘my_command’ is not a registered wp command. See ‘wp help’ for ava

  • Sébastien SERRE

    (@sebastienserre)


    Hello,

    I created a wp-cli command:

    class Tools extends WP_CLI_Command {
        public function convert_user_freelance() {
            // doing something
        }
    }
    new Tools;
    if ( class_exists( 'WP_CLI' ) ) {
    	WP_CLI::add_command( 'projeteur_convert', 'Tools' );
    }

    When I launch wp projeteur_convert convert_user_freelance on my local it’s working but in my host I have the msg:

    Error: 'projeteur_convert' is not a registered wp command. See 'wp help' for available commands.
    

    wp-cli 2.3.0 and PHP 7.3.8

    Do you know what’s wrong ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you have the “wp-cli” package also installed and running on your “live server”?

    It sounds like your live server is missing the package, as it needs to be installed separately (because it is not included within the standard WordPress releases).

    Hello,
    Yes it is and I don’t know why it’s working.
    Don’t you see an error in my code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.