Skip to content

Method

Render the links.

render_links( )

public

Return

string The links markup.

Source

public function render_links() {

    $links = $this->get_links();
    if ( ! $links ) {
        return;
    }

    $output = '<ul class="tml-links">';

    foreach ( $links as $name => $link ) {
        $output .= sprintf(
            '<li class="tml-%s-link"><a href="%s">%s</a></li>',
            esc_attr( $name ),
            esc_url( $link['url'] ),
            esc_html( $link['text'] )
        );
    }

    $output .= '</ul>';

    return $output;
}

Uses

Used by

Changelog

VersionDescription
7.0 Introduced.