Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Last active November 6, 2017 08:00
Show Gist options
  • Save barrykooij/88d653037c43ec933e12305c21662c3c to your computer and use it in GitHub Desktop.
Save barrykooij/88d653037c43ec933e12305c21662c3c to your computer and use it in GitHub Desktop.
function pc_show_parents_cb( $atts ) {
$atts = shortcode_atts( array(
'slug' => '',
'child' => '',
'link' => 'true'
), $atts, 'bartag' );
if( empty( $atts['slug'] ) ) {
return '';
}
if( empty ( $atts['child'] ) ) {
$atts['child'] = get_the_ID();
}
$plm = new SP_Premium_Post_Link_Manager();
ob_start();
$plm->generate_parents_list( $atts['slug'], $atts['child'], $atts['link'], false );
return ob_get_clean();
}
add_shortcode( 'pc_show_parents', 'pc_show_parents_cb' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment