screen->get_prefix(); $has_comments = blocksy_get_theme_mod($prefix . '_has_comments', 'yes'); if ($has_comments === 'yes') { return comments_open() || get_comments_number(); } return false; } } if (! function_exists('blocksy_display_page_elements')) { function blocksy_display_page_elements($location = null) { $prefix = blocksy_manager()->screen->get_prefix(); $has_related_posts = blocksy_get_theme_mod( $prefix . '_has_related_posts', 'no' ) === 'yes' && ( blocksy_default_akg( 'disable_related_posts', blocksy_get_post_options(), 'no' ) !== 'yes' ); $has_comments = blocksy_get_theme_mod($prefix . '_has_comments', 'yes'); $related_posts_location = blocksy_get_theme_mod( $prefix . '_related_posts_containment', 'separated' ); $comments_location = null; if ($has_comments === 'yes') { $comments_location = blocksy_get_theme_mod( $prefix . '_comments_containment', 'separated' ); } ob_start(); if ($has_related_posts && $related_posts_location === $location) { do_action('blocksy:single:related_posts:before'); blocksy_related_posts($location); do_action('blocksy:single:related_posts:after'); } $related_posts_output = ob_get_clean(); if ( ( blocksy_get_theme_mod($prefix . '_related_location', 'before') === 'before' || $comments_location !== $related_posts_location ) && $has_related_posts && $related_posts_location === $location ) { /** * Note to code reviewers: This line doesn't need to be escaped. * The var $related_posts_output used here escapes the value properly. */ echo $related_posts_output; } $container_class = 'ct-container'; if ( blocksy_get_theme_mod( $prefix . '_comments_structure', 'narrow' ) === 'narrow' ) { $container_class = 'ct-container-narrow'; } if ( $has_comments === 'yes' && $comments_location === $location && (comments_open() || get_comments_number()) ) { if ($location === 'separated') { echo '
'; echo '
'; } comments_template(); if ($location === 'separated') { echo '
'; echo '
'; } } if ( blocksy_get_theme_mod($prefix . '_related_location', 'before') === 'after' && $comments_location === $related_posts_location && $has_related_posts && $related_posts_location === $location ) { /** * Note to code reviewers: This line doesn't need to be escaped. * The var $related_posts_output used here escapes the value properly. */ echo $related_posts_output; } } } if (! function_exists('blocksy_action_button')) { function blocksy_action_button($attributes = []) { $attributes = wp_parse_args( $attributes, [ 'button_html_attributes' => [], 'icon' => '', 'icon_position' => 'start', // start | end 'content' => '', 'done_state' => false, ] ); $loading_icon = ' '; $done_icon = ' '; $icon = blocksy_html_tag( 'span', [ 'class' => 'ct-icon-container' ], $attributes['icon'] . $loading_icon . ($attributes['done_state'] ? $done_icon : '') ); $content = $attributes['content']; if ( $attributes['icon_position'] === 'start' ) { $content = $icon . $content; } else { $content .= $icon; } return blocksy_html_tag( 'a', array_merge( $attributes['button_html_attributes'], [ 'data-button-state' => blocksy_akg( 'data-button-state', $attributes['button_html_attributes'], '' ) ] ), $content ); } }