Skip to content

Commit 99c7380

Browse files
committed
Add new --ignore-requirements arg
Per code review, also offer --ignore-requirements as a way to install themes and plugins that don't meet the listed requirements
1 parent fcae1a0 commit 99c7380

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Plugin_Command.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ protected function install_from_repo( $slug, $assoc_args ) {
593593
return $api;
594594
}
595595

596-
if ( isset( $assoc_args['version'] ) ) {
596+
if ( isset( $assoc_args['version'] ) || isset( $assoc_args['ignore-requirements'] ) ) {
597597
self::alter_api_response( $api, $assoc_args['version'] );
598598
} else {
599599
$requires_php = isset( $api->requires_php ) ? $api->requires_php : null;
@@ -915,6 +915,9 @@ protected function filter_item_list( $items, $args ) {
915915
* : If set, the command will overwrite any installed version of the plugin, without prompting
916916
* for confirmation.
917917
*
918+
* [--ignore-requirements]
919+
* :If set, the command will install the plugin while ignoring any requirements specified by the plugin authors.
920+
*
918921
* [--activate]
919922
* : If set, the plugin will be activated immediately after install.
920923
*

src/Theme_Command.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ protected function install_from_repo( $slug, $assoc_args ) {
406406
return $api;
407407
}
408408

409-
if ( isset( $assoc_args['version'] ) ) {
409+
if ( isset( $assoc_args['version'] ) || isset( $assoc_args['ignore-requirements'] ) ) {
410410
self::alter_api_response( $api, $assoc_args['version'] );
411411
} else {
412412
$requires_php = isset( $api->requires_php ) ? $api->requires_php : null;
@@ -481,6 +481,9 @@ protected function filter_item_list( $items, $args ) {
481481
* : If set, the command will overwrite any installed version of the theme, without prompting
482482
* for confirmation.
483483
*
484+
* [--ignore-requirements]
485+
* : If set, the command will install the theme while ignoring any requirements specified by the theme authors.
486+
*
484487
* [--activate]
485488
* : If set, the theme will be activated immediately after install.
486489
*

0 commit comments

Comments
 (0)