Skip to content

Commit afdbff3

Browse files
authored
Merge pull request #408 from ernilambar/406-fix-activate-multiple-themes
2 parents fbd4222 + 3ee76ca commit afdbff3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

features/theme-install.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,10 @@ Feature: Install WordPress themes
105105
Success: Switched to 'Twenty Twelve' theme.
106106
Success: Theme already installed.
107107
"""
108+
109+
Scenario: Installation of multiple themes with activate
110+
When I try `wp theme install twentytwelve twentyeleven --activate`
111+
Then STDERR should contain:
112+
"""
113+
Warning: Only a single theme can be active.
114+
"""

src/Theme_Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ protected function filter_item_list( $items, $args ) {
488488
* $ wp theme install http://s3.amazonaws.com/bucketname/my-theme.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
489489
*/
490490
public function install( $args, $assoc_args ) {
491+
if ( count( $args ) > 1 && Utils\get_flag_value( $assoc_args, 'activate', false ) ) {
492+
WP_CLI::warning( 'Only a single theme can be active.' );
493+
}
491494

492495
$theme_root = get_theme_root();
493496
if ( $theme_root && ! is_dir( $theme_root ) ) {

0 commit comments

Comments
 (0)