WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/11/2017 02:28:59 PM (4 years ago)
Author:
afercia
Message:

Allow usage of aria-current in paginate_links().

The aria-current attribute is a simple, effective way to help assistive
technology users orientate themselves within a list of items.

Props GrahamArmfield, palmiak.
Fixes #40833.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/paginateLinks.php

    r34802 r41371  
    1717
    1818        $expected =<<<EXPECTED
    19 <span class='page-numbers current'>1</span>
     19<span aria-current='page' class='page-numbers current'>1</span>
    2020<a class='page-numbers' href='$page2'>2</a>
    2121<a class='page-numbers' href='$page3'>3</a>
     
    3535
    3636        $expected =<<<EXPECTED
    37 <span class='page-numbers current'>1</span>
     37<span aria-current='page' class='page-numbers current'>1</span>
    3838<a class='page-numbers' href='$page2'>2</a>
    3939<a class='page-numbers' href='$page3'>3</a>
     
    5555        $expected =<<<EXPECTED
    5656<a class='page-numbers' href='$home'>1</a>
    57 <span class='page-numbers current'>2</span>
     57<span aria-current='page' class='page-numbers current'>2</span>
    5858<a class='page-numbers' href='$page3'>3</a>
    5959<a class='page-numbers' href='$page4'>4</a>
     
    7575<a class="prev page-numbers" href="$home">&laquo; Previous</a>
    7676<a class='page-numbers' href='$home'>1</a>
    77 <span class='page-numbers current'>2</span>
     77<span aria-current='page' class='page-numbers current'>2</span>
    7878<a class='page-numbers' href='$page3'>3</a>
    7979<a class='page-numbers' href='$page4'>4</a>
     
    300300        ) );
    301301
    302         $this->assertContains( "<span class='page-numbers current'>3</span>", $links );
     302        $this->assertContains( "<span aria-current='page' class='page-numbers current'>3</span>", $links );
    303303    }
    304304
Note: See TracChangeset for help on using the changeset viewer.