', $block_content)[0]; if ( strpos($first_div, 'alignleft') !== false || strpos($first_div, 'alignright') !== false ) { $class = 'align-wrap-' . esc_attr( $block['attrs']['align'] ) . ' ' . $additional_class; return sprintf( '
%2$s
', $class, $block_content ); } else { return preg_replace( '/(.*?)class="(.*?)"(.*)/', '\1class="\2 align-wrap-' . esc_attr( $block['attrs']['align'] ) . ' ' . $additional_class . '"\3', $block_content ); } } return $block_content; }, 10, 2); /** * User social channels * * @param string $tooltip Should output tooltips. */ if (! function_exists('blocksy_author_social_channels')) { function blocksy_author_social_channels($tooltip = 'yes') { $facebook = get_the_author_meta('facebook'); $linkedin = get_the_author_meta('linkedin'); $dribbble = get_the_author_meta('dribbble'); $website = get_the_author_meta('user_url'); $twitter = get_the_author_meta('twitter'); $instagram = get_the_author_meta('instagram'); if ( ! ( $website || $facebook || $twitter || $linkedin || $dribbble || $instagram ) ) { return; } $class = 'author-box-social'; ?> [ 'joined' => false, 'articles_count' => false, 'comments' => false ], 'attr' => [] ] ); if ( ! $args['value']['joined'] && ! $args['value']['articles_count'] && ! $args['value']['comments'] ) { return; } $joined_date = date("F j, Y", strtotime(get_userdata( get_the_author_meta('ID') )->user_registered)); $comments_count = get_comments([ 'type' => '', 'user_id' => get_the_author_meta('ID'), 'count' => true, ]); $posts_count = count_user_posts(get_the_author_meta('ID')); $container_attr = array_merge([ 'class' => 'entry-meta', 'data-type' => 'slash:simple' ], $args['attr']); ?> true, 'tablet' => true, 'mobile' => false, ])); ?>
120]), [ 'tag_name' => 'a', 'inner_content' => ' ', 'html_atts' => [ 'href' => get_author_posts_url( get_the_author_meta('ID'), get_the_author_meta('user_nicename') ) ], 'img_atts' => ['width' => 60, 'height' => 60], ] ); ?>
'customizer', 'prefix' => 'single_page' ]; } return [ 'strategy' => 'customizer', 'prefix' => 'single_blog_post' ]; } } if (! function_exists('blocksy_get_featured_image_output')) { function blocksy_get_featured_image_output($check_for_preview = false) { $featured_image_source = blocksy_get_featured_image_source(); if (blocksy_akg_or_customizer( 'has_featured_image', $featured_image_source, 'no' ) === 'no') { if (! $check_for_preview) { return ''; } } if (blocksy_default_akg( 'disable_featured_image', blocksy_get_post_options(), 'no' ) === 'yes') { return ''; } if (! has_post_thumbnail()) { return ''; } $class = 'ct-featured-image'; $class .= ' ' . blocksy_visibility_classes( blocksy_akg_or_customizer( 'featured_image_visibility', $featured_image_source, [ 'desktop' => true, 'tablet' => true, 'mobile' => false, ] ) ); $content_style = blocksy_get_content_style(); if ( blocksy_sidebar_position() === 'none' && $content_style === 'wide' ) { $image_width = blocksy_akg_or_customizer( 'featured_image_width', $featured_image_source, 'default' ); if ($image_width === 'wide') { $class .= ' alignwide'; } } if ($content_style === 'boxed') { if (blocksy_akg_or_customizer( 'featured_image_boundless', $featured_image_source, 'no' ) === 'yes') { $class .= ' ct-boundless'; } } $maybe_figcaption = wp_get_attachment_caption(get_post_thumbnail_id()); if (! empty($maybe_figcaption)) { $maybe_figcaption = '
' . trim($maybe_figcaption) . '
'; } else { $maybe_figcaption = ''; } return blocksy_html_tag('figure', ['class' => $class], blocksy_image([ 'attachment_id' => get_post_thumbnail_id(), 'ratio' => blocksy_akg_or_customizer( 'featured_image_ratio', $featured_image_source, 'original' ), 'size' => 'full' ]) . $maybe_figcaption); } } if (! function_exists('blocksy_get_content_style')) { function blocksy_get_content_style() { $post_type = blocksy_manager()->post_types->is_supported_post_type(); $key = 'single_content_style'; if (blocksy_is_page()) { $key = 'page_content_style'; } if ($post_type) { $key = $post_type . '_single_content_style'; } if (function_exists('is_bbpress') && ( get_post_type() === 'forum' || get_post_type() === 'topic' || get_post_type() === 'reply' )) { $key = 'bbpress_single_content_style'; } if (function_exists('is_buddypress') && ( is_buddypress() )) { $key = 'buddypress_single_content_style'; } return get_theme_mod($key, 'wide'); } } if (! function_exists('blocksy_get_entry_content_editor')) { function blocksy_get_entry_content_editor() { $content_style = blocksy_get_content_style(); $editor = 'classic'; global $post; if (blocksy_is_blocks_editor_active()) { $editor = 'default'; } if (class_exists('\Elementor\Plugin')) { if (\Elementor\Plugin::$instance->db->is_built_with_elementor( $post->ID )) { $editor = 'elementor'; } } if (function_exists('et_pb_is_pagebuilder_used')) { if ( et_pb_is_pagebuilder_used(get_the_ID()) || is_et_pb_preview() ) { $editor = 'divi'; } } if (class_exists('Brizy_Editor')) { $pid = Brizy_Editor::get()->currentPostId(); $is_using_brizy = false; try { if (in_array(get_post_type($pid), Brizy_Editor::get()->supported_post_types())) { $is_using_brizy = Brizy_Editor_Post::get($pid)->uses_editor(); } } catch (Exception $e) { } if (class_exists('Brizy_Admin_Templates')) { if (is_null($pid) || !$is_using_brizy) { $templateManager = Brizy_Admin_Templates::_init(); if ($templateManager->getTemplateForCurrentPage()) { $editor = 'brizy'; } } } if ($is_using_brizy) { $editor = 'brizy'; } } if (class_exists('FLBuilderModel')) { if (FLBuilderModel::is_builder_enabled()) { $editor = 'beaver'; } } if (blocksy_get_page_structure() === 'none') { return 'data-structure="' . $editor . ':' . $content_style . '"'; } $editor .= ':' . $content_style . ':' . blocksy_get_page_structure(); return 'data-structure="' . $editor . '"'; } } if (! function_exists('blocksy_is_blocks_editor_active')) { function blocksy_is_blocks_editor_active() { $gutenberg = ! (false === has_filter('replace_editor', 'gutenberg_init')); $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>'); if (! $gutenberg && ! $block_editor) { return false; } if (blocksy_is_classic_editor_plugin_active()) { $editor_option = get_option('classic-editor-replace'); $block_editor_active = array('no-replace', 'block'); $editor = get_post_meta(get_the_ID(), 'classic-editor-remember', true); $all = get_option('classic-editor-allow-users', 'disallow'); if ($all === 'disallow') { return false; } if ($editor === 'classic-editor') { return false; } if ($editor === 'block-editor') { return true; } return in_array($editor_option, $block_editor_active, true); } return true; } } if (! function_exists('blocksy_is_classic_editor_plugin_active')) { function blocksy_is_classic_editor_plugin_active() { if (! function_exists('is_plugin_active')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (is_plugin_active('classic-editor/classic-editor.php')) { return true; } return false; } }