false,
'alignclass' => '',
'format' => 'card',
'style' => 'style1',
'showcontent' => 'true'
), $atts));
$id = intval($id);
$class = pirate_crew_sanitize_shortcodeclass($alignclass);
$format = pirate_crew_sanitize_shortcodeformat($format);
$style = pirate_crew_sanitize_shortcodestyle($style);
$post = get_post($id);
if ($post && $post->post_type == 'pirate_crew_member') {
$flip = false;
$flipclass = array("picrew-figcaption");
if ($format == 'list') {
$class = 'list';
}
$out .= '
';
$styleclass = '';
if ($format == 'list') {
if ($style == 'style2') {
$styleclass= 'style-2';
} else {
$styleclass= 'style-1';
}
$out .= '
';
} else {
if ($style == 'style4') {
$styleclass= 'style-4';
} elseif ($style == 'style3') {
$styleclass= 'style-3';
} elseif ($style == 'style2') {
$styleclass= 'style-2';
} else {
$styleclass= 'style-1';
}
$out .= '
';
}
$teamdata = $this->get_options('pirate_crew_member', $post->ID);
$out .= '
';
$out .= '
';
$out .= '
';
$out .= '';
$out .= '';
$out .= '
'.get_the_title($post->ID).'
';
$out .= '
'.$teamdata['pirate-crew-designation'].'
';
$out .= '
';
$out .= ' ';
$out .= '';
if (($format == 'list')&& ($showcontent == true)) {
if ($post->post_content) {
$content = apply_filters( 'the_content', $post->post_content );
$content = str_replace( ']]>', ']]>', $content );
$out .=$content;
}
}
$out .= '';
$out .= '
';
$out .= '
';
wp_reset_postdata();
return $out;
} else {
$out = '
' . __('Pirate not found', 'pirate-crew') . '
';
}