'.__('+More','carblog').''); return $trimmed_content; } get_template_part('theme_includes/settings-class'); /*********************************************************** * Our Options ************************************************************/ if (!class_exists('Carblog_Settings' )): class Carblog_Settings { private $settings_api; function __construct() { $this->settings_api = new Carblog_Settings_API; add_action( 'admin_init', array($this, 'admin_init') ); add_action( 'admin_menu', array($this, 'admin_menu') ); } function admin_init() { //set the settings $this->settings_api->set_sections( $this->get_settings_sections() ); $this->settings_api->set_fields( $this->get_settings_fields() ); //initialize settings $this->settings_api->admin_init(); } function admin_menu() { add_theme_page('Carblog Settings', 'Carblog Settings', 'delete_posts', OPTIONS_PREFIX.'theme_settings', array($this, 'plugin_page')); } function get_settings_sections() { $sections = array( array( 'id' => OPTIONS_PREFIX.'general', 'title' => __( 'Carblog General', 'carblog' ), 'desc'=>__('Favicon and Logo Settings','carblog') ), array( 'id' => OPTIONS_PREFIX.'socials', 'title' => __( 'Carblog Social', 'carblog' ), 'desc'=>__('Facebook,Twitter, G+ etc settings.','carblog') ), array( 'id' => OPTIONS_PREFIX.'featured_post_settings', 'title' => __( 'Featured Posts Settings', 'carblog' ), 'desc'=>__('Featured Post Category, featured posts excerpts length.','carblog') ), array( 'id' => OPTIONS_PREFIX.'footer_columns', 'title' => __( 'Carblog Footer', 'carblog' ), 'desc'=>__('Fill the footer columns with your text.','carblog') ), ); return $sections; } function get_settings_fields() { //Access the WordPress Categories via an Array $categories = array(); $categories_obj = get_categories('hide_empty=0'); foreach ($categories_obj as $cat) { $categories[$cat->cat_ID] = ucwords($cat->cat_name); } $settings_fields = array( OPTIONS_PREFIX.'general' => array( array( 'name' => 'favicon', 'label' => __( 'Your Favicon', 'carblog' ), 'desc' => __( '
If you have a favicon (16x16px) please upload it here.
','carblog' ), 'type' => 'file', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'logo', 'label' => __( 'Your Logo', 'carblog' ), 'desc' => __( 'Do you a have a logo to upload?If yes, use the media uploader.Suggested logo dimensions are 375x125px.
', 'carblog' ), 'type' => 'file', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'top_area_text', 'label' => __( 'Top Area Slogan', 'carblog' ), 'desc' => __( 'This is the message that appears between the date and the social icons, at the top.
Keep it small and simple, up to three-seven words.Leave it blank and the message will disappear
', 'carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'sanitize_text_field' ) ), OPTIONS_PREFIX.'socials' => array( array( 'name' => 'facebook', 'label' => __( 'Facebook URL', 'carblog' ), 'desc' => __( 'Your Facebook URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'twitter', 'label' => __( 'Twitter URL', 'carblog' ), 'desc' => __( 'Your Twitter URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'google_plus', 'label' => __( 'Google Plus URL', 'carblog' ), 'desc' => __( 'Your Google Plus URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'rss', 'label' => __( 'RSS URL', 'carblog' ), 'desc' => __( 'Your Feed/RSS URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'instagram', 'label' => __( 'Instagram URL', 'carblog' ), 'desc' => __( 'Your Instagram Page URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'pinterest', 'label' => __( 'Pinterest URL', 'carblog' ), 'desc' => __( 'Your Pinterest URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'linkedin', 'label' => __( 'Linkedin URL', 'carblog' ), 'desc' => __( 'Your Linkedin URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'dribbble', 'label' => __( 'Dribbble URL', 'carblog' ), 'desc' => __( 'Your Dribbble URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'youtube', 'label' => __( 'Youtube Channel URL', 'carblog' ), 'desc' => __( 'Your Youtube Channel URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ) ), OPTIONS_PREFIX.'featured_post_settings' => array( array( 'name' => 'disable_featured', 'label' => __( 'Disable Featured Posts', 'carblog' ), 'desc' => __( 'If you want to disable featuted posts, then tick "Yes".