You appear to be a bot. Output may be restricted
Description
Display a link to the post->parentNow the question on everyone's mind is – which $post ID do we get when we're working on nested shortcodes?
Usage
$string = bw_parent( $atts, $content, $tag );
Parameters
- $atts
- ( array ) optional – shortcode parameters
- $content
- ( string ) optional – shortcode content – not expected
- $tag
- ( string ) optional – shortcode
Returns
string generated HTMLSource
File name: oik/shortcodes/oik-parent.phpLines:
1 to 13 of 13
function bw_parent( $atts=null, $content=null, $tag=null ) { $post = null; $id = bw_array_get( $atts, "id", null ); if ( $id ) { $post = get_post( $id ); } else { $post = get_post(); } if ( $post && $post->post_parent ) { bw_post_link( $post->post_parent, "bw_parent" ); } return bw_ret(); }View on GitHub View on Trac