is_block_editor()) { return $classes; } $default_page_structure = blocksy_default_akg( 'page_structure_type', blocksy_get_post_options($post->ID), 'default' ); if ($default_page_structure === 'default') { $default_page_structure = get_post_type($post) === 'page' ? get_theme_mod( 'single_page_structure', 'type-4' ) : get_theme_mod( 'single_blog_post_structure', 'type-3' ); $maybe_cpt = blocksy_manager()->post_types->is_supported_post_type(); if ($maybe_cpt) { $default_page_structure = get_theme_mod( $maybe_cpt . '_single_structure', 'type-4' ); } } if (get_post_type($post) === 'ct_content_block') { $default_page_structure = blocksy_default_akg( 'content_block_structure', blocksy_get_post_options($post->ID), 'type-4' ); } $class = 'narrow'; if ($default_page_structure === 'type-4') { $class = 'normal'; } $classes .= ' ' . 'ct-structure-' . $class; return $classes; } ); if (! function_exists('blocksy_get_jed_locale_data')) { function blocksy_get_jed_locale_data($domain) { $translations = get_translations_for_domain($domain); $locale = [ '' => [ 'domain' => $domain, 'lang' => is_admin() ? get_user_locale() : get_locale(), ], ]; if (! empty($translations->headers['Plural-Forms'])) { $locale['']['plural_forms'] = $translations->headers['Plural-Forms']; } foreach ($translations->entries as $msgid => $entry) { $locale[$msgid] = $entry->translations; } return $locale; } } add_action( 'admin_enqueue_scripts', function () { $theme = blocksy_get_wp_parent_theme(); $current_screen = get_current_screen(); if ( $current_screen->id && strpos($current_screen->id, 'forminator') !== false ) { return; } wp_enqueue_media(); wp_register_script( 'ct-events', get_template_directory_uri() . '/static/bundle/events.js', [], $theme->get('Version'), true ); $deps = apply_filters('blocksy-options-scripts-dependencies', [ 'underscore', 'react', 'react-dom', 'wp-element', 'wp-components', 'wp-date', 'wp-i18n', 'ct-events' // 'wp-polyfill' ]); global $wp_customize; if (! isset($wp_customize)) { wp_enqueue_editor(); wp_enqueue_script( 'ct-options-scripts', get_template_directory_uri() . '/static/bundle/options.js', $deps, $theme->get('Version') ); } $locale_data_ct = blocksy_get_jed_locale_data('blocksy'); wp_add_inline_script( 'wp-i18n', 'wp.i18n.setLocaleData( ' . wp_json_encode($locale_data_ct) . ', "blocksy" );' ); wp_enqueue_style( 'ct-options-styles', get_template_directory_uri() . '/static/bundle/options.css', ['wp-components'], $theme->get('Version') ); if (is_rtl()) { wp_enqueue_style( 'ct-options-rtl-styles', get_template_directory_uri() . '/static/bundle/options-rtl.css', ['ct-options-styles'], $theme->get('Version') ); } wp_localize_script( 'ct-options-scripts', 'ct_localizations', [ 'gradients' => get_theme_support('editor-gradient-presets')[0], 'is_dev_mode' => !!(defined('BLOCKSY_DEVELOPMENT_MODE') && BLOCKSY_DEVELOPMENT_MODE), 'nonce' => wp_create_nonce( 'ct-ajax-nonce' ), 'public_url' => get_template_directory_uri() . '/static/bundle/', 'static_public_url' => get_template_directory_uri() . '/static/', 'ajax_url' => admin_url('admin-ajax.php'), 'rest_url' => get_rest_url(), 'customizer_url' => admin_url('/customize.php?autofocus'), ] ); }, 50 ); add_action('admin_notices', function () { blocksy_output_companion_notice(); }); function blocksy_output_companion_notice() { if (! current_user_can('activate_plugins') ) return; if (get_option('dismissed-blocksy_plugin_notice', false)) return; $manager = new Blocksy_Plugin_Manager(); $status = $manager->get_companion_status()['status']; if ($status === 'active') return; $url = admin_url('themes.php?page=ct-dashboard'); $plugin_url = admin_url('admin.php?page=ct-dashboard'); $plugin_link = 'https://creativethemes.com/blocksy/companion/'; echo '
plugin.
.