Last active
November 6, 2017 08:00
-
-
Save barrykooij/88d653037c43ec933e12305c21662c3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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