ID) )
$id = $post->ID;
else
$id = 0;
return $id;
}
function aleanta_checkAvailableJsToPage($types){
foreach($types as $type){
if (function_exists('is_product') && is_product() && $type == 'product'){
return true;
}
}
return false;
}
function aleanta_get_staticblock_content($blockId){
if (is_array($blockId)){
// SORT ORDER
// Prepare sortable array
$_blocks = array();
foreach($blockId as $bId){
if ($bId == 'global'){
$bId = aleanta_get_option('footer_block');
}
$_block = get_post($bId);
$_blocks[$_block->menu_order][] = $_block;
}
foreach ($_blocks as $blockMenuOrder){
foreach($blockMenuOrder as $block) {
$shortcodes_custom_css = get_post_meta($block->ID, '_wpb_shortcodes_custom_css', true);
if (!empty($shortcodes_custom_css)) {
echo '
';
}
if(in_array(get_post_type(get_the_ID()), array( 'forum', 'topic' ))){
echo pix_display_format($block->post_content);
} else {
echo apply_filters('the_content', wp_kses_post($block->post_content));
}
}
}
}else{
if ($blockId == 'global'){
return '';
}
$block = get_post($blockId);
$shortcodes_custom_css = get_post_meta( $blockId, '_wpb_shortcodes_custom_css', true );
if ( ! empty( $shortcodes_custom_css ) ) {
echo '
';
}
if(in_array(get_post_type(get_the_ID()), array( 'forum', 'topic' ))){
echo pix_display_format($block->post_content);
} else {
echo apply_filters('the_content', wp_kses_post($block->post_content));
}
}
}
function aleanta_get_staticblock_option_array(){
$args = array(
'post_type' => 'staticblocks',
'post_status' => 'publish',
);
$staticBlocks = array();
$staticBlocks[] = 'Select block';
$staticBlocksData = get_posts( $args );
foreach($staticBlocksData as $_block){
$staticBlocks[$_block->ID] = $_block->post_title;
}
return $staticBlocks;
}
?>