Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Command::nested_line( $line, $change = false )
Output a line that’s appropriately nested
Contents
Source Source
File: libraries/lifterlms-cli/src/Commands/Restful/Command.php
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | private function nested_line( $line , $change = false ) { if ( 'add' == $change ) { $color = '%G' ; $label = '+ ' ; } elseif ( 'remove' == $change ) { $color = '%R' ; $label = '- ' ; } else { $color = false; $label = false; } $spaces = ( $this ->output_nesting_level * 2 ) + 2; if ( $color && $label ) { $line = \cli\Colors::colorize( "{$color}{$label}" ) . $line . \cli\Colors::colorize( '%n' ); $spaces = $spaces - 2; } \WP_CLI::line( str_pad ( ' ' , $spaces ) . $line ); } |
Expand full source code Collapse full source code View on GitHub