ID; } return $author_id; } } if (! function_exists('blocksy_post_uses_vc')) { function blocksy_post_uses_vc() { $post = get_post(); return $post && preg_match('/vc_row/', $post->post_content); } } if (! function_exists('blocksy_get_content_style_default')) { function blocksy_get_content_style_default($prefix = null) { if (! $prefix) { $prefix = blocksy_manager()->screen->get_prefix(); } $default_style = 'wide'; if ( $prefix === 'bbpress_single' || ( $prefix === 'courses_single' && function_exists('tutor') ) ) { $default_style = 'boxed'; } return $default_style; } } /** * User social channels * * @param string $tooltip Should output tooltips. */ if (! function_exists('blocksy_author_social_channels')) { function blocksy_author_social_channels($args = []) { $args = wp_parse_args( $args, [ 'new_tab' => true ] ); $meta_ids = [ 'facebook', 'linkedin', 'dribbble', 'user_url', 'twitter', 'instagram', 'pinterest', 'wordpress', 'github', 'medium', 'youtube', 'vimeo', 'vkontakte', 'odnoklassniki', 'tiktok' ]; $outputs = []; $descriptor = [ 'facebook' => [ 'label' => 'Facebook icon', 'icon' => '' ], 'linkedin' => [ 'label' => 'LinkedIn icon', 'icon' => '' ], 'dribbble' => [ 'label' => 'Dribbble icon', 'icon' => '' ], 'user_url' => [ 'label' => 'Website icon', 'icon' => '' ], 'twitter' => [ 'label' => 'Twitter icon', 'icon' => '' ], 'instagram' => [ 'label' => 'Instagram icon', 'icon' => '' ], 'pinterest' => [ 'label' => 'Pinterest icon', 'icon' => '' ], 'wordpress' => [ 'label' => 'WordPress icon', 'icon' => '' ], 'github' => [ 'label' => 'GitHub icon', 'icon' => '' ], 'medium' => [ 'label' => 'Medium icon', 'icon' => '' ], 'youtube' => [ 'label' => 'YouTube icon', 'icon' => '' ], 'vimeo' => [ 'label' => 'Vimeo icon', 'icon' => '' ], 'vkontakte' => [ 'label' => 'Vkontakte icon', 'icon' => '' ], 'odnoklassniki' => [ 'label' => 'Odnoklassniki icon', 'icon' => '' ], 'tiktok' => [ 'label' => 'TikTok icon', 'icon' => '' ] ]; foreach ($meta_ids as $network_id) { $meta_value = get_the_author_meta($network_id); if (! $meta_value) { continue; } $attr = [ 'href' => esc_url($meta_value), 'aria-label' => $descriptor[$network_id]['label'] ]; $attr['rel'] = 'noopener'; if ($args['new_tab']) { $attr['rel'] = 'noopener noreferrer nofollow'; $attr['target'] = '_blank'; } $outputs[] = blocksy_html_tag( 'a', $attr, $descriptor[$network_id]['icon'] ); } if (empty($outputs)) { return; } echo blocksy_html_tag( 'div', [ 'class' => 'author-box-social' ], implode(' ', $outputs) ); } } if (! function_exists('blocksy_author_meta_elements')) { function blocksy_author_meta_elements($args = []) { if (! is_author()) { return; } $args = wp_parse_args( $args, [ 'value' => [ 'joined' => false, 'articles_count' => false, 'comments' => false ], 'attr' => [] ] ); if ( ! $args['value']['joined'] && ! $args['value']['articles_count'] && ! $args['value']['comments'] ) { return; } $user_data = get_userdata(blocksy_get_author_id()); $joined_date = ''; if ($user_data && isset($user_data->user_registered)) { $joined_date = date_i18n( get_option('date_format', ''), strtotime($user_data->user_registered) ); } $comments_count = get_comments([ 'type' => '', 'user_id' => blocksy_get_author_id(), 'count' => true, ]); $posts_count = count_user_posts( blocksy_get_author_id(), array_merge( ['post'], blocksy_manager()->post_types->get_supported_post_types() ) ); $container_attr = array_merge([ 'class' => 'entry-meta', 'data-type' => 'simple:slash' ], $args['attr']); ?>