and

tags if block */ remove_filter('the_content', 'wpautop'); add_filter('the_content', function ($content) { if ( has_blocks() ) { return $content; } return wpautop($content); }); /** * Enqueue Gutenberg block assets for backend editor. * * `wp-blocks`: includes block type registration and related functions. * `wp-element`: includes the WordPress Element abstraction for describing the structure of your blocks. * `wp-i18n`: To internationalize the block's text. * * @since 1.0.0 */ // Hook: Editor assets. add_action( 'enqueue_block_editor_assets', 'elegant_blocks_cgb_editor_assets' ); function elegant_blocks_cgb_editor_assets() { wp_enqueue_script( 'wp-api' ); // Scripts. wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_script( 'elegant-blocks-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element' , 'wp-components' , 'wp-editor' ) // Dependencies, defined above. ); wp_enqueue_script( 'elegant_blocks_backend_editor_js', plugins_url( '/dist/js/editor.js', dirname( __FILE__ ) ), array( 'wp-blocks', 'wp-dom' ), time(), true ); // This js file will be included in both frontend and backend wp_enqueue_script( 'elegant_blocks_frontend_backend_js', plugins_url( '/dist/js/frontend_backend.js', dirname( __FILE__ ) ), array(), time(), true ); // Get google map api $google_map_api = get_option( 'elegant_blocks_google_map_api' ); $google_map_script = get_option( 'elegant_blocks_google_map_script' ); if( empty( $google_map_script ) ){ wp_enqueue_script( 'elegant_blocks_google_map', '//maps.googleapis.com/maps/api/js?libraries=places&key=' . esc_attr( $google_map_api ), '0.1', true ); } wp_enqueue_style( 'wp-jquery-ui-dialog' ); wp_enqueue_style( 'gutenberg-editor-css', plugins_url( '/dist/css/gutenberg-base-editor-style.css', dirname( __FILE__ ) ) ); wp_enqueue_style( 'gutenberg-blocks-css', plugins_url( '/dist/css/gutenberg-blocks.css', dirname( __FILE__ ) ) ); wp_enqueue_style( 'font-awesome-5-backend', plugins_url( '/dist/font-awesome-5/css/all.css', dirname( __FILE__ ) ) ); } add_action( 'wp_enqueue_scripts', 'elegant_blocks_main_style' , 999 ); function elegant_blocks_main_style(){ wp_enqueue_style( 'elegant_blocks_custom_css', plugins_url( '/dist/css/elegantblock_style.css', dirname( __FILE__ ) ) ); wp_enqueue_style( 'gutenberg-blocks-css', plugins_url( '/dist/css/gutenberg-blocks.css', dirname( __FILE__ ) ) ); } add_action( 'wp_enqueue_scripts', 'elegant_blocks_plugin_styles' ); function elegant_blocks_plugin_styles() { $bootstrap_status = absint( get_option( 'elegant_blocks_bootstrap_status' ) ); $google_font_status = absint( get_option( 'elegant_blocks_google_font_status' ) ); $bootstrap_status = apply_filters( 'elegant_blocks_bootstrap', false ); if( empty( $bootstrap_status ) ){ wp_enqueue_style( 'bootstrap', plugins_url( '/dist/css/bootstrap.min.css', dirname( __FILE__ ) ) ); wp_enqueue_script( 'bootstrap.js', plugins_url( '/dist/js/bootstrap.min.js', dirname( __FILE__ ) ) , array(), '0.1', true ); } $fontawesome_status = apply_filters( 'elegant_blocks_fontawesome', false ); if( empty( $fontawesome_status ) ){ wp_enqueue_style( 'font-awesome-5', plugins_url( '/dist/font-awesome-5/css/all.css', dirname( __FILE__ ) ) ); } wp_enqueue_style( 'animate', plugins_url( '/dist/css/animate.min.css', dirname( __FILE__ ) ) ); wp_enqueue_style( 'elegant_blocks_plugins_css', plugins_url( '/dist/css/plugins.css', dirname( __FILE__ ) ) ); // Add Google Font if( empty( $google_font_status ) ){ wp_enqueue_style( 'open_sans_google_font', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800' ); wp_enqueue_style( 'poppins_google_font', 'https://fonts.googleapis.com/css?family=Poppins:300,400,600,700,800' ); wp_enqueue_style( 'roboto_google_font', 'https://fonts.googleapis.com/css?family=Roboto:300,400,600,700,800' ); } // JS wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery.touchSwipe.for.forms.min.js', plugins_url( '/dist/js/jquery.touchSwipe.for.forms.min.js', dirname( __FILE__ ) ) , array(), '0.1', true ); wp_enqueue_script( 'elegant_blocks_responsive_bootstrap_carousel.min.js', plugins_url( '/dist/js/responsive_bootstrap_carousel.min.js', dirname( __FILE__ ) ) , array(), '0.1', true ); wp_enqueue_script( 'slider_min.min.js', plugins_url( '/dist/js/slider_min.js', dirname( __FILE__ ) ) , array(), '0.1', true ); wp_enqueue_script( 'elegantblock_custom', plugins_url( '/dist/js/elegantblock_custom.js', dirname( __FILE__ ) ) , array(), '0.1', false ); wp_enqueue_script( 'elegant_blocks_plugins_js', plugins_url( '/dist/js/plugins.js', dirname( __FILE__ ) ) , array(), '0.1', true ); wp_enqueue_script( 'instagram_js', plugins_url( '/dist/js/instagram.js', dirname( __FILE__ ) ) , array(), '0.1', false ); wp_enqueue_script( 'slick', plugins_url( '/dist/js/slick.js', dirname( __FILE__ ) ) , array(), '0.1', true ); // This js file will be included in both frontend and backend wp_register_script( 'elegant_blocks_frontend_backend_js', plugins_url( '/dist/js/frontend_backend.js', dirname( __FILE__ ) ), array(), time(), true ); $translation_array = array( 'ELEGANTBLOCKS_PLUGIN_URL' => ELEGANTBLOCKS_PLUGIN_URL ); wp_localize_script( 'elegant_blocks_frontend_backend_js', 'mb_backend_object', $translation_array ); wp_enqueue_script( 'elegant_blocks_frontend_backend_js' ); // Get google map api $google_map_api = get_option( 'elegant_blocks_google_map_api' ); $google_map_script = get_option( 'elegant_blocks_google_map_script' ); if( empty( $google_map_script ) ){ wp_enqueue_script( 'elegant_blocks_google_map', '//maps.googleapis.com/maps/api/js?libraries=places&key=' . esc_attr( $google_map_api ), '0.1', true ); } } // admin css and js add_action( 'admin_enqueue_scripts', 'elegant_blocks_backend_css_js' , 999 ); function elegant_blocks_backend_css_js() { wp_enqueue_style( 'elegant_blocks_backend_css', plugins_url( '/dist/css/admin.css', dirname( __FILE__ ) ), false, '0.1' ); // Localize the script with new data $disable_blocks = get_option( 'elegant_blocks_block_status' ); $translation_array = array( 'animate_style_options' => elegant_blocks_animate_css_options(), 'progress_bar_limit' => apply_filters( 'elegant_blocks_progress_bar_limit', 10 ), 'disable_blocks' => empty( $disable_blocks ) ? array() : $disable_blocks, 'shape_images' => elegant_blocks_shapes(), 'shape_svg' => elegant_blocks_shapes_svg(), 'markers' => elegant_blocks_map_icons(), 'google_map_api' => get_option( 'elegant_blocks_google_map_api' ), 'elegant_blocks_settings_page' => admin_url( 'admin.php?page=elegant-blocks-settings' ), 'ELEGANTBLOCKS_PLUGIN_URL' => ELEGANTBLOCKS_PLUGIN_URL, 'fontawesome_icons' => bizberg_fontawesome_5_icons(), 'google_fonts' => json_decode( GOOGLE_FONTS , true ), 'pro_status' => get_option( 'pro_status' ), 'demo_import_page' => admin_url( '/themes.php?page=cyclone-one-click-demo-import' ) ); wp_register_script( 'elegant_blocks_backend_js', plugins_url( '/dist/js/admin.js', dirname( __FILE__ ) ) , array(), time(), true ); wp_localize_script( 'elegant_blocks_backend_js', 'mb_backend_object', $translation_array ); wp_enqueue_script( 'elegant_blocks_backend_js' ); } add_image_size( 'elegant_blocks_team_1', 500, 500, true ); add_image_size( 'elegant_blocks_blog_1', 693, 462, true ); add_image_size( 'elegant_blocks_slider_1', 1600, 1000, true ); /** * Register new categories */ add_filter( 'block_categories', 'elegant_blocks_categories', 10, 2 ); function elegant_blocks_categories( $categories, $post ) { $cat = array_merge( $categories, array( array( 'slug' => 'elegant-blocks-newsletters-template', 'title' => __( 'EB Newsletters Template', 'elegant-blocks' ) ), array( 'slug' => 'elegant-blocks-video-template', 'title' => __( 'EB Videos Template', 'elegant-blocks' ) ), array( 'slug' => 'elegant-blocks-description-template', 'title' => __( 'EB Descriptions Template', 'elegant-blocks' ) ), array( 'slug' => 'elegant-blocks-banner-template', 'title' => __( 'EB Banners Template', 'elegant-blocks' ) ), array( 'slug' => 'elegant-blocks', 'title' => __( 'Elegant Blocks', 'elegant-blocks' ) ), ) ); return array_reverse( $cat ); } // Animate.css animations styles function elegant_blocks_animate_css_options(){ $styles = array( 'bounce' => 'bounce', 'flash' => 'flash', 'pulse' => 'pulse', 'rubberBand' => 'rubberBand', 'shake' => 'shake', 'swing' => 'swing', 'tada' => 'tada', 'wobble' => 'wobble', 'jello' => 'jello', 'bounceIn' => 'bounceIn', 'bounceInDown' => 'bounceInDown', 'bounceInUp' => 'bounceInUp', 'fadeIn' => 'fadeIn', 'fadeInDown' => 'fadeInDown', 'fadeInDownBig' => 'fadeInDownBig', 'fadeInLeft' => 'fadeInLeft', 'fadeInLeftBig' => 'fadeInLeftBig', 'fadeInRight' => 'fadeInRight', 'fadeInRightBig' => 'fadeInRightBig', 'fadeInUp' => 'fadeInUp', 'fadeInUpBig' => 'fadeInUpBig', 'flip' => 'flip', 'flipInX' => 'flipInX', 'flipInY' => 'flipInY', 'lightSpeedIn' => 'lightSpeedIn', 'rotateIn' => 'rotateIn', 'rotateInDownLeft' => 'rotateInDownLeft', 'rotateInDownRight' => 'rotateInDownRight', 'rotateInUpLeft' => 'rotateInUpLeft', 'rotateInUpRight' => 'rotateInUpRight', 'slideInUp' => 'slideInUp', 'slideInDown' => 'slideInDown', 'slideInLeft' => 'slideInLeft', 'slideInRight' => 'slideInRight', 'zoomIn' => 'zoomIn', 'zoomInDown' => 'zoomInDown', 'zoomInLeft' => 'zoomInLeft', 'zoomInRight' => 'zoomInRight', 'zoomInUp' => 'zoomInUp', 'hinge' => 'hinge', 'rollIn' => 'rollIn', ); $options = array(); foreach ( $styles as $key => $value ) { $options[] = array( 'label' => $key, 'value' => $value ); } return $options; } function elegant_blocks_color_luminance( $hex, $diff ) { $rgb = str_split(trim($hex, '# '), 2); foreach ($rgb as &$hex) { $dec = hexdec($hex); if ($diff >= 0) { $dec += $diff; } else { $dec -= abs($diff); } $dec = max(0, min(255, $dec)); $hex = str_pad(dechex($dec), 2, '0', STR_PAD_LEFT); } return '#'.implode($rgb); } add_action( 'plugins_loaded', 'elegant_blocks_register_dynamic_block', 10 ); function elegant_blocks_register_dynamic_block() { // Only load if Gutenberg is available. if ( !function_exists( 'register_block_type' ) ) { return; } // Hook server side rendering into render callback register_block_type( 'elegant-blocks-plugin/team', array( 'render_callback' => 'elegant_blocks_render_dynamic_block_team_1', ) ); register_block_type( 'elegant-blocks-plugin/blog-1', array( 'render_callback' => 'elegant_blocks_render_blog_1', ) ); register_block_type( 'elegant-blocks-plugin/slider', array( 'render_callback' => 'elegant_blocks_render_slider_1', ) ); register_block_type( 'elegant-blocks-plugin/testimonials', array( 'render_callback' => 'elegant_blocks_render_testimonial_1', ) ); register_block_type( 'elegant-blocks-plugin/gallery', array( 'render_callback' => 'elegant_blocks_render_gallery_1', ) ); register_block_type( 'elegant-blocks-plugin/calltoaction', array( 'render_callback' => 'elegant_blocks_render_calltoaction_1', ) ); register_block_type( 'elegant-blocks-plugin/instagram', array( 'render_callback' => 'elegant_blocks_render_instagram_1', ) ); register_block_type( 'ct-plugin/instagram-1', array( 'render_callback' => 'elegant_blocks_render_instagram_1', ) ); register_block_type( 'elegant-blocks-plugin/services', array( 'render_callback' => 'elegant_blocks_render_services_1', ) ); register_block_type( 'elegant-blocks-plugin/tabs', array( 'render_callback' => 'elegant_blocks_render_tabs', ) ); register_block_type( 'elegant-blocks-plugin/accordion', array( 'render_callback' => 'elegant_blocks_render_accordion', ) ); register_block_type( 'elegant-blocks-plugin/social-icons', array( 'render_callback' => 'elegant_blocks_render_social_icons', ) ); register_block_type( 'elegant-blocks-plugin/pricing-table', array( 'render_callback' => 'elegant_blocks_render_pricing_table', ) ); register_block_type( 'elegant-blocks-plugin/progress-bar', array( 'render_callback' => 'elegant_blocks_render_progress_bar', ) ); register_block_type( 'elegant-blocks-plugin/heading', array( 'render_callback' => 'elegant_blocks_render_heading', ) ); register_block_type( 'elegant-blocks-plugin/countup', array( 'render_callback' => 'elegant_blocks_render_countup', ) ); register_block_type( 'elegant-blocks-plugin/shape-divider', array( 'render_callback' => 'elegant_blocks_render_shape_divider', ) ); register_block_type( 'elegant-blocks-plugin/map', array( 'render_callback' => 'elegant_blocks_render_map', ) ); register_block_type( 'elegant-blocks-plugin/clients', array( 'render_callback' => 'elegant_blocks_render_clients', ) ); register_block_type( 'elegant-blocks-plugin/description-1', array( 'render_callback' => 'elegant_blocks_render_description_1', ) ); register_block_type( 'elegant-blocks-plugin/banner-1', array( 'render_callback' => 'elegant_blocks_render_banner_1', ) ); register_block_type( 'elegant-blocks-plugin/eb-container', array( 'render_callback' => 'elegant_blocks_render_container', ) ); register_block_type( 'elegant-blocks-plugin/video-1', array( 'render_callback' => 'elegant_blocks_render_video_1', ) ); register_block_type( 'elegant-blocks-plugin/text', array( 'render_callback' => 'elegant_blocks_render_text', ) ); register_block_type( 'elegant-blocks-plugin/newsletter-1', array( 'render_callback' => 'elegant_blocks_render_newsletter_1', ) ); } /** * Check if gutenberg is install or not */ add_action( 'admin_notices', 'elegant_blocks_check_gutenberg' ); function elegant_blocks_check_gutenberg(){ if( !function_exists( 'register_block_type' ) ){ ?>

'; $svg_2 = ' '; $svg_3 = ' '; $svg_4 = ' '; $svg_5 = ' '; $svg_6 = ' '; $svg_7 = ' '; $svg_8 = ' '; $svg = array( $svg_1, $svg_2, $svg_3, $svg_4, $svg_5, $svg_6, $svg_7, $svg_8 ); return apply_filters( 'elegant_blocks_shape_svg', $svg ); } /* * Check gutenberg is active or not */ function elegant_blocks_is_gutenberg_page() { if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) { // The Gutenberg plugin is on. return true; } $current_screen = get_current_screen(); if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) { // Gutenberg page on 5+. return true; } return false; } function elegant_blocks_limit_content_chr( $content, $limit=100 ) { return mb_strimwidth( strip_tags($content), 0, $limit, ' [ ... ]' ); } /** * Remove intro text of the "One click demo import" */ add_filter( 'pt-ocdi/plugin_intro_text', 'elegant_blocks_import_intro_text' ); function elegant_blocks_import_intro_text( $default_text ) { return false; } /** * Change 'One click demo import' page texts */ add_filter( 'pt-ocdi/plugin_page_setup', 'elegant_blocks_import_page_setup' , 1 ); function elegant_blocks_import_page_setup( $default_settings ) { $default_settings['parent_slug'] = 'themes.php'; $default_settings['page_title'] = esc_html__( 'Bizberg Demo Import' , 'elegant-blocks' ); $default_settings['menu_title'] = esc_html__( 'Import Demo Data' , 'elegant-blocks' ); $default_settings['capability'] = 'import'; $default_settings['menu_slug'] = 'cyclone-one-click-demo-import'; return $default_settings; } /** * Remove 'One click demo import' branding */ add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' ); add_filter( 'admin_body_class', 'elegant_blocks_admin_body_class' ); /** * Adds one or more classes to the body tag in the dashboard. * * @link https://wordpress.stackexchange.com/a/154951/17187 * @param String $classes Current body classes. * @return String Altered body classes. */ function elegant_blocks_admin_body_class( $classes ) { if( !empty( $_GET['page'] ) && $_GET['page'] == 'elegant-blocks-bizberg-theme-options' ){ return "$classes elegant_block_theme_option"; } else { return "$classes"; } } add_action( 'admin_notices', 'elegant_blocks_notice' ); function elegant_blocks_notice() { // Hide bizberg admin message if( !empty( $_GET['status'] ) && $_GET['status'] == 'hide_error_message_eb' ){ update_option( 'hide_error_message_eb', true ); } $status = get_option( 'hide_error_message_eb' ); if( $status == true ){ return; } ?>

Elegant Blocks is a plugin made for CycloneTheme's themes. Hide this Message

array( 'slug' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php', 'zip' => 'https://downloads.wordpress.org/plugin/ultimate-addons-for-gutenberg.latest-stable.zip' ), 'ocdi' => array( 'slug' => 'one-click-demo-import/one-click-demo-import.php', 'zip' => 'https://downloads.wordpress.org/plugin/one-click-demo-import.latest-stable.zip' ) ); if( !empty( $plugins ) && is_array( $plugins ) ){ foreach ( $plugins as $value) { if( in_array( $value, array( 'ocdi' , 'ultimate_blocks' ) ) ){ $installed = false; if ( !bizberg_is_plugin_installed( $slug[$value]['slug'] ) ) { $installed = bizberg_install_plugin( $slug[$value]['zip'] ); } activate_plugin( $slug[$value]['slug'] ); } } } echo json_encode( array( 'status' => 'success' ) ); die; } add_action( "wp_ajax_bizberg_check_required_plugin_for_import_demo_data", "bizberg_check_required_plugin_for_import_demo_data" ); function bizberg_check_required_plugin_for_import_demo_data(){ $recommended_plugins = array( 'ocdi' => array( 'installed' => false , 'activate' => false ), 'ultimate_blocks' => array( 'installed' => false , 'activate' => false ) ); if( class_exists( 'OCDI_Plugin' ) ){ $recommended_plugins['ocdi']['installed'] = true; $recommended_plugins['ocdi']['activate'] = true; } elseif( bizberg_is_plugin_installed( 'one-click-demo-import/one-click-demo-import.php' ) ){ $recommended_plugins['ocdi']['installed'] = true; } if( class_exists( 'UAGB_Loader' ) ){ $recommended_plugins['ultimate_blocks']['installed'] = true; $recommended_plugins['ultimate_blocks']['activate'] = true; } elseif( bizberg_is_plugin_installed( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ) ){ $recommended_plugins['ultimate_blocks']['installed'] = true; } echo json_encode( array( 'status' => $recommended_plugins, 'message' => bizberg_plugin_check_notice_customizer( $recommended_plugins ) ) ); die; } function bizberg_plugin_check_notice_customizer( $recommended_plugins ){ if( !( $recommended_plugins['ocdi']['installed'] == false || $recommended_plugins['ocdi']['activate'] == false || $recommended_plugins['ultimate_blocks']['installed'] == false || $recommended_plugins['ultimate_blocks']['activate'] == false ) ){ return; ob_start(); } $to_install_activate = array();; ?>

Required Plugins

To import demo data, you will need the following plugin(s) first.

Install & Activate