', $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' => 'simple:slash'
], $args['attr']);
?>
screen->get_prefix();
$type = get_theme_mod($prefix . '_single_author_box_type', 'type-2');
$has_author_box_social = get_theme_mod(
$prefix . '_single_author_box_social',
'yes'
) === 'yes';
$class = 'author-box';
$class .= ' ' . blocksy_visibility_classes(get_theme_mod(
$prefix . '_author_box_visibility',
[
'desktop' => 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],
]
);
?>
post_types->is_supported_post_type();
if ($post_type) {
return [
'prefix' => $post_type . '_single',
'strategy' => 'customizer'
];
}
if (blocksy_is_page()) {
return [
'strategy' => '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() {
$featured_image_source = blocksy_get_featured_image_source();
if (blocksy_akg_or_customizer(
'has_featured_image',
$featured_image_source,
'no'
) === 'no') {
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() {
$maybe_custom_content_style = blocksy_default_akg(
'content_style',
blocksy_get_post_options(),
'inherit'
);
if ($maybe_custom_content_style !== 'inherit') {
return $maybe_custom_content_style;
}
$prefix = blocksy_manager()->screen->get_prefix();
return get_theme_mod(
$prefix . '_content_style',
$prefix === 'bbpress_single' ? 'boxed' : 'wide'
);
}
}
if (! function_exists('blocksy_get_entry_content_editor')) {
function blocksy_get_entry_content_editor() {
$content_style = blocksy_get_content_style();
$editor = blocksy_get_post_editor();
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;
}
}
function blocksy_get_post_editor() {
global $post;
$editor = 'classic';
if (blocksy_is_blocks_editor_active()) {
$editor = 'default';
}
if (class_exists('\Elementor\Plugin')) {
if ($post && \Elementor\Plugin::$instance->db->is_built_with_elementor(
$post->ID
)) {
$editor = 'elementor';
}
}
if (
class_exists('\ElementorPro\Plugin')
&&
\ElementorPro\Plugin::instance()->modules_manager->get_modules('theme-builder')
&&
$post
) {
$doc = \Elementor\Plugin::instance()->documents->get_doc_for_frontend($post->ID);
if (
$doc
&&
strpos($doc->get_name(), 'product') !== false
) {
$editor = 'elementor';
}
}
$post = get_post();
if ($post && preg_match('/vc_row/', $post->post_content)) {
$editor = 'bakery';
}
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 (
wp_doing_ajax()
&&
isset($_REQUEST['post_id'])
&&
get_post($_REQUEST['post_id'])
&&
get_post_type($_REQUEST['post_id']) === 'brizy_template'
) {
$editor = 'brizy';
}
}
if (class_exists('FLBuilderModel')) {
if (FLBuilderModel::is_builder_enabled()) {
$editor = 'beaver';
}
}
return $editor;
}