Making WordPress.org


Ignore:
Timestamp:
10/14/2020 04:42:56 PM (5 years ago)
Author:
ocean90
Message:

Translate: Define a version for Twenty Twenty-One which isn't in the directory yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php

    r10360 r10377  
    4747        add_filter( 'gp_translation_prepare_for_save', array( $this, 'apply_capital_P_dangit' ), 10, 2 );
    4848        add_filter( 'gp_original_extracted_comments', array( $this, 'format_translator_commments' ), 15 );
     49        add_filter( 'wporg_translate_language_pack_theme_args', array( $this, 'set_version_for_default_themes_in_development' ), 10, 2 );
    4950
    5051        // Cron.
     
    6970            $this->register_cli_commands();
    7071        }
     72    }
     73
     74    /**
     75     * Defines a version for WordPress default themes which are still in development.
     76     *
     77     * @param array  $args WP-CLI arguments.
     78     * @param string $slug Slug of a theme.
     79     * @return array Filtered WP-CLI arguments.
     80     */
     81    public function set_version_for_default_themes_in_development(  $args, $slug ) {
     82        if ( 'twentytwentyone' !== $slug || ! empty( $args['version'] ) ) {
     83            return $args;
     84        }
     85
     86        $args['version'] = '1.0';
     87
     88        return $args;
    7189    }
    7290
Note: See TracChangeset for help on using the changeset viewer.