You appear to be a bot. Output may be restricted
Description
Display a link to a postNote: get_the_title() may invoke shortcodes so we need to call bw_push() and bw_pop() If the $link is an integer then we format the link ourselves otherwise just bung it out.
Usage
bw_post_link( $link, $class );
Parameters
- $link
- ( ID/string ) optional – post_ID OR the actual link
- $class
- ( string ) optional default: bw_post – list of classes to apply to the link
Returns
voidSource
File name: oik/shortcodes/oik-parent.phpLines:
1 to 13 of 13
function bw_post_link( $link=null, $class="bw_post" ) { if ( is_numeric( $link ) ) { $url = get_permalink( $link ); bw_push(); $title = get_the_title( $link ); bw_pop(); if ( empty( $title ) ) { $title = sprintf( __( 'Post: %1$s', "oik" ) , $link ); } $link = retlink( $class, $url, $title, null, "id-$link" ); } e( $link ); }View on GitHub View on Trac