WordPress at a glance
function is not described

Text_Diff::countAddedLines() public WP 1.1.0

returns the number of new (added) lines in a given diff.

{} It's a method of the class: Text_Diff{}

No Hooks.


Int. The number of new lines


$Text_Diff = new Text_Diff();


Since 1.1.0 Introduced.
Since Text_Diff 1.1.0

Code of Text_Diff::countAddedLines() WP 5.7.2

function countAddedLines()
    $count = 0;
    foreach ($this->_edits as $edit) {
        if (is_a($edit, 'Text_Diff_Op_add') ||
            is_a($edit, 'Text_Diff_Op_change')) {
            $count += $edit->nfinal();
    return $count;