Text_Diff_Engine_shell::_getLines

Advertisement

Private Access Private Access

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.

Summery Summery

Get lines from either the old or new text

Syntax Syntax

Text_Diff_Engine_shell::_getLines( array $text_lines, int $line_no, int $end = false )

Parameters Parameters

$text_lines

(array) (Required) Either $from_lines or $to_lines (passed by reference).

$line_no

(int) (Required) Current line number (passed by reference).

$end

(int) (Optional) end line, when we want to chop more than one line.

Default value: false

Return Return

(array) The chopped lines

Source Source

File: wp-includes/Text/Diff/Engine/shell.php

    function _getLines(&$text_lines, &$line_no, $end = false)
    {
        if (!empty($end)) {
            $lines = array();
            // We can shift even more
            while ($line_no <= $end) {
                array_push($lines, array_shift($text_lines));
                $line_no++;
            }
        } else {
            $lines = array(array_shift($text_lines));
            $line_no++;
        }

        return $lines;
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.