WC_Post_Types::wp_cli_skips_active_theme
Determine whether WP-CLI skipped the active theme.
Method of the class: WC_Post_Types{}
No Hooks.
Returns
bool.
Usage
$result = WC_Post_Types::wp_cli_skips_active_theme(): bool;
WC_Post_Types::wp_cli_skips_active_theme() WC Post Types::wp cli skips active theme code WC 11.1.2
private static function wp_cli_skips_active_theme(): bool {
$get_wp_cli_config = array( 'WP_CLI', 'get_config' );
if ( ! ( defined( 'WP_CLI' ) && WP_CLI ) || ! is_callable( $get_wp_cli_config ) ) {
return false;
}
$skipped_themes = $get_wp_cli_config( 'skip-themes' );
if ( true === $skipped_themes ) {
return true;
}
if ( ! is_array( $skipped_themes ) ) {
$skipped_themes = explode( ',', (string) $skipped_themes );
}
return in_array( get_stylesheet(), $skipped_themes, true );
}