'0', "block_display" => null, "box_display" => null, "color_scheme" => '1', "body_txt_color" => null, "body_lnk_color" => null, "body_lnk_hover_color" => null, "body_lnk_visited_color" => null, "main_content_back_color" => null, "h1" => array( "size" => null, 'color' => null, ), "h2" => array( "size" => null, 'color' => null, ), "h3" => array( "size" => null, 'color' => null, ), "h4" => array( "size" => null, 'color' => null, ), "h5" => array( "size" => null, 'color' => null, ), "h6" => array( "size" => null, 'color' => null, ), "widget_border" => null, "page_header" => null, "page_header_bck_img" => null, "page_header_bck_img_width" => null, "page_header_bck_img_height" => null, "page_header_bck_img_alt" => null, "page_header_bck_img_attachment" => 'scroll', "page_header_bck_img_position" => null, "page_header_bck_img_repeat" => "repeat", "page_header_height" => null, "page_header_color" => null, "page_header_layout" => '1', "show_todays_date" => null, "breadcrumbs" => null, "blog_info" => null, "show_sidebar" => null, "default_user_img" => null, "default_user_img_width" => null, "default_user_img_height" => null, "default_user_img_alt" => null, "dynamic_meta_tag" => null, "contact_info" => array( "contact_address" => null, "address_icon" => null, "contact_phone" => null, "phone_icon" => null, "contact_url" => null, "url_icon" => null, "contact_email" => null, "email_icon" => null, "contact_facebook" => null, "facebook_icon" => null, "contact_twitter" => null, "twitter_icon" => null, "contact_google" => null, "google_icon" => null, "contact_linkedin" => null, "linkedin_icon" => null, "contact_instagram" => null, "instagram_icon" => null, "contact_tumblr" => null, "tumblr_icon" => null, "contact_pinterest" => null, "pinterest_icon" => null, "contact_info_layout" => '1', "user_id" => null, "show_address" => null, "show_phone" => null, "show_email" => null, "show_url" => null, "show_social" => null, "share_title" => null, ), "contact_form" => null, "fonts" => array( "body_txt_font_family" => "no_font", "body_txt_font_type" => "system", "body_txt_font_weight" => "regular", "body_txt_font_subsets" => null, "headers_font_family" => "no_font", "headers_font_type" => "system", "headers_font_weight" => "regular", "headers_font_subsets" => null, "main_menu_font_family" => "no_font", "main_menu_font_type" => "system", "main_menu_font_weight" => "regular", "main_menu_font_subsets" => null, ), "facebook_app_id" => null, "google_app_id" => null, "header_sticky" => null, "header_back_color" => null, "header_txt_color" => null, "header_lnk_color" => null, "logo" => null, "logo_width" => null, "logo_height" => null, "logo_alt" => null, "show_contact" => null, "menu_back_color" => null, "menu_lnk_color" => null, "menu_active_color" => null, "submenu_back_color" => null, "submenu_lnk_color" => null, "posts_general" => array( "img_size" => "scale", "sticky_display" => null, "standard_icon" => null, "image_icon" => null, "audio_icon" => null, "video_icon" => null, "gallery_icon" => null, "link_icon" => null, "quote_icon" => null, "author_icon" => null, "date_icon" => null, "categories_icon" => null, "tags_icon" => null, "comments_icon" => null, ), "posts_landing" => array( "layout" => "layout1", 'title_text' => null, "title_border" => "default", 'tagline_text' => null, "tagline_border" => "0", "wrap_class" => null, "title_class" => null, "cols" => "1", "border" => "0", "masonry" => null, "alternate_color" => null, 'sticky_only' => false, 'ignore_sticky' => false, 'limit' => null, "show_title" => null, "show_content" => null, "show_author" => null, "show_date" => null, "show_categories" => null, "show_tags" => null, "show_stats" => null, "show_social" => null, "share_title" => null, "show_icons" => null, "post_meta_layout" => '1', "gallery_slideshow" => null, "quote_layout" => '1', "display_format_icon" => null, ), "posts_single" => array( "override_landing" => null, "layout" => "layout1", 'title_text' => null, "title_border" => "default", 'tagline_text' => null, "tagline_border" => "0", "wrap_class" => null, "title_class" => null, "border" => "0", "show_title" => "on", "show_content" => "on", "show_author" => "on", "show_date" => "on", "show_categories" => "on", "show_tags" => "on", "show_stats" => "on", "show_social" => "on", "share_title" => null, "show_icons" => "on", "post_meta_layout" => '1', "gallery_slideshow" => null, "quote_layout" => '1', "display_format_icon" => null, ), "footer_extended" => null, "footer_bck_color" => null, "footer_txt_color" => null, "footer_lnk_color" => null, "footer_lnk_hover_color" => null, "footer_lnk_visited_color" => null, "copyright" => null, "custom_css" => null, "google_fonts_url" => null, ); return apply_filters( 'blogcentral_option_defaults', $blogcentral_defaults ); } /** * Initial values for options * * Used if the $blogcentral_opts variable is empty, meaning it has never been saved to the database. * * @since 1.0.0 */ function blogcentral_get_option_initial() { global $blogcentral_defaults; $blogcentral_initial = array_merge( $blogcentral_defaults, array( "logo" => BLOGCENTRAL_THEME_URL . "/images/preview/full-dark-logo.png", "page_header" => 'on', "page_header_bck_img" => BLOGCENTRAL_THEME_URL . "/images/preview/waterleaves.jpg", "page_header_bck_img_alt" => 'placeholder', "page_header_bck_img_attachment" => 'fixed', "page_header_bck_img_repeat" => "repeat", "page_header_color" => "white", "page_header_layout" => '1', 'posts_landing' => array_merge( $blogcentral_defaults['posts_landing'], array( 'show_title' => 'on', 'show_author' => 'on', 'show_date' => 'on', 'show_stats' => 'on', 'show_categories' => 'on', 'show_tags' => 'on', 'show_content' => 'on', 'show_social' => 'on', 'show_icons' => 'on', ) ), "copyright" => "logo" . sprintf( __( "Copyright © 2015 %s All Rights Reserved", BLOGCENTRAL_TXT_DOMAIN ), get_bloginfo( 'name' ) ), ) ); return apply_filters( 'blogcentral_option_initial', $blogcentral_initial ); } /** * Initialize global theme option variable * * @since 1.0.1 */ function blogcentral_initialize_global_opts() { global $blogcentral_initial; global $blogcentral_opts; // Get cached theme options, if not cached, then use get_option. if ( ! is_admin() && ! is_home() ) { $cached_opts = get_transient( 'blogcentral_options' ); if ( ! $cached_opts ) { $blogcentral_opts = get_option( BLOGCENTRAL_DB_OPTIONS_NAME ); set_transient( 'blogcentral_options', $blogcentral_opts, 21 * DAY_IN_SECONDS ); } else { $blogcentral_opts = $cached_opts; } } else { $blogcentral_opts = get_option( BLOGCENTRAL_DB_OPTIONS_NAME ); } if ( empty( $blogcentral_opts ) ) { $blogcentral_opts = $blogcentral_initial; } return $blogcentral_opts; } /** * Predefined options for the demos. * * @since 1.0.1 */ function blogcentral_get_demos_opts() { $blogcentral_demos_opts = array( array( "blog_demo" => '1', "color_scheme" => "4", "widget_border" => "div3", "page_header" => 'on', "page_header_bck_img" => BLOGCENTRAL_THEME_URL . "/images/preview/waterleaves.jpg", "page_header_bck_img_alt" => __( 'placeholder', BLOGCENTRAL_TXT_DOMAIN ), "page_header_bck_img_attachment" => 'fixed', "page_header_bck_img_repeat" => "repeat", "page_header_color" => "white", "page_header_layout" => '1', "breadcrumbs" => "on", "show_sidebar"=>"on", "default_user_img" => BLOGCENTRAL_THEME_URL . "/images/placeholder.png", "default_user_img_alt" => __( 'default user image', BLOGCENTRAL_TXT_DOMAIN ), "contact_info" => array( "contact_address" => __( "Cincinnati OH", BLOGCENTRAL_TXT_DOMAIN ), "address_icon" => "fa-home", "contact_info_layout" =>' 1', ), "header_sticky" => "on", "logo" => BLOGCENTRAL_THEME_URL . "/images/preview/full-dark-logo.png", "logo_alt" => __( "logo", BLOGCENTRAL_TXT_DOMAIN ), "submenu_back_color" => "#333", "submenu_lnk_color" => "white", "posts_general" => array( "img_size" => "scale", "standard_icon" => "fa-pencil", "image_icon" => "fa-camera", "audio_icon" => "fa-music", "video_icon" => "fa-video-camera", "gallery_icon" => "fa-picture-o", "link_icon" => "fa-chain-broken", "quote_icon" => "fa-quote-left", "author_icon" => "fa-user", "date_icon" => "fa-clock-o", "categories_icon" => "fa-folder", "tags_icon" => "fa-tags", "comments_icon" => "fa-comments-o", ), "posts_landing" => array( "layout" => "layout1", "cols" => "1", "border" => "0", "masonry" => "on", "show_title" => "on", "show_content" => "on", "show_author" => "on", "show_date" => "on", "show_categories" => "on", "show_tags" => "on", "show_stats" => "on", "show_social" => "on", "share_title" => null, "show_icons" => "on", "post_meta_layout" => '1', "gallery_slideshow" => "on", "quote_layout" => '2', ), "posts_single" => array(), "footer_extended" => "on", "copyright" => "logo" . sprintf( __( "Copyright © 2015 %s All Rights Reserved", BLOGCENTRAL_TXT_DOMAIN ), get_bloginfo( 'name' ) ), "custom_css" => " #main-content { background-color: transparent; } .single-post #main-posts-cont { border-bottom: 3px double #eee; } .contact-form { background-color: white; padding: 20px; } #comments,.contact-form, .author-bio, #main-content .widget-container { padding:36px 20px !important; background-color: white; margin-bottom: 32px; } ", ), array( "blog_demo" => '2', "color_scheme" => "4", "widget_border" => "div3", "page_header" => 'on', "page_header_bck_img" => BLOGCENTRAL_THEME_URL . "/images/preview/waterleaves.jpg", "page_header_bck_img_alt" => __( 'placeholder', BLOGCENTRAL_TXT_DOMAIN ), "page_header_bck_img_attachment" => 'fixed', "page_header_bck_img_repeat" => "repeat", "page_header_color" => "white", "page_header_layout" => '2', "breadcrumbs" => "on", "default_user_img" => BLOGCENTRAL_THEME_URL . "/images/placeholder.png", "default_user_img_alt" => __( 'default user image', BLOGCENTRAL_TXT_DOMAIN ), "contact_info" => array( "contact_address" => __( "Cincinnati OH", BLOGCENTRAL_TXT_DOMAIN ), "address_icon" => "fa-home", "contact_info_layout" =>' 1', ), "header_sticky" => "on", "logo" => BLOGCENTRAL_THEME_URL . "/images/preview/full-dark-logo.png", "logo_alt" => __( "logo", BLOGCENTRAL_TXT_DOMAIN ), "submenu_back_color" => "#333", "submenu_lnk_color" => "white", "posts_general" => array( "img_size" => "scale", "standard_icon" => "fa-pencil", "image_icon" => "fa-camera", "audio_icon" => "fa-music", "video_icon" => "fa-video-camera", "gallery_icon" => "fa-picture-o", "link_icon" => "fa-chain-broken", "quote_icon" => "fa-quote-left", "author_icon" => "fa-user", "date_icon" => "fa-clock-o", "categories_icon" => "fa-folder", "tags_icon" => "fa-tags", "comments_icon" => "fa-comments-o", ), "posts_landing" => array( "layout" => "layout1", "cols" => "3", "border" => "0", "masonry" => "on", "show_title" => "on", "show_content" => "on", "show_author" => "on", "show_date" => "on", "show_categories" => "on", "show_tags" => "on", "show_stats" => "on", "show_social" => "on", "share_title" => null, "show_icons" => "on", "post_meta_layout" => '1', "gallery_slideshow" => "on", "quote_layout" => '2', ), "posts_single" => array(), "footer_extended" => "on", "copyright" => "logo" . sprintf( __( "Copyright © 2015 %s All Rights Reserved", BLOGCENTRAL_TXT_DOMAIN ), get_bloginfo( 'name' ) ), "custom_css" => " #main-content { background-color: transparent; } .single-post #main-posts-cont { border-bottom: 3px double #eee; } .contact-form { background-color: white; padding: 20px; } #comments,.contact-form, .author-bio, #main-content .widget-container { padding:36px 20px !important; background-color: white; margin-bottom: 32px; } ", ), array( "blog_demo" => '3', "color_scheme" => "4", "widget_border" => "div3", "page_header" => 'on', "page_header_bck_img" => BLOGCENTRAL_THEME_URL . "/images/preview/waterleaves.jpg", "page_header_bck_img_alt" => __( 'placeholder', BLOGCENTRAL_TXT_DOMAIN ), "page_header_bck_img_attachment" => 'fixed', "page_header_bck_img_repeat" => "repeat", "page_header_color" => "white", "page_header_layout" => '3', "breadcrumbs" => "on", "default_user_img" => BLOGCENTRAL_THEME_URL . "/images/placeholder.png", "default_user_img_alt" => __( 'default user image', BLOGCENTRAL_TXT_DOMAIN ), "contact_info" => array( "contact_address" => __( "Cincinnati OH", BLOGCENTRAL_TXT_DOMAIN ), "address_icon" => "fa-home", "contact_info_layout" => '1', ), "header_sticky" => "on", "logo" => BLOGCENTRAL_THEME_URL . "/images/preview/full-dark-logo.png", "logo_alt" => __( "logo", BLOGCENTRAL_TXT_DOMAIN ), "submenu_back_color" => "#333", "submenu_lnk_color" => "white", "posts_general" => array( "img_size" => "scale", "standard_icon" => "fa-pencil", "image_icon" => "fa-camera", "audio_icon" => "fa-music", "video_icon" => "fa-video-camera", "gallery_icon" => "fa-picture-o", "link_icon" => "fa-chain-broken", "quote_icon" => "fa-quote-left", "author_icon" => "fa-user", "date_icon" => "fa-clock-o", "categories_icon" => "fa-folder", "tags_icon" => "fa-tags", "comments_icon" => "fa-comments-o", ), "posts_landing" => array( "layout" => "layout2", "cols" => "1", "border" => "0", "masonry" => "on", "show_title" => "on", "show_content" => "on", "show_author" => "on", "show_date" => "on", "show_categories" => "on", "show_tags" => "on", "show_stats" => "on", "show_social" => "on", "share_title" => null, "show_icons" => "on", "post_meta_layout" => '1', "gallery_slideshow" => "on", "quote_layout" => '2', ), "posts_single" => array( "override_landing" => "on", "layout" => "layout1", "cols" => "1", "border" => "0", "masonry" => "on", "show_title" => "on", "show_content" => "on", "show_author" => "on", "show_date" => "on", "show_categories" => "on", "show_tags" => "on", "show_stats" => "on", "show_social" => "on", "share_title" => null, "show_icons" => "on", "post_meta_layout" => '1', "gallery_slideshow" => "on", "quote_layout" => '2', ), "footer_extended" => "on", "copyright" => "logo" . sprintf( __( "Copyright © 2015 %s All Rights Reserved", BLOGCENTRAL_TXT_DOMAIN ), get_bloginfo( 'name' ) ), "custom_css" => " #main-content { background-color: transparent; } .single-post #main-posts-cont { border-bottom: 3px double #eee; } .contact-form { background-color: white; padding: 20px; } #comments,.contact-form, .author-bio, #main-content .widget-container { padding:36px 20px !important; background-color: white; margin-bottom: 32px; } ", ), ); return apply_filters( 'blogcentral_demos_opts', $blogcentral_demos_opts ); } if ( ! function_exists( 'blogcentral_theme_setup' ) ) { /** * Theme setup * * @since 1.0.0 */ function blogcentral_theme_setup() { // Register the main navigation menu register_nav_menu( 'primary', __( 'Primary Menu', BLOGCENTRAL_TXT_DOMAIN ) ); /* * Make theme available for translation. * Translations can be saved in the /languages/ directory. */ load_theme_textdomain( BLOGCENTRAL_TXT_DOMAIN, get_template_directory() . '/languages' ); // This theme styles the visual editor to resemble the theme style. add_editor_style( array( 'css/editor-style.css' ) ); // Add RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Add title-tag support. add_theme_support( "title-tag" ); /** * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); // This theme supports custom background color and image. add_theme_support( 'custom-background' ); // This theme supports the following post formats by default. add_theme_support( 'post-formats', array( 'audio', 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video', ) ); // Support post thumbnails. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 604, 270, true ); } } if ( ! function_exists( 'blogcentral_register_widgets_areas' ) ) { /** * Register widgetized areas * * @since 1.0.0 */ function blogcentral_register_widgets_areas() { $extra_class = ''; global $blogcentral_opts; // Add class for default widget border, if set if ( isset( $blogcentral_opts['widget_border'] ) ) { $extra_class .= ' ' . $blogcentral_opts['widget_border']; } register_sidebar( array( 'name' => __( 'Header Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'header-widget', 'description' => __( 'Widgets in this area will be shown in the header area if layout is 2, to the left of the logo. Ideal for advertisement banner or search form. The size is 77% by 50px.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'PreContent Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'precontent-widget', 'description' => __( 'Widgets in this area will be shown in the main content, above the posts and sidebar. Ideal for a slideshow. Is full width with no left and right spacing.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'PreContent Widget About Me', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'precontent-widget-about-me', 'description' => __( 'Widgets in this area will be shown on the about me page in the main content, above the posts and sidebar. It is ideal for a slideshow. Is full width with no left and right spacing.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Preposts Left Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'preposts-widget-left', 'description' => __( 'Widgets in this area will be shown in the main content area of the blog landing page on the left,above the main posts. It is recommended that if you place widgets in this area, do so in the preposts right widget area also. If no widgets are dragged into the area, will not show anything.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'PrePosts Right Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'preposts-widget-right', 'description' => __( 'Widgets in this area will be shown in the main content area of the blog landing page on the right,above the main posts. It is recommended that if you place widgets in this area, do so in the preposts left widget area also. If no widgets are dragged into the area, will not show anything.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Main Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'main-widget', 'description' => __( 'This area is where the main wordpress loop is shown. You can override this behavior by dragging widgets to this area.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Post Posts Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'post-posts-widget', 'description' => __( 'Widgets in this area will be shown in the main content, below the posts and sidebar. It is ideal for advertisement or a call to action box. Is full width, with no side paddings.', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar Right', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'sidebar-rght', 'description' => __( 'Widgets in this area will be shown in the right sidebar', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Single Post After Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'single-post-after-widget', 'description' => __( 'Widgets in this area will be shown on single post pages, immediately below the author bio. It is ideal for related posts. ', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Left Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'footer-widget-lft', 'description' => __( 'Widgets in this area will be shown in the left footer column', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Middle Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'footer-widget-mid', 'description' => __( 'Widgets in this area will be shown in the center footer column', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Right Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'footer-widget-rght', 'description' => __( 'Widgets in this area will be shown in the right footer column', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Bottom Left Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'footer-widget-btm-lft', 'description' => __( 'Widgets in this area will be shown in the bottom left footer column', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Bottom Right Widget', BLOGCENTRAL_TXT_DOMAIN ), 'id' => 'footer-widget-btm-rght', 'description' => __( 'Widgets in this area will be shown in the bottom right footer column', BLOGCENTRAL_TXT_DOMAIN ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } } /** * 5.0 Admin Side Functions *-----------------------------------------------------------------------*/ /** * 5.1 Enqueue Scripts & Style *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_admin_scripts' ) ) { /** * Enqueue scripts and style needed on admin side. * * @since 1.0.0 */ function blogcentral_admin_scripts() { $screen = get_current_screen(); if ( ( isset( $_GET['page'] ) && 'blogcentral_options' === $_GET['page'] ) || 'post' === $screen->id || 'page' === $screen->id || 'product' === $screen->id || 'widgets' === $screen->id ) { // Enqueue jquery and jquery ui. wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-tabs' ); wp_enqueue_script( 'jquery-ui-sortable' ); wp_enqueue_script( 'jquery-ui-datepicker' ); // Enqueue wordpress media uploader. wp_enqueue_media(); // Enqueue color picker. wp_enqueue_style( 'wp-color-picker' ); // Enqueue administration script. wp_enqueue_script( 'blogcentral-admin-script', BLOGCENTRAL_THEME_URL .'/js/admin.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-sortable', 'wp-color-picker', ) ); // Enqueue styles. wp_enqueue_style( 'blogcentral-font-awesome', BLOGCENTRAL_THEME_URL . '/font-awesome/css/font-awesome.min.css' ); // Load the main stylesheet. wp_enqueue_style( 'blogcentral-admin', BLOGCENTRAL_THEME_URL . '/css/admin.css' ); $nonce = wp_create_nonce( "blogcentral-display-template-nonce" ); // Font awesome variable. $fa = array( 'fa-glass','fa-music','fa-search','fa-envelope-o','fa-heart','fa-star','fa-star-o', 'fa-user','fa-film','fa-th-large', 'fa-th', 'fa-th-list', 'fa-check', 'fa-times', 'fa-search-plus', 'fa-search-minus', 'fa-power-off', 'fa-signal', 'fa-gear', 'fa-cog', 'fa-trash-o', 'fa-home', 'fa-file-o', 'fa-clock-o', 'fa-road', 'fa-download', 'fa-arrow-circle-o-down', 'fa-arrow-circle-o-up', 'fa-inbox', 'fa-play-circle-o', 'fa-rotate-right', 'fa-repeat', 'fa-refresh', 'fa-list-alt', 'fa-lock', 'fa-flag', 'fa-headphones', 'fa-volume-off', 'fa-volume-down', 'fa-volume-up', 'fa-qrcode', 'fa-barcode', 'fa-tag', 'fa-tags', 'fa-book', 'fa-bookmark', 'fa-print', 'fa-camera', 'fa-font', 'fa-bold', 'fa-italic', 'fa-text-height', 'fa-text-width', 'fa-align-left', 'fa-align-center', 'fa-align-right', 'fa-align-justify', 'fa-list', 'fa-dedent', 'fa-outdent', 'fa-indent', 'fa-video-camera', 'fa-picture-o', 'fa-pencil', 'fa-map-marker', 'fa-adjust', 'fa-tint', 'fa-edit', 'fa-pencil-square-o', 'fa-share-square-o', 'fa-check-square-o', 'fa-arrows', 'fa-step-backward', 'fa-fast-backward', 'fa-backward', 'fa-play', 'fa-pause', 'fa-stop', 'fa-forward', 'fa-fast-forward', 'fa-step-forward', 'fa-eject', 'fa-chevron-left', 'fa-chevron-right', 'fa-plus-circle', 'fa-minus-circle', 'fa-times-circle', 'fa-check-circle', 'fa-question-circle', 'fa-info-circle', 'fa-crosshairs', 'fa-times-circle-o', 'fa-check-circle-o', 'fa-ban', 'fa-arrow-left', 'fa-arrow-right', 'fa-arrow-up', 'fa-arrow-down', 'fa-mail-forward', 'fa-share', 'fa-expand', 'fa-compress', 'fa-plus', 'fa-minus', 'fa-asterisk', 'fa-exclamation-circle', 'fa-gift', 'fa-leaf', 'fa-fire', 'fa-eye', 'fa-eye-slash', 'fa-warning', 'fa-exclamation-triangle', 'fa-plane', 'fa-calendar', 'fa-random', 'fa-comment', 'fa-magnet', 'fa-chevron-up', 'fa-chevron-down', 'fa-retweet', 'fa-shopping-cart', 'fa-folder', 'fa-folder-open', 'fa-arrows-v', 'fa-arrows-h', 'fa-bar-chart-o', 'fa-twitter-square', 'fa-facebook-square', 'fa-camera-retro', 'fa-key', 'fa-gears', 'fa-cogs', 'fa-comments', 'fa-thumbs-o-up',' fa-thumbs-o-down', 'fa-star-half', 'fa-heart-o', 'fa-sign-out', 'fa-linkedin-square', 'fa-thumb-tack', 'fa-external-link', 'fa-sign-in', 'fa-trophy', 'fa-github-square', 'fa-upload', 'fa-lemon-o', 'fa-phone', 'fa-square-o', 'fa-bookmark-o', 'fa-phone-square', 'fa-twitter', 'fa-facebook', 'fa-github', 'fa-unlock', 'fa-credit-card', 'fa-rss', 'fa-hdd-o', 'fa-bullhorn', 'fa-bell', 'fa-certificate', 'fa-hand-o-right', 'fa-hand-o-left', 'fa-hand-o-up', 'fa-hand-o-down', 'fa-arrow-circle-left', 'fa-arrow-circle-right', 'fa-arrow-circle-up', 'fa-arrow-circle-down', 'fa-globe', 'fa-wrench','fa-tasks', 'fa-filter', 'fa-briefcase', 'fa-arrows-alt', 'fa-group', 'fa-users', 'fa-chain', 'fa-link', 'fa-cloud', 'fa-flask', 'fa-cut', 'fa-scissors', 'fa-copy', 'fa-files-o', 'fa-paperclip', 'fa-save', 'fa-floppy-o', 'fa-square', 'fa-bars', 'fa-list-ul', 'fa-list-ol', 'fa-strikethrough', 'fa-underline', 'fa-table', 'fa-magic', 'fa-truck', 'fa-pinterest', 'fa-pinterest-square', 'fa-google-plus-square', 'fa-google-plus', 'fa-money', 'fa-caret-down', 'fa-caret-up', 'fa-caret-left', 'fa-caret-right', 'fa-columns', 'fa-unsorted', 'fa-sort', 'fa-sort-down', 'fa-sort-asc', 'fa-sort-up', 'fa-sort-desc', 'fa-envelope', 'fa-linkedin', 'fa-rotate-left', 'fa-undo', 'fa-legal', 'fa-gavel', 'fa-dashboard', 'fa-tachometer', 'fa-comment-o', 'fa-comments-o', 'fa-flash', 'fa-bolt', 'fa-sitemap', 'fa-umbrella', 'fa-paste', 'fa-clipboard', 'fa-lightbulb-o', 'fa-exchange', 'fa-cloud-download', 'fa-cloud-upload', 'fa-user-md', 'fa-stethoscope', 'fa-suitcase', 'fa-bell-o', 'fa-coffee', 'fa-cutlery', 'fa-file-text-o', 'fa-building-o', 'fa-hospital-o', 'fa-ambulance', 'fa-medkit', 'fa-fighter-jet', 'fa-beer', 'fa-h-square', 'fa-plus-square', 'fa-angle-double-left', 'fa-angle-double-right', 'fa-angle-double-up', 'fa-angle-double-down', 'fa-angle-left', 'fa-angle-right', 'fa-angle-up', 'fa-angle-down', 'fa-desktop', 'fa-laptop', 'fa-tablet', 'fa-mobile-phone', 'fa-mobile', 'fa-circle-o', 'fa-quote-left', 'fa-quote-right', 'fa-spinner', 'fa-circle', 'fa-mail-reply', 'fa-reply', 'fa-github-alt', 'fa-folder-o', 'fa-folder-open-o', 'fa-smile-o', 'fa-frown-o', 'fa-meh-o', 'fa-gamepad', 'fa-keyboard-o', 'fa-flag-o', 'fa-flag-checkered', 'fa-terminal', 'fa-code', 'fa-reply-all', 'fa-mail-reply-all', 'fa-star-half-empty', 'fa-star-half-full', 'fa-star-half-o', 'fa-location-arrow', 'fa-crop', 'fa-code-fork', 'fa-unlink', 'fa-chain-broken', 'fa-question', 'fa-info', 'fa-exclamation', 'fa-superscript', 'fa-subscript', 'fa-eraser', 'fa-puzzle-piece', 'fa-microphone', 'fa-microphone-slash', 'fa-shield', 'fa-calendar-o', 'fa-fire-extinguisher', 'fa-rocket', 'fa-maxcdn', 'fa-chevron-circle-left', 'fa-chevron-circle-right', 'fa-chevron-circle-up', 'fa-chevron-circle-down', 'fa-html5', 'fa-css3', 'fa-anchor', 'fa-unlock-alt', 'fa-bullseye', 'fa-ellipsis-h', 'fa-ellipsis-v', 'fa-rss-square', 'fa-play-circle', 'fa-ticket', 'fa-minus-square', 'fa-minus-square-o', 'fa-level-up', 'fa-level-down', 'fa-check-square', 'fa-pencil-square', 'fa-external-link-square', 'fa-share-square', 'fa-compass', 'fa-toggle-down', 'fa-caret-square-o-down', 'fa-toggle-up', 'fa-caret-square-o-up', 'fa-toggle-right', 'fa-caret-square-o-right', 'fa-euro', 'fa-eur', 'fa-gbp', 'fa-dollar', 'fa-usd', 'fa-rupee', 'fa-inr', 'fa-cny', 'fa-rmb', 'fa-yen', 'fa-jpy', 'fa-ruble', 'fa-rouble', 'fa-rub', 'fa-won', 'fa-krw', 'fa-bitcoin', 'fa-btc', 'fa-file', 'fa-file-text', 'fa-sort-alpha-asc', 'fa-sort-alpha-desc', 'fa-sort-amount-asc', 'fa-sort-amount-desc', 'fa-sort-numeric-asc', 'fa-sort-numeric-desc', 'fa-thumbs-up', 'fa-thumbs-down', 'fa-youtube-square', 'fa-youtube', 'fa-xing', 'fa-xing-square', 'fa-youtube-play', 'fa-dropbox', 'fa-stack-overflow', 'fa-instagram', 'fa-flickr', 'fa-adn', 'fa-bitbucket', 'fa-bitbucket-square', 'fa-tumblr', 'fa-tumblr-square', 'fa-long-arrow-down', 'fa-long-arrow-up', 'fa-long-arrow-left', 'fa-long-arrow-right', 'fa-apple', 'fa-windows', 'fa-android', 'fa-linux', 'fa-dribbble', 'fa-skype', 'fa-foursquare', 'fa-trello', 'fa-female', 'fa-male', 'fa-gittip', 'fa-sun-o', 'fa-moon-o', 'fa-archive', 'fa-bug', 'fa-vk', 'fa-weibo', 'fa-renren', 'fa-pagelines', 'fa-stack-exchange', 'fa-arrow-circle-o-right', 'fa-arrow-circle-o-left', 'fa-toggle-left', 'fa-caret-square-o-left', 'fa-dot-circle-o', 'fa-wheelchair', 'fa-vimeo-square', 'fa-turkish-lira', 'fa-try', 'fa-plus-square-o', 'fa-area-chart', 'fa-at', 'fa-angellist', 'fa-bell-slash', 'fa-bell-slash-o', 'fa-bicycle', 'fa-binoculars', 'fa-birthday-cake', 'fa-bus', 'fa-calculator', 'fa-cc', 'fa-cc-amex', 'fa-cc-discover', 'fa-cc-mastercard', 'fa-cc-paypal', 'fa-cc-stripe', 'fa-cc-visa', 'fa-copyright', 'fa-eyedropper', 'fa-futbol-o', 'fa-google-wallet', 'fa-ils', 'fa-ioxhost', 'fa-lastfm', 'fa-lastfm-square', 'fa-line-chart', 'fa-meanpath', 'fa-newspaper-o', 'fa-paint-brush', 'fa-paypal', 'fa-pie-chart', 'fa-plug', 'fa-shekel', 'fa-sheqel', 'fa-slideshare', 'fa-soccer-ball-o', 'fa-toggle-off', 'fa-toggle-on', 'fa-trash', 'fa-tty', 'fa-twitch', 'fa-wifi', 'fa-yelp', 'fa-bed', 'fa-buysellads', 'fa-cart-arrow-down', 'fa-cart-plus', 'fa-connectdevelop', 'fa-dashcube', 'fa-diamond', 'fa-facebook-official', 'fa-forumbee', 'fa-heartbeat', 'fa-hotel', 'fa-leanpub', 'fa-mars', 'fa-mars-double', 'fa-mars-stroke', 'fa-mars-stroke-h', 'fa-mars-stroke-v', 'fa-medium', 'fa-mercury', 'fa-motorcycle', 'fa-neuter', 'fa-pinterest-p', 'fa-sellsy', 'fa-server', 'fa-ship', 'fa-shirtsinbulk', 'fa-simplybuilt', 'fa-skyatlas', 'fa-street-view', 'fa-subway', 'fa-train', 'fa-transgender', 'fa-transgender-alt', 'fa-user-plus', 'fa-user-secret', 'fa-user-times', 'fa-venus', 'fa-venus-double', 'fa-venus-mars', 'fa-viacoin', 'fa-whatsapp', ); // Localize admin script. wp_localize_script( 'blogcentral-admin-script', 'blogcentral_object', array( 'close' => __( 'close', BLOGCENTRAL_TXT_DOMAIN ), 'Delete' => __( 'Delete', BLOGCENTRAL_TXT_DOMAIN ), 'name' => __( 'name', BLOGCENTRAL_TXT_DOMAIN ), 'choose_image' => __( 'Choose Image', BLOGCENTRAL_TXT_DOMAIN ), 'admin_template_ajax' => admin_url( 'admin-ajax.php?action=blogcentral_display_template_ajax&nonce=' . $nonce ), 'fa_items' => $fa, ) ); } } } /** * 5.2 Add Theme Options Page + Help Tabs *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_theme_options_add_page' ) ) { /** * Add the theme's options page to the wordpress administrative menu * * @since 1.0.0 */ function blogcentral_theme_options_add_page() { $options_page = add_theme_page( __( 'Theme Options', BLOGCENTRAL_TXT_DOMAIN ), __( 'Theme Options', BLOGCENTRAL_TXT_DOMAIN ), 'edit_theme_options', BLOGCENTRAL_PAGE_SLUG, 'blogcentral_front_controller' ); if ( ! $options_page ) { return; } // Add my_help_tab when theme options page loads. add_action( 'load-'.$options_page, 'blogcentral_add_help_tab' ); } } if ( ! function_exists( 'blogcentral_add_help_tab' ) ) { /** * Add help tabs on theme's options page * * @since 1.0.0 */ function blogcentral_add_help_tab() { $screen = get_current_screen(); // Add help tab for each blogcentral options tab, if deemed necessary. $screen->add_help_tab( array( 'id' => 'blogcentral-help-general-tab', 'title' => __( 'General', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_general_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-colors-api-tab', 'title' => __( 'General Background, Color, & Sizes', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_colors_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-typography-tab', 'title' => __( 'Typography', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_typography_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-social-api-tab', 'title' => __( 'Social Apps', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_social_api_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-contact-tab', 'title' => __( 'Contact Information', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_contact_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-header-tab', 'title' => __( 'Header', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_header_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-nav-menu-tab', 'title' => __( 'Main Navigation Menu', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_nav_menu_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-page-header-tab', 'title' => __( 'Page Header', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_page_header_help_tab(), ) ); $screen->add_help_tab( array( 'id' => 'blogcentral-help-posts-tab', 'title' => __( 'Posts', BLOGCENTRAL_TXT_DOMAIN ), 'content' => blogcentral_construct_posts_help_tab(), ) ); } } if ( ! function_exists( 'blogcentral_construct_general_help_tab' ) ) { /** * Construct help panel for the general tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_general_help_tab() { $html = '

' . __( 'First we would like to say Thank You for downloading the BlogCentral Theme. The following provides some information about using the theme options page. For more detailed information, consult the readme.txt file and the theme\'s online documentation at http://4bzthemes/knowledgebase', BLOGCENTRAL_TXT_DOMAIN ) . ' ' . __( 'Documentation on ', BLOGCENTRAL_TXT_DOMAIN ) . BLOGCENTRAL_THEME_NAME . '.' . '

' . __( 'Demos', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral provides 3 predefined demos to choose. The demos define values for some of the theme options. Choosing a demo should be the first step, since it will delete all of your saved options. When you select the demo you would like to use, immediately click on the "Change Demo" button, this will save the demo options as the theme options. You can further customize the options, if desired, by using the theme options page. The demo settings, just like the theme options, if applicable, will apply to all pages.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . '

' . __( 'Making your site look like the demos', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Your site will almost look exactly like the demos except for maybe, your logo, posts, and widgets. You can download an xml file for the demo content, which will include the posts. For the widgets, you will have to download the widgets.json file, and have the Widget Import/Export plugin installed and activated. For more detailed information read this tutorial.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . '

' . __( 'Front End Demo Pages', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral provides page templates used to demonstrate the demos. You have the choice to use them or not, but if you do, please read the following. Whenever a user chooses a demo to view on the front end, its options will be the active theme options, until the home page, or another demo is chosen on the front end, for example from the main navigation menu. If you change the theme options on the admin side, and do not see these changes on the front end, you will have to navigate to the home page, effectively changing the options from the previously viewed demo, to the options saved from the theme options page.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_contact_help_tab' ) ) { /** * Construct help panel for the contact tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_contact_help_tab() { $html = '

' . __( 'Icons', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'To choose an icon, click inside the input textbox.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Contact Form', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'This theme is compatible with any plugin that displays contact forms via a shortcode. If you would like to display a contact form, enter the shortcode generated by the plugin in the textarea.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_typography_help_tab' ) ) { /** * Construct help panel for the typography tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_typography_help_tab() { $html = '

' . __( 'You can customize the font family, weight and style, and subsets for the body text, headers, and menu items. Choose from traditional system fonts and google fonts.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_social_api_help_tab' ) ) { /** * Construct help panel for the social api tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_social_api_help_tab() { $html = '

' . __( 'Third Party APIs', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'If you would like to use the facebook comments, and google maps and fonts, you must provide your API keys for each platform. Visit their website to obtain this information.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_colors_help_tab' ) ) { /** * Construct help panel for the general tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_colors_help_tab() { $html = '

' . __( 'The "General Background, Colors, & Sizes" tab is where you can choose a color scheme, customize the color for the body text, links, and headers, the background color for the main content, and the size of the header tags.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Choosing Colors', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral uses the native Wordpress color picker to choose a color. You can also enter the color manually. Examples: #ffffff, rgb(255,255,255) or white.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Background Images', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'To choose a background image or color for the body, navigate to "Appearance->Background" on the admin sidebar', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Font sizes, padding, margins, widths and heights.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Enter font sizes, padding, margins, widths, and heights with unit of measurement, eg. 12px, 1.2rem etc. For dimensions of an image, do not include a unit of measurement.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_header_help_tab' ) ) { /** * Construct help panel for the header tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_header_help_tab() { $html = '

' . __( 'The "Header" tab is where you customize the appearance of the header. The header is the top area of the page that holds the logo, header widget, and the main navigation menu.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Contact Information Display', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral provides options to display the contact information for a company or an individual. If you would like to display the contact information, the BlogCentral Shortcodes & Widgets Pack plugin must be installed and activated. If the option for a user id is blank, then the contact information entered in the contact tab on the theme\'s options page will be used, otherwise the contact information for the user of the provided user id will be displayed. For social media contacts, enter the full url, ie. http://www.facebook.com/username.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_nav_menu_help_tab' ) ) { /** * Construct help panel for the header tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_nav_menu_help_tab() { $html = '

' . __( 'The "Main Navigation Menu" tab is where you customize the appearance of the main navigation menu and its submenus. You can customize the color for the background, links, and active links.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_page_header_help_tab' ) ) { /** * Construct help panel for the page header tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_page_header_help_tab() { $html = '

' . __( 'The "Page Header" tab is where you customize the appearance of the page header. The page header sits immediately below the header. This area is widgetized and is also called the precontent widget. If no widgets are active, then it serves as the page header and a box with an image and an overlay that shows what page is being viewed, today\'s date, and the breadcrumbs will be shown, if enabled.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Height', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'You can define a height for the page header, enter it with the unit of measurement, ex. 150px.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Page Header Layouts', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral provides 3 page header layouts.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } if ( ! function_exists( 'blogcentral_construct_posts_help_tab' ) ) { /** * Construct help panel for the posts tab * * @since 1.0.0 * * @return string help instructions. */ function blogcentral_construct_posts_help_tab() { $html = '

' . __( 'Posts Listing Pages', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'These options will affect the appearance of the posts listing in the main area on all pages that display a posts listing in a div with id #main-area, eg. index, archive, author, search, category and tags pages.', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'Single Post Page', BLOGCENTRAL_TXT_DOMAIN ) . '

' . __( 'BlogCentral offers the option to use the same settings of the posts listing page for the single post page. If you choose to override the settings, then none of them will be used for the single post page.', BLOGCENTRAL_TXT_DOMAIN ) . '

'; return $html; } } /** * 5.3 Controller + Save Theme Settings *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_front_controller' ) ) { /** * Route url requests to the appropriate function. * * @since 1.0.0 */ function blogcentral_front_controller() { $action = isset( $_GET['action'] ) ? $_GET['action'] : ( isset( $_POST['action'] ) ? $_POST['action'] : '' ); if ( isset( $_GET['page'] ) && 'blogcentral_options' === $_GET['page'] ) { switch ( $action ) { case 'blogcentral_options': default: blogcentral_theme_options(); } }// End if } } if ( ! function_exists( 'blogcentral_validate_options' ) ) { /** * Perform security checks on theme options * * Construct the google fonts url for any google font option selected. * * @since 1.0.0 */ function blogcentral_validate_options() { global $blogcentral_opts; global $blogcentral_defaults; $check_text = array( "default_user_img_alt", 'contact_address', "contact_phone", "address_icon", "phone_icon", "url_icon", "email_icon", "facebook_icon", "twitter_icon", "google_icon", "linkedin_icon", "instagram_icon", "tumblr_icon", "pinterest_icon", "facebook_app_id", "google_app_id", "logo_alt", "img_size", "standard_icon", "image_icon", "audio_icon", "video_icon", "gallery_icon", "link_icon", "quote_icon", "author_icon", "date_icon", "categories_icon", "tags_icon", "comments_icon", ); $check_int = array( "color_scheme", "page_header_bck_img_width", "page_header_bck_img_height", "default_user_img_width", "default_user_img_height", "user_id", ); $check_url = array( 'contact_url', 'contact_facebook', 'contact_twitter', 'contact_google', 'contact_linkedin', 'contact_instagram', 'contact_tumblr', 'contact_pinterest', ); $check_email = array( 'contact_email', ); $check_html = array( 'copyright', ); $check_html_limited = array( 'title_text', 'tagline_text', "share_title", ); $check_html_class = array( "wrap_class", "title_class", ); // Only allow these tags with these attributes. $kses_allow = array( 'a' => array( 'href' => array(), 'title' => array(), ), 'br' => array(), 'span' => array( 'id' => array(), 'class' => array(), ), ); // Do server-side validations $excpts = false; $options = array(); if ( ! is_array( $_POST ) ) { // Error do not save. add_settings_error( 'Post-not-array', esc_attr( 'not-array' ), __( 'Error: The post variable is corrupted. Please contact the administrator.', BLOGCENTRAL_TXT_DOMAIN ), 'error' ); $excpts = true; } else { foreach ( $_POST['blogcentral'] as $post => $vpost ) { // First check if it is a valid theme option. if ( ! array_key_exists( $post, $blogcentral_defaults ) ) { continue; } if ( is_array( $vpost ) ) { $flag = false; $temp = array(); foreach ( $vpost as $key => $val ) { if ( '' !== $val ) { // Do security checks if ( in_array( $val, $check_text ) ) { $val = sanitize_text_field( $val ); } elseif ( in_array( $val, $check_url ) ) { $val = esc_url_raw( $val ); } elseif ( in_array( $val, $check_email ) ) { $val = sanitize_email( $val ); } elseif ( in_array( $val, $check_int ) ) { $val = absint( $val ); } elseif ( in_array( $val, $check_html ) ) { $val = wp_kses_post( $val ); } elseif ( in_array( $val, $check_html_limited ) ) { $val = wp_kses( $val, $kses_allow ); } elseif ( in_array( $val, $check_html_class ) ) { $val = sanitize_html_class( $val ); } $flag = true; $temp[$key] = $val; } } if ( $flag ) { $options[$post] = array(); $options[$post] = $temp; } } else { if ( '' !== $vpost ) { // Do security checks if ( in_array( $vpost, $check_text ) ) { $vpost = sanitize_text_field( $vpost ); } elseif ( in_array( $vpost, $check_url ) ) { $vpost = esc_url_raw( $vpost ); } elseif ( in_array( $vpost, $check_email ) ) { $vpost = sanitize_email( $vpost ); } elseif ( in_array( $vpost, $check_int ) ) { $vpost = absint( $vpost ); } elseif ( in_array( $vpost, $check_html ) ) { $vpost = wp_kses_post( $vpost ); } elseif ( in_array( $vpost, $check_html_limited ) ) { $vpost = wp_kses( $vpost, $kses_allow ); } elseif ( in_array( $vpost, $check_html_class ) ) { $vpost = sanitize_html_class( $vpost ); } $options[$post] = $vpost; } } } // Construct google fonts url to save to the database. $fonts = blogcentral_construct_google_fonts_url(); $options['google_fonts_url'] = $fonts; // Update global variable with new options $blogcentral_opts = $options; } // Output any errors or confirmation messages. if ( ! $excpts ) { add_settings_error( 'options-saved', esc_attr( 'options-saved' ), __( 'All options saved successfully!', BLOGCENTRAL_TXT_DOMAIN ), 'updated' ); } return $options; } } if ( ! function_exists( 'blogcentral_admin_notices' ) ) { /** * Output any admin notices * * @since 1.0.0 */ function blogcentral_admin_notices() { settings_errors(); } } if ( ! function_exists( 'blogcentral_change_blog_demo' ) ) { /** * Change the demo and save options to database. * * @since 1.0.0 * * @param string $selected Optional. Saved border. */ function blogcentral_change_blog_demo() { // Check nonce. $nonce = $_REQUEST['blogcentral_demo_nonce']; if ( ! wp_verify_nonce( $nonce, 'blogcentral-change-demo' ) ) { // This nonce is not valid. die( 'No Swiping' ); } else { global $blogcentral_opts; global $blogcentral_blog_demos_opts; $template = isset( $_POST['blogcentral']['blog_demo'] ) ? $_POST['blogcentral']['blog_demo'] : ''; if ( empty( $template ) && '0' !== $template ) { // Error $_POST['messages'] = array( __( 'Please select a demo', BLOGCENTRAL_TXT_DOMAIN ) ); return; } if ( '0' === $template ) { $_POST['messages'] = array( __( "If you do not want to use a demo, and you need to save your options, click the 'Save Options' button.", BLOGCENTRAL_TXT_DOMAIN ) ); return; } // Save options. update_option( BLOGCENTRAL_DB_OPTIONS_NAME, $blogcentral_blog_demos_opts[ $template - 1 ] ); // Update global variable with new options $blogcentral_opts = $blogcentral_blog_demos_opts[ $template - 1 ]; $_POST['messages'] = array( __( 'Demo Changed Successfully!', BLOGCENTRAL_TXT_DOMAIN ) ); } } } /** * 5.4 Theme Options *-----------------------------------------------------------------------*/ /** * 5.4.1 Main *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_get_field_name_wrap' ) ) { /** * Construct name of input field for use on the theme options page, and if the BlogCental Shortcodes & Widgets Pack plugin is installed, on the shortcode, and widget options pages. * * A wrapper used to name a field regularly or, if displaying options for a widget, use the widgets' * get_field_name method. * * @since 1.0.0 * * @param string $name Required. Name of input field. * @param string $name_attr_pre Required. Name prefix of input field. * @param object $widget Optional. Widget object to display options for. * @return string. Modified name of input field. */ function blogcentral_get_field_name_wrap( $name, $name_attr_pre, & $widget = false ) { if ( empty( $name ) || empty( $name_attr_pre ) ) { return; } else { $frag = "[$name]"; } return ( $widget ? $widget->get_field_name( $name ) : $name_attr_pre . $frag ); } } if ( ! function_exists( 'blogcentral_get_field_id_wrap' ) ) { /** * Construct id for use on the theme options page, and if the BlogCental Shortcodes & Widgets Pack plugin is installed, on the shortcode, and widget options pages. * * A wrapper used to create an id. if displaying options for a widget, uses the widgets' * get_field_id method. * * @since 1.0.0 * * @param string $id Required. Id of input field. * @param string $name_attr_pre Optional. Prefix for name attribute. * @param object $widget Optional. Widget object if displaying options for a widget. * @return string. Modified name of input field. */ function blogcentral_get_field_id_wrap( $id, $name_attr_pre, & $widget = false ) { if ( empty( $name_attr_pre ) ) { return; } return ( $widget ? $widget->get_field_id( $id ) : $name_attr_pre . '-' . $id ); } } if ( ! function_exists( 'blogcentral_register_theme_options' ) ) { /** * Register theme options with the settings api * * @since 1.0.0 */ function blogcentral_register_theme_options() { register_setting( 'blogcentral', BLOGCENTRAL_DB_OPTIONS_NAME, 'blogcentral_validate_options' ); } } if ( ! function_exists( 'blogcentral_theme_options' ) ) { /** * Display the theme options page. * * @since 1.0.0 */ function blogcentral_theme_options() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.', BLOGCENTRAL_TXT_DOMAIN ) ); } // Get the saved settings. global $blogcentral_opts; global $blogcentral_defaults; global $blogcentral_initial; // Global plugin object. global $bcswp_plugin; $saved = $blogcentral_opts; if ( ! empty( $saved ) ) { $saved = array_map( 'stripslashes_deep', $saved ); foreach ( $saved as $key => $val ) { if ( is_array( $val ) ) { $saved[$key] = wp_parse_args( $saved[$key], $blogcentral_defaults[$key] ); } } $saved = wp_parse_args( $saved, $blogcentral_defaults ); } else { $saved = $blogcentral_initial; } $show_contact = $saved['show_contact'] ? true : false; $widget_border = $saved['widget_border'] ? $saved['widget_border'] : ''; ?>



'; ?>

Warning: Choosing a demo will delete all of your saved options. If this is not desired, backup your options before changing the demo. You have to click on the "Change Demo" button to change the demo.', BLOGCENTRAL_TXT_DOMAIN ); ?>

/>

/>
blog demo 1

/>
blog demo 2

/>

blog demo 3

/>
/>

" . esc_html( $widget_border ) . ""; else : echo ""; endif; ?>

/>

/>


/>


/>


/>


/>

Background" on the admin sidebar.', BLOGCENTRAL_TXT_DOMAIN ); ?>


class="blogcentral-color-field" data-default-color="#777777" />
class='blogcentral-color-field' data-default-color="#0071d8" />
class='blogcentral-color-field' />


class="blogcentral-color-field" />

class='blogcentral-color-field' />

/>
class='blogcentral-color-field' data-default-color="#222222" />


/>
class='blogcentral-color-field' data-default-color="#222222" />
/>
class='blogcentral-color-field' data-default-color="#222222" />
/>
class='blogcentral-color-field' data-default-color="#222222" />
/>
class='blogcentral-color-field' data-default-color="#222222" />
/>
class='blogcentral-color-field' data-default-color="#222222" />

/>
/>

display_contact_opts( $saved['contact_info'] ); ?>

/>
class='blogcentral-color-field' data-default-color="#ffffff" />
class='blogcentral-color-field' data-default-color="#777777" />
class='blogcentral-color-field' data-default-color="#222222" />
/>

class="hideshow">
class='blogcentral-color-field' />
class='blogcentral-color-field' />


class='blogcentral-color-field' />
class='blogcentral-color-field' data-default-color="#ededed" />
class='blogcentral-color-field' data-default-color="#222222" />


/>
class="hideshow">
/>

/>
page header 1

/>
page header 2

/>
page header 3

class='blogcentral-color-field' />
/>
/>



/>

"; echo $i; echo ""; } } } if ( ! function_exists( 'blogcentral_construct_upload_image' ) ) { /** * Construct the html to upload an image * * @since 1.0.0 * * @param array $opts Optional. Saved options, if any. * @param string $name Required. Name of the input field. * @param boolean $background Optional. Construct image for background? */ function blogcentral_construct_upload_image( $opts, $name, $background = true ) { if ( ! isset( $name ) ) { return; } if ( $background ) { $suffix = '-bck-img'; $suffix_name = '_bck_img'; } else { $suffix = $suffix_name = ''; } ?> /> /> /> />
/>
/>
/>
/>
/>
/>
/>
' . __( 'no border', BLOGCENTRAL_TXT_DOMAIN ) . ''; for ( $i = 0; $i < 3; ++$i ) { $select = ''; $html .= ""; } return $html; } } /** * 5.4.2 Font Options *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_display_options_fonts' ) ) { /** * Display font options * * @since 1.0.0 * * @param array $opts Optional. Saved font options * @param string $name Required. Name to use in constructing the name of the input field. */ function blogcentral_display_options_fonts( $opts = '', $name ) { if ( ! isset( $name ) ) { return; } $system_fonts = array( 'arial', 'baskerville', 'book antiqua', 'century gothic', 'helvetica', 'gill sans', 'impact', 'calibri', 'cambria', 'consolas', 'courier new', 'georgia', 'impact', 'lucida console', 'lucida sans unicode', 'palatino linotype', 'sans serif', 'serif', 'tahoma', 'times new roman', 'trebuchet ms', 'verdana' ); $defaults = array( $name . "_font_family" => 'no_font', $name . "_font_type" => 'system', $name . "_font_weight" => 'regular', $name . "_font_subsets" => array(), ); if ( $opts ) { $opts = wp_parse_args( $opts, $defaults ); } else { $opts = $defaults; } $selected = ''; if ( is_array( $opts ) ) { $selected = isset( $opts[$name . '_font_family'] ) ? $opts[$name . '_font_family'] : ''; } // Create nonce for use in the ajax request for a font's options $nonce = wp_create_nonce( "blogcentral-font-select-nonce" ); $link = admin_url( 'admin-ajax.php?action=blogcentral_font_options&nonce=' . $nonce ); $font_family_select = ''; echo '
'; $display = $clean = $system_clean = ''; echo '
'; if ( 'no_font' !== $selected ) { if ( $type !== 'system' ) { $display = " style='display:none;'"; blogcentral_display_options_variants( $variants, $selected, isset( $opts[$name . '_font_weight'] ) ? $opts[$name . '_font_weight'] : '', $name, 'google_fonts' ); ob_start(); blogcentral_display_options_subsets( $subsets, $selected, isset( $opts[$name . '_font_subsets'] ) ? $opts[$name . '_font_subsets'] : '', $name ); $clean = ob_get_clean(); } else { blogcentral_display_options_variants( '', $selected, isset( $opts[$name . '_font_weight'] ) ? $opts[$name . '_font_weight'] : '', $name, 'system_fonts' ); } } echo '
' . $clean . '
' . ''; } } if ( ! function_exists( 'blogcentral_display_options_variants' ) ) { /** * Construct and display options for font weight. * * @since 1.0.0 * * @param array $opts Optional. List of previously selected font weights. * @param string $font Optional. Selected font. * @param string $selected Optional. Selected font weight. * @param string $name Required. Name to use to construct the name of the input field. * @param string $type Required. Either system_fonts or google_fonts */ function blogcentral_display_options_variants( $opts = '', $font = '', $selected, $name, $type ) { if ( ! isset( $name ) ) { return; } $variants = array( '100' => __( '100 light', BLOGCENTRAL_TXT_DOMAIN ), '100italic' => __( '100 light italic', BLOGCENTRAL_TXT_DOMAIN ), '200' => __( '200 light', BLOGCENTRAL_TXT_DOMAIN ), '200italic' => __( '200 light italic', BLOGCENTRAL_TXT_DOMAIN ), '300' => __( '300 light', BLOGCENTRAL_TXT_DOMAIN ), '300italic' => __( '300 light italic', BLOGCENTRAL_TXT_DOMAIN ), 'regular' => __( '400 regular', BLOGCENTRAL_TXT_DOMAIN ), 'italic' => __( '400 italic', BLOGCENTRAL_TXT_DOMAIN ), '500' => __( 'medium', BLOGCENTRAL_TXT_DOMAIN ), '500italic' => __( 'medium italic', BLOGCENTRAL_TXT_DOMAIN ), '600' => __( 'bold', BLOGCENTRAL_TXT_DOMAIN ), '600italic' => __( 'bold italic', BLOGCENTRAL_TXT_DOMAIN ), '700' => __( '700 bold', BLOGCENTRAL_TXT_DOMAIN ), '700italic' => __( '700 bold italic', BLOGCENTRAL_TXT_DOMAIN ), '800' => __( '800 bold', BLOGCENTRAL_TXT_DOMAIN ), '800italic' => __( '800 bold italic', BLOGCENTRAL_TXT_DOMAIN ), '900' => __( '900 bold', BLOGCENTRAL_TXT_DOMAIN ), '900italic' => __( '900 bold italic', BLOGCENTRAL_TXT_DOMAIN ) ); $font_variants = '
'; if ( 'system_fonts' === $type ) { foreach ( $variants as $key => $val ) { $select = ''; $font_variants .= '
'; } } else { /* * If no weights selected, then need a selected font to display its available weights, * otherwise return. */ if ( ! $opts ) { if ( ! $font ) { return; } $google_fonts = blogcentral_get_google_fonts(); $google_variants = $google_fonts[$font]['variants']; } else { $google_variants = $opts; } if ( is_array( $google_variants ) && count( $google_variants ) > 0 ) { foreach ( $google_variants as $variant ) { $select = ''; $font_variants .= '
'; } } } echo '' . $font_variants . '
'; } } if ( ! function_exists( 'blogcentral_display_options_subsets' ) ) { /** * Construct and display options for font subset * * Only if a google font is selected will this be invoked. * * @since 1.0.0 * * @param array $opts Saved subsets options. * @param string $font Required. Display subsets of font * @param string $selected Optional. List of saved subsets. * @param string $name Required. Name to use to construct the name of the input field. */ function blogcentral_display_options_subsets( $opts = '', $font, $selected, $name ) { if ( ! $opts ) { if ( ! $font ) { return; } $google_fonts = blogcentral_get_google_fonts(); $google_subsets = $google_fonts[$font]['subsets']; } else { $google_subsets = $opts; } $font_subsets = '
'; foreach ( $google_subsets as $subset ) { $select = ''; if ( is_array( $selected ) && in_array( $subset, $selected ) ) { $select = checked( $subset, $subset, false ); } $font_subsets .= '
'; } echo '' . $font_subsets . '
'; } } if ( ! function_exists( 'blogcentral_get_google_fonts' ) ) { /** * Retrieve google fonts. Check transients, if not there try google server. * * Requires the google fonts application id to be set. * * @since 1.0.0 */ function blogcentral_get_google_fonts() { global $blogcentral_opts; if ( empty( $blogcentral_opts['google_app_id'] ) ) { return; } $fonts = $json = array(); // Get the saved api key. $api_key = $blogcentral_opts['google_app_id']; $api_url = $api_key ? "&key=$api_key" : ""; // Check transient. if ( ! get_transient( 'blogcentral_google_fonts' ) ) { // Get list of fonts from Google. $response = wp_remote_get( "https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha$api_url", array( 'sslverify' => false, 'timeout' => 120, ) ); // Check if response is valid. if ( ! is_wp_error( $response ) ) { $fonts_list = json_decode( $response['body'], true ); // Check if response is an error message. if ( ! isset( $fonts_list['error'] ) ) { $json = $response['body']; } } else { echo __( 'Error: Unable to connect to the Google Webfont server at this time. Please review the list of errors below returned by Google.', BLOGCENTRAL_TXT_DOMAIN ); foreach ( $response->errors as $error ) { foreach ( $error as $message ) { echo $message; } } } $font_array = json_decode( $json, true ); if ( is_array( $font_array ) && 0 < count( $font_array ) ) { foreach ( $font_array['items'] as $item ) { $atts = array( 'name' => $item['family'], 'variants' => $item['variants'], 'subsets' => $item['subsets'], ); // Add this font to the fonts list. $id = $item['family']; $fonts[$id] = $atts; } } // Set transient. set_transient( 'blogcentral_google_fonts', $fonts, 21 * DAY_IN_SECONDS ); } else { $fonts = get_transient( 'blogcentral_google_fonts' ); } return $fonts; } } if ( ! function_exists( 'blogcentral_construct_google_fonts_url' ) ) { /** * Construct the url to retrieve a google font. * * @since 1.0.0 * * @return string. Google font url. */ function blogcentral_construct_google_fonts_url() { global $blogcentral_opts; $saved = isset( $blogcentral_opts['fonts'] ) ? $blogcentral_opts['fonts'] : ''; $font_elements = array( 'body_txt', 'headers', 'main_menu' ); $google_url = ''; $fonts_url = array(); $num_elements = count( $font_elements ); // First create a fonts array indexed by font family for ( $i = 0; $i < $num_elements; ++$i ) { $type = isset( $saved[$font_elements[$i] . '_font_type'] ) ? $saved[$font_elements[$i] . '_font_type'] : ''; if ( 'google' === $type ) { $font = $saved[$font_elements[$i] . '_font_family']; $variant = isset( $saved[$font_elements[$i] . '_font_weight'] ) ? $saved[$font_elements[$i] . '_font_weight'] : ''; $subsets = isset( $saved[$font_elements[$i] . '_font_subsets'] ) ? $saved[$font_elements[$i] . '_font_subsets'] : array(); if ( isset( $fonts_url[$font] ) ) { if ( $variant ) { $fonts_url[$font]['font_weights'] = isset( $fonts_url[$font]['font_weights'] ) ? array_merge( $fonts_url[$font]['font_weights'], array( $variant ) ) : array( $variant ); } if ( 0 < count( $subsets ) ) { $fonts_url[$font]['font_subsets'] = isset( $fonts_url[$font]['font_subsets'] ) ? array_merge( $fonts_url[$font]['font_subsets'], $subsets ) : $subsets; } } else { $fonts_url[$font] = array( 'font_weights' => array( $variant ), 'font_subsets' => $subsets ); } } } // Now construct the google url. $sep = ''; foreach ( $fonts_url as $key => $val ) { $weights_ids = $subsets_ids = ''; $font_id = str_replace( '_', '+', $key ); // Do not want duplicate data in google url. if ( 0 < count( $val['font_weights'] ) ) { $weights_ids = implode( ',', array_unique( $val['font_weights'] ) ); } if ( 0 < count( $val['font_subsets'] ) ) { $subsets_ids = implode( ',', array_unique( $val['font_subsets'] ) ); } $google_url .= $sep . $font_id; if ( $weights_ids ) { $google_url .= ':' . $weights_ids; } if ( $subsets_ids ) { $google_url .= '%26subset=' . $subsets_ids; } $sep = '|'; } return $google_url; } } /** * 5.4.3 General Component Options *-----------------------------------------------------------------------*/ if ( ! function_exists( 'blogcentral_display_component_layout_options' ) ) { /** * Construct and display options for a component layout. * * @since 1.0.0 * * @param string $name Required. Name used to construct the input fields. * @param string $selected Optional. Saved option for layout. * @param object $widget Optional. Widget object if displaying options for a widget. */ function blogcentral_display_component_layout_options( $name, $selected = '', & $widget = false ) { if ( ! isset( $name ) ) { return; } $selected = $selected ? $selected : 'layout1'; $name = isset( $name ) ? esc_attr( $name ) : ''; echo "

"; _e( 'Layout - choose from 3 different layouts.', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Layout', BLOGCENTRAL_TXT_DOMAIN ) . "
"; for ( $i = 1; $i < 4; ++$i ) { echo "
"; } echo '
'; // Ending
tag is in the display_component_layout_wraps function. } } if ( ! function_exists( 'blogcentral_display_component_layout_wraps' ) ) { /** * Construct and display options for layout containers. * * These containers holds options that are specific to the layout chosen. * * @since 1.0.0 * * @param array $opts Optional. Saved options. * @param object $widget Optional. Widget object if displaying options for a widget. */ function blogcentral_display_component_layout_wraps( $opts, & $widget = false ) { $layout = $opts ? ( isset( $opts['layout'] ) ? $opts['layout'] : 'layout1' ) : 'layout1'; $name = isset( $opts['name'] ) ? esc_html( $opts['name'] ) : ''; echo "
" . __(

" . __( 'Content under media', BLOGCENTRAL_TXT_DOMAIN ) . "

" . __(

" . __( 'Content floated to right of media, in a two column design.', BLOGCENTRAL_TXT_DOMAIN ) . "

" . __( 'Text Layout, no media will be displayed.', BLOGCENTRAL_TXT_DOMAIN ) . "

"; } } if ( ! function_exists( 'blogcentral_display_main_options' ) ) { /** * Construct and display main options for components. * * @since 1.0.0 * * @param array $opts Optional. Saved options. * @param object $widget Optional. Widget object if displaying options for a widget. */ function blogcentral_display_main_options( $opts, & $widget = false ) { $defaults = array( 'cols' => '1', 'border' => '0', 'masonry' => false, 'alternate_color' => false, ); if ( $opts ) { $opts = wp_parse_args( $opts, $defaults ); } else { $opts = $defaults; } $name = $opts ? ( isset( $opts['name'] ) ? esc_html( $opts['name'] ) : 'posts_landing' ) : 'posts_landing'; $border_name = blogcentral_get_field_name_wrap( 'border', "blogcentral[$opts[name]]", $widget ); blogcentral_display_custom_text_class_options( $opts, $widget ); echo "

"; _e( 'General Options', BLOGCENTRAL_TXT_DOMAIN ); echo "

"; // If displaying options for the single post page, do not display these options. if ( 'posts_single' !== $name ) : echo ""; endif; echo ""; // If displaying options for the single post page, do not display these options if ( 'posts_single' !== $name ) : echo ""; endif; echo "
" . __( 'How many columns?', BLOGCENTRAL_TXT_DOMAIN ) . "

"; _e( 'Note: the number of columns shown may change due to the size of the screen and/or the layout chosen for the posts. Layout 2, at the most, will be displayed in 2 columns, even if you choose 3 or 4 columns.', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Border for each post', BLOGCENTRAL_TXT_DOMAIN ) . "

" . __( 'Masonry display', BLOGCENTRAL_TXT_DOMAIN ) . "
" . __( 'Alternate background color', BLOGCENTRAL_TXT_DOMAIN ) . "
"; // If displaying options for the main posts page ie index.php, do not display these options. if ( 'posts_landing' !== $name && 'posts_single' !== $name ) { $opts['name'] = $name; blogcentral_display_query_opts( $opts, $widget ); } } } if ( ! function_exists( 'blogcentral_display_custom_text_class_options' ) ) { /** * Construct and display options for custom text and classes for a component. * * A component can have a title and a tagline that is displayed right beneath the title. * * @since 1.0.0 * * @param array $opts Optional. Saved options. * @param object $widget Optional. Widget object if displaying options for a widget. */ function blogcentral_display_custom_text_class_options( $opts, & $widget = false ) { $defaults = array( 'title_border' => 'default', 'tagline_border' => '0', ); if ( $opts ) { $opts = wp_parse_args( $opts, $defaults ); } else { $opts = $defaults; } $name = isset( $opts['name'] ) ? esc_html( $opts['name'] ) : 'posts_landing'; $title_text = isset( $opts['title_text'] ) ? ' value="' . esc_html( $opts['title_text'] ) . '"' : ''; $tagline_text = isset( $opts['tagline_text'] ) ? ' value="' . esc_html( $opts['tagline_text'] ) . '"' : ''; $wrap_class = $opts ? ( isset( $opts['wrap_class'] ) ? ' value="' . esc_html( $opts['wrap_class'] ) . '"' : '' ) : ''; $title_class = $opts ? ( isset( $opts['title_class'] ) ? ' value="' . esc_html( $opts['title_class'] ) . '"' : '' ) : ''; echo "

"; _e( 'Custom Text', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Title', BLOGCENTRAL_TXT_DOMAIN ) . "
" . __( 'Title Border Style', BLOGCENTRAL_TXT_DOMAIN ) . " "; if ( 'default' !== $opts['title_border'] && ( '0' !== $opts['title_border'] ) ) : echo "$opts[title_border]"; else : echo ""; endif; echo "

"; _e( 'Border style for the title.', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Tagline Text', BLOGCENTRAL_TXT_DOMAIN ) . "

"; _e( 'The text below the title', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Tagline Border Style', BLOGCENTRAL_TXT_DOMAIN ) . " "; if ( 'default' !== $opts['tagline_border'] && ( '0' !== $opts['tagline_border'] ) ) : echo "$opts[tagline_border]"; else : echo ""; endif; echo "

"; _e( 'Border style for the tagline.', BLOGCENTRAL_TXT_DOMAIN ); echo "

"; echo "

"; _e( 'Custom Classes', BLOGCENTRAL_TXT_DOMAIN ); // The wrap class will be added to the most outer div of the component. echo "

" . __( 'Wrap Classes', BLOGCENTRAL_TXT_DOMAIN ) . "

"; _e( 'Default class is components-wrap, you can add more classes, separate them with a space.', BLOGCENTRAL_TXT_DOMAIN ); echo "

" . __( 'Header Classes', BLOGCENTRAL_TXT_DOMAIN ) . "

"; _e( 'Separate classes with a space.', BLOGCENTRAL_TXT_DOMAIN ); echo "

"; } } if ( ! function_exists( 'blogcentral_display_cols_options' ) ) { /** * Construct and display options for the column layout of a component. * * @since 1.0.0 * * @param string $selected Optional. Saved option for number of columns. */ function blogcentral_display_cols_options( $selected = 1 ) { for ( $i = 1; $i < 5; ++$i ) { echo ""; } } } if ( ! function_exists( 'blogcentral_display_social_share_opts' ) ) { /** * Construct and display options for social sharing * * @since 1.0.0 * * @param array $opts Optional. Saved options. * @param object $widget Optional. Widget object if displaying options for a widget. */ function blogcentral_display_social_share_opts( $opts, & $widget = false ) { $name = isset( $opts['name'] ) ? esc_html( $opts['name'] ) : ''; if ( $name ) { $name = "blogcentral[$name]"; } else { $name = "blogcentral"; } echo '