| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.9/wp-content/themes/blocksy/inc/dynamic-styles/admin/ |
Upload File : |
<?php
$post_type = get_current_screen()->post_type;
$post_id = null;
if (isset($_GET['post']) && $_GET['post']) {
$post_id = $_GET['post'];
}
$prefix = blocksy_manager()->screen->get_admin_prefix($post_type);
$post_atts = blocksy_get_post_options($post_id);
$background_source = blocksy_default_akg(
'background',
$post_atts,
blocksy_background_default_value([
'backgroundColor' => [
'default' => [
'color' => Blocksy_Css_Injector::get_skip_rule_keyword()
],
],
])
);
if ($post_type === 'ct_content_block') {
$template_type = get_post_meta($post_id, 'template_type', true);
$template_subtype = blocksy_akg('template_subtype', $post_atts, 'card');
if ($template_type === 'popup') {
$background_source = blocksy_default_akg(
'popup_background',
$post_atts,
blocksy_background_default_value([
'backgroundColor' => [
'default' => [
'color' => '#ffffff'
],
],
])
);
}
if ($template_type !== 'popup') {
$default_content_block_structure = 'yes';
if ($template_type === 'hook') {
$default_content_block_structure = 'no';
}
$has_content_block_structure = blocksy_akg(
'has_content_block_structure',
$post_atts,
$default_content_block_structure
);
if (
$has_content_block_structure !== 'yes'
||
$template_type === 'archive' && $template_subtype === 'card'
) {
$background_source = blocksy_background_default_value([
'backgroundColor' => [
'default' => [
'color' => Blocksy_Css_Injector::get_skip_rule_keyword()
],
],
]);
}
}
}
$maybe_matching_template = null;
$content_block_atts = null;
$strategy = [
'strategy' => 'customizer',
'prefix' => $prefix
];
if (function_exists('blocksy_companion_get_content_block_that_matches')) {
$maybe_matching_template = blocksy_companion_get_content_block_that_matches([
'template_type' => 'single',
'template_subtype' => 'canvas',
'match_conditions_strategy' => $prefix
]);
if ($maybe_matching_template) {
$content_block_atts = blocksy_get_post_options($maybe_matching_template);
$strategy = [
'strategy' => $content_block_atts
];
}
}
if (
isset($background_source['background_type'])
&&
$background_source['background_type'] === 'color'
&&
isset($background_source['backgroundColor']['default']['color'])
&&
$background_source['backgroundColor']['default']['color'] === Blocksy_Css_Injector::get_skip_rule_keyword()
) {
$background_source = blocksy_akg_or_customizer(
'background',
$strategy,
blocksy_background_default_value([
'backgroundColor' => [
'default' => [
'color' => Blocksy_Css_Injector::get_skip_rule_keyword()
],
],
])
);
if (
isset($background_source['background_type'])
&&
$background_source['background_type'] === 'color'
&&
isset($background_source['backgroundColor']['default']['color'])
&&
$background_source['backgroundColor']['default']['color'] === Blocksy_Css_Injector::get_skip_rule_keyword()
) {
$background_source = blocksy_get_theme_mod(
'site_background',
blocksy_background_default_value([
'backgroundColor' => [
'default' => [
'color' => 'var(--theme-palette-color-7)'
],
],
])
);
}
}
$background_source = blocksy_expand_responsive_value($background_source);
global $wp_version;
$is_65_wordpress = version_compare($wp_version, '6.5', '>=');
$background_selectors = [
'desktop' => '.ct-desktop-view iframe[name="editor-canvas"], .ct-desktop-view .edit-post-visual-editor',
'tablet' => '.ct-tablet-view iframe[name="editor-canvas"]',
'mobile' => '.ct-mobile-view iframe[name="editor-canvas"]'
];
// We don't support boxed styles for 6.4 and less. For that version of WP
// we will only support the main page background.
if (! $is_65_wordpress) {
$background_selectors = [
'desktop' => '.ct-desktop-view iframe[name="editor-canvas"], .ct-desktop-view .edit-post-visual-editor__content-area > div',
'tablet' => '.ct-tablet-view iframe[name="editor-canvas"]',
'mobile' => '.ct-mobile-view iframe[name="editor-canvas"]'
];
}
blocksy_output_background_css([
'selector' => $background_selectors['desktop'],
'css' => $css,
'value' => $background_source['desktop'],
'responsive' => false,
'important' => true
]);
blocksy_output_background_css([
'selector' => $background_selectors['tablet'],
'css' => $css,
'value' => $background_source['tablet'],
'responsive' => false,
'important' => true
]);
blocksy_output_background_css([
'selector' => $background_selectors['mobile'],
'css' => $css,
'value' => $background_source['mobile'],
'responsive' => false,
'important' => true
]);