Making WordPress.org

Changeset 4325


Ignore:
Timestamp:
11/03/2016 10:10:35 AM (8 years ago)
Author:
ocean90
Message:

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

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc
Files:
2 edited

Legend:

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

    r3953 r4325  
    4343        add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
    4444        add_filter( 'body_class', array( $this, 'wporg_add_make_site_body_class' ) );
     45        add_filter( 'wporg_translate_language_pack_theme_args', array( $this, 'set_version_for_twentyseventeen_language_pack' ), 10, 2 );
    4546
    4647        // Load the API endpoints.
     
    5051            $this->register_cli_commands();
    5152        }
     53    }
     54
     55    /**
     56     * Defines a version for Twenty Seventeen which isn't in the directory yet.
     57     *
     58     * @param array  $args WP-CLI arguments.
     59     * @param string $slug Slug of a theme.
     60     * @return array Filtered WP-CLI arguments.
     61     */
     62    public function set_version_for_twentyseventeen_language_pack( $args, $slug ) {
     63        if ( 'twentyseventeen' !== $slug || ! empty( $args['version'] ) ) {
     64            return $args;
     65        }
     66
     67        $args['version'] = '1.0';
     68
     69        return $args;
    5270    }
    5371
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php

    r4013 r4325  
    8888        }
    8989
     90        /**
     91         * Filters the arguments passed to the WP-CLI command.
     92         *
     93         * @param array  $args CLI arguments.
     94         * @param string $slug Slug of the theme.
     95         */
     96        $args = apply_filters( 'wporg_translate_language_pack_plugin_args', $args, $slug );
     97
    9098        if ( $args['locale'] ) {
    9199            $translation_sets = wp_list_filter( $translation_sets, [
     
    149157            WP_CLI::error( 'No translation sets available.' );
    150158        }
     159
     160        /**
     161         * Filters the arguments passed to the WP-CLI command.
     162         *
     163         * @param array  $args CLI arguments.
     164         * @param string $slug Slug of the theme.
     165         */
     166        $args = apply_filters( 'wporg_translate_language_pack_theme_args', $args, $slug );
    151167
    152168        if ( $args['locale'] ) {
Note: See TracChangeset for help on using the changeset viewer.