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
Called by
1 to 6 of 6
- bw_field_function_link() – Format the link (format=L)
- bw_links() – Display a list of links given the post IDs
- bw_list_id() – Display a link to a post in a list item
- bw_simple_list() – Display a "simple" list
- Tests_shortcodes_oik_parent::test_bw_post_link_numeric() – Tests the path where the link is numeric We use 0 as the ID so that the post doesn’t exist
- Tests_shortcodes_oik_parent::test_bw_post_link_numeric_bb_BB() – Tests the path where the link is numeric We use 0 as the ID so that the post doesn’t exist
Invoked by
Calls
1 to 4 of 4
