__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
if (! function_exists('blocksy_is_page_title_default')) {
function blocksy_is_page_title_default() {
if (blocksy_is_page() || is_single()) {
$post_options = blocksy_get_post_options();
$mode = blocksy_akg('has_hero_section', $post_options, 'default');
if ($mode !== 'default') {
return false;
}
}
return true;
}
}
if (! function_exists('blocksy_get_page_title_source')) {
function blocksy_get_page_title_source() {
static $result = null;
if (! is_null($result)) {
if (! is_customize_preview()) {
return $result;
}
}
$maybe_custom_source = apply_filters(
'blocksy:hero:custom-source',
null
);
if ($maybe_custom_source !== null) {
$result = $maybe_custom_source;
return $result;
}
$prefix = blocksy_manager()->screen->get_prefix();
if ($prefix === 'ct_content_block_single') {
$result = false;
return $result;
}
if ($prefix === 'ct_product_tab_single') {
$result = false;
return $result;
}
if ($prefix === 'ct_size_guide_single') {
$result = false;
return $result;
}
if ($prefix === 'ct_thank_you_page_single') {
$result = false;
return $result;
}
if ($prefix === 'jet-woo-builder_single') {
$result = false;
return $result;
}
if ($prefix && strpos($prefix, 'single') !== false || (
function_exists('is_shop') && is_shop()
) && ! is_search()) {
$post_options = blocksy_get_post_options();
$mode = blocksy_akg('has_hero_section', $post_options, 'default');
if ($mode === 'disabled') {
$result = false;
return $result;
}
if ($mode === 'enabled') {
$result = [
'strategy' => $post_options
];
return $result;
}
}
$default_value = 'yes';
if (
$prefix === 'blog'
||
$prefix === 'tribe_events_single'
) {
$default_value = 'no';
}
if (blocksy_get_theme_mod($prefix . '_hero_enabled', $default_value) === 'no') {
$result = false;
return $result;
}
$result = [
'strategy' => 'customizer',
'prefix' => $prefix
];
return $result;
}
}
if (! function_exists('blocksy_first_level_deep_link')) {
function blocksy_first_level_deep_link($prefix) {
if ($prefix === 'blog') {
return 'blog_posts';
}
if ($prefix === 'author') {
return 'author_page';
}
if ($prefix === 'search') {
return 'search_page';
}
if ($prefix === 'woo_categories') {
return 'woocommerce_posts_archives';
}
if ($prefix === 'categories') {
return 'archive_blog_posts_categories';
}
if ($prefix === 'single_page') {
return 'single_pages';
}
if ($prefix === 'single_blog_post') {
return 'single_blog_posts';
}
if ($prefix === 'product') {
return 'woocommerce_single';
}
if ($prefix && strpos($prefix, '_archive') !== false) {
return 'post_type_archive_' . str_replace(
'_archive', '', $prefix
);
}
if ($prefix && strpos($prefix, '_single') !== false) {
return 'post_type_single_' . str_replace(
'_single', '', $prefix
);
}
return null;
}
}
if (! function_exists('blocksy_hero_get_deep_link')) {
function blocksy_hero_get_deep_link($source) {
if (! $source) {
return null;
}
if (! isset($source['prefix'])) {
return null;
}
$first_level = blocksy_first_level_deep_link($source['prefix']);
if (! $first_level) {
return null;
}
return $first_level . ':' . $source['prefix'] . '_hero_enabled';
}
}
if (! function_exists('blocksy_output_hero_section')) {
function blocksy_output_hero_section($args = []) {
$args = wp_parse_args($args, [
'type' => 'type-1',
'source' => false,
'elements' => null
]);
$type = $args['type'];
if (! blocksy_get_page_title_source()) {
return '';
}
$default_type = 'type-1';
if (
blocksy_get_page_title_source()['strategy'] === 'customizer'
&& (
blocksy_get_page_title_source()['prefix'] === 'woo_categories'
||
blocksy_get_page_title_source()['prefix'] === 'author'
)
) {
$default_type = 'type-2';
}
$actual_type = blocksy_akg_or_customizer(
'hero_section',
blocksy_get_page_title_source(),
$default_type
);
if (! $type) {
$type = $actual_type;
}
if ($type !== $actual_type) {
return '';
}
$post_id = blocksy_get_special_post_id();
$elements = $args['elements'];
if (! $elements) {
$elements = blocksy_render_view(
dirname(__FILE__) . '/hero/elements.php',
[
'type' => $type,
'post_id' => $post_id
]
);
}
if ($type !== 'type-1' && $type !== 'type-2') {
return '';
}
ob_start();
do_action('blocksy:hero:before', $type);
$attr = [
'class' => 'hero-section',
'data-type' => $type
];
if ($type === 'type-1') {
$attr['class'] .= ' is-width-constrained';
}
if (
is_customize_preview()
&&
blocksy_is_page_title_default()
&&
blocksy_hero_get_deep_link(blocksy_get_page_title_source())
) {
$attr['data-shortcut'] = 'border';
$attr['data-shortcut-location'] = blocksy_hero_get_deep_link(blocksy_get_page_title_source());
}
echo blocksy_render_view(
dirname(__FILE__) . '/hero/' . $type . '.php',
[
'type' => $type,
'elements' => $elements,
'attr' => $attr,
'post_id' => $post_id,
]
);
do_action('blocksy:hero:after', $type);
return ob_get_clean();
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| archive | Folder | 0750 |
|
|
| blocks | Folder | 0750 |
|
|
| builder | Folder | 0750 |
|
|
| hero | Folder | 0750 |
|
|
| media | Folder | 0750 |
|
|
| patterns | Folder | 0750 |
|
|
| single | Folder | 0750 |
|
|
| woocommerce | Folder | 0750 |
|
|
| back-to-top.php | File | 3.29 KB | 0640 |
|
| breadcrumbs.php | File | 22.21 KB | 0640 |
|
| contacts-box.php | File | 8.79 KB | 0640 |
|
| customizer-builder.php | File | 9.53 KB | 0640 |
|
| emoji-scripts.php | File | 1.12 KB | 0640 |
|
| gallery.php | File | 7.35 KB | 0640 |
|
| global-attrs.php | File | 4.73 KB | 0640 |
|
| hero-section.php | File | 5.18 KB | 0640 |
|
| menus.php | File | 10.65 KB | 0640 |
|
| pagination.php | File | 7.49 KB | 0640 |
|
| patterns.php | File | 832 B | 0640 |
|
| post-meta.php | File | 20.31 KB | 0640 |
|
| posts-listing.php | File | 3.1 KB | 0640 |
|
| search.php | File | 5.76 KB | 0640 |
|
| sidebar.php | File | 4.29 KB | 0640 |
|
| skip-to-content-link.php | File | 269 B | 0640 |
|
| social-box.php | File | 58.93 KB | 0640 |
|
| vertical-spacing.php | File | 1.42 KB | 0640 |
|
| woocommerce-integration.php | File | 5.08 KB | 0640 |
|