Support » Plugin: Broken Link Checker » Show all Anchor Text linking to a URL

  • I wanted the feature of being able to see the anchor text for all links to a given page to make sure they were not all the same. I wrote the following patch:

    Replace the function in includes/admin/table-printer.php:

    function column_new_link_text($link, $instances) {
                if (empty($instances)) {
                    echo '<em>N/A</em>';
                } else {
                    // $instance = reset($instances); /** @var blcLinkInstance $instance */
                    // echo $instance->ui_get_link_text();
                    $instanceList = array();
                    foreach ($instances as $instance) {
                        $instanceList[] = $instance->ui_get_link_text();
                    usort($instanceList, 'strcasecmp');
                    foreach ($instanceList as $instance) {
                        echo '<span class="linkText">' . $instance . '</span>';

    And add a bit of CSS to css/links-page.css
    span.linkText {clear:both;display: block}

    Perhaps such functionality could be added to a future release.
    Or, maybe I’m barking up the wrong tree here and there is a simpler way to do it.

  • The topic ‘Show all Anchor Text linking to a URL’ is closed to new replies.