<commit_before><?php
/**
 * CLI interface for the Polylang plugin.
 *
 * @author  <NAME> <<EMAIL>>
 * @package diggy/polylang-cli
 * @version 1.0.0-prealpha.1
 */

if ( defined( 'WP_CLI' ) && WP_CLI ) {

    if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
        return WP_CLI::error( sprintf( 'This WP-CLI package requires PHP version %s or higher.', '5.4' ) );
    }

    if ( version_compare( WP_CLI_VERSION, '0.24.0', '<' ) ) {
        return WP_CLI::error( sprintf( 'This WP-CLI package requires WP-CLI version %s or higher. Please visit %s', '0.24.0', 'http://wp-cli.org/#updating' ) );
    }

    require __DIR__ . '/vendor/autoload.php';

    // WP_CLI::add_command( 'pll',        Polylang_CLI\Cli::class );

    WP_CLI::add_command( 'pll api',       Polylang_CLI\Commands\Api::class );
    WP_CLI::add_command( 'pll cache',     Polylang_CLI\Commands\Cache::class );
    WP_CLI::add_command( 'pll doctor',    Polylang_CLI\Commands\Doctor::class );
    WP_CLI::add_command( 'pll flag',      Polylang_CLI\Commands\Flag::class );
    WP_CLI::add_command( 'pll lang',      Polylang_CLI\Commands\Lang::class );
    WP_CLI::add_command( 'pll option',    Polylang_CLI\Commands\Option::class );
    WP_CLI::add_command( 'pll post',      Polylang_CLI\Commands\Post::class );
    WP_CLI::add_command( 'pll post-type', Polylang_CLI\Commands\PostType::class );
    WP_CLI::add_command( 'pll taxonomy',  Polylang_CLI\Commands\Taxonomy::class );
    WP_CLI::add_command( 'pll term',      Polylang_CLI\Commands\Term::class );

}<commit_msg>register ghost post type 👻<commit_after><?php
/**
 * CLI interface for the Polylang plugin.
 *
 * @author  <NAME> <<EMAIL>>
 * @package diggy/polylang-cli
 * @version 1.0.0-prealpha.1
 */

if ( defined( 'WP_CLI' ) && WP_CLI ) {

    if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
        return WP_CLI::error( sprintf( 'This WP-CLI package requires PHP version %s or higher.', '5.4' ) );
    }

    if ( version_compare( WP_CLI_VERSION, '0.24.0', '<' ) ) {
        return WP_CLI::error( sprintf( 'This WP-CLI package requires WP-CLI version %s or higher. Please visit %s', '0.24.0', 'http://wp-cli.org/#updating' ) );
    }

    require __DIR__ . '/vendor/autoload.php';

    WP_CLI::add_hook( 'before_wp_load', function() {
        WP_CLI::add_wp_hook( 'init', function() {
            # make sure polylang_mo post type is always registered
            if ( ! post_type_exists( 'polylang_mo' ) ) {
                $labels = array( 'name' => __( 'Strings translations', 'polylang' ) );
                register_post_type( 'polylang_mo', array( 'labels' => $labels, 'rewrite' => false, 'query_var' => false, '_pll' => true ) );
            }
        });
    });

    // WP_CLI::add_command( 'pll',        Polylang_CLI\Cli::class );

    WP_CLI::add_command( 'pll api',       Polylang_CLI\Commands\Api::class );
    WP_CLI::add_command( 'pll cache',     Polylang_CLI\Commands\Cache::class );
    WP_CLI::add_command( 'pll doctor',    Polylang_CLI\Commands\Doctor::class );
    WP_CLI::add_command( 'pll flag',      Polylang_CLI\Commands\Flag::class );
    WP_CLI::add_command( 'pll lang',      Polylang_CLI\Commands\Lang::class );
    WP_CLI::add_command( 'pll option',    Polylang_CLI\Commands\Option::class );
    WP_CLI::add_command( 'pll post',      Polylang_CLI\Commands\Post::class );
    WP_CLI::add_command( 'pll post-type', Polylang_CLI\Commands\PostType::class );
    WP_CLI::add_command( 'pll taxonomy',  Polylang_CLI\Commands\Taxonomy::class );
    WP_CLI::add_command( 'pll term',      Polylang_CLI\Commands\Term::class );

}
{'fraction_non_alphanumeric': 0.16512992455993294, 'fraction_numerical': 0.008941044984632579, 'mean_word_length': 3.3552311435523112, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3979165', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1324, 'n_words': 242}