'1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', ); // Slider Array $bakery_slider_array = array( 'enable_slider' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'bakery'), 'default' => 0, 'sanitize_callback' => 'bakery_boolean', ), 'slider_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'bakery'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ) ); for ($i=1;$i<=4;$i++) { $bakery_slider_item = array(); $bakery_slider_item = array( 'sep'.$i => array( 'label' => __("Slider", 'bakery') . "#$i", 'type' => 'sep-title', ), 'slider_title'.$i => array( 'type' => 'text', 'label' => __('Title', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'slider_desc'.$i => array( 'type' => 'text', 'label' => __('Description', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'slider_link'.$i => array( 'type' => 'text', 'label' => __('Link', 'bakery'), 'sanitize_callback' => 'esc_url', ), 'slider_image'.$i => array( 'default' => get_template_directory_uri() . "/images/slider/slider-$i.jpg", 'type' => 'image', 'label' => __('Image', 'bakery'), 'sanitize_callback' => 'esc_url_raw', ) ); $bakery_slider_array = array_merge($bakery_slider_array, $bakery_slider_item); } if ( $req == "slider" ) return $bakery_slider_array; // Services Section Array $bakery_services_array = array( 'enable_services' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'bakery'), 'default' => 0, 'sanitize_callback' => 'bakery_boolean', ), 'services_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'bakery'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ), 'services_title' => array( 'type' => 'text', 'label' => __('Title', 'bakery'), 'default' => "Nunc porta lectus dolor", 'sanitize_callback' => 'esc_attr', ), 'services_desc' => array( 'type' => 'textarea', 'label' => __('Description', 'bakery'), 'default' => '"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."', 'sanitize_callback' => 'esc_textarea', ) ); // FA Icons to choices array $fa_choices = array(); foreach ( $fa_array as $fa ) { $fa_choices = array_merge($fa_choices, array( "fa-$fa" => "$fa" ) ); } // for ($i=1;$i<=4;$i++) { $bakery_services_item = array(); $bakery_services_item = array( 'sep_services'.$i => array( 'label' => __("Service", 'bakery') . "#$i", 'type' => 'sep-title', ), 'service_title'.$i => array( 'default' => "Lorem ipsum", 'type' => 'text', 'label' => __('Title', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'service_desc'.$i => array( 'default' => "Nullam fringilla lorem sed ante pharetra, et ultrices nisl rhoncus!", 'type' => 'text', 'label' => __('Description', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'service_link'.$i => array( 'default' => esc_url( home_url( '/' ) ), 'type' => 'text', 'label' => __('Link', 'bakery'), 'sanitize_callback' => 'esc_url', ), 'service_icon'.$i => array( 'default' => "fa-birthday-cake", 'type' => 'select', 'label' => __('Icon', 'bakery'), 'sanitize_callback' => 'esc_attr', 'choices' => $fa_choices ), 'service_color'.$i => array( 'default' => "#645F54", 'type' => 'color', 'label' => __('Color', 'bakery'), 'sanitize_callback' => 'sanitize_hex_color', ) ); $bakery_services_array = array_merge($bakery_services_array, $bakery_services_item); } if ( $req == "services" ) return $bakery_services_array; // Projects Section Array $bakery_projects_array = array( 'enable_projects' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'bakery'), 'default' => 0, 'sanitize_callback' => 'bakery_boolean', ), 'projects_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'bakery'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ), 'projects_title' => array( 'type' => 'text', 'label' => __('Title', 'bakery'), 'default' => "Nunc porta lectus dolor", 'sanitize_callback' => 'esc_attr', ), 'projects_desc' => array( 'type' => 'textarea', 'label' => __('Description', 'bakery'), 'default' => '"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."', 'sanitize_callback' => 'esc_textarea', ) ); // for ($i=1;$i<=4;$i++) { $bakery_projects_item = array(); $bakery_projects_item = array( 'sep_projects'.$i => array( 'label' => __("Project", 'bakery') . "#$i", 'type' => 'sep-title', ), 'project_title'.$i => array( 'default' => "Lorem ipsum", 'type' => 'text', 'label' => __('Title', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'project_desc'.$i => array( 'default' => "Nullam fringilla lorem sed ante pharetra, et ultrices nisl rhoncus!", 'type' => 'text', 'label' => __('Description', 'bakery'), 'sanitize_callback' => 'esc_attr', ), 'project_link'.$i => array( 'default' => esc_url( home_url( '/' ) ), 'type' => 'text', 'label' => __('Link', 'bakery'), 'sanitize_callback' => 'esc_url', ), 'project_image'.$i => array( 'default' => get_template_directory_uri() . '/images/thumbnail.png', 'type' => 'upload', 'label' => __('Image', 'bakery'), 'sanitize_callback' => 'esc_url_raw', ) ); $bakery_projects_array = array_merge($bakery_projects_array, $bakery_projects_item); } if ( $req == "projects" ) return $bakery_projects_array; } // end of generate array function /** * Options array */ $options = array( 'capability' => 10, 'type' => 'theme_mod', 'root' => array( 'sections' => array( 'pro' => array( 'title' => __('Upgrade to Pro', 'bakery'), 'fields' => array( 'primary_colors' => array( 'type' => 'info', 'label' => "", 'default' => '#ff8800', 'sanitize_callback' => 'sanitize_hex_color', ), ), ) ), ), 'panels' => array( 'bakery' => array( 'priority' => 9, 'title' => __('Bakery Theme Options', 'bakery'), 'description' => __('Bakery Theme Options', 'bakery'), 'sections' => array( 'header' => array( 'title' => __('Header', 'bakery'), 'description' => __('Header options', 'bakery'), 'fields' => array( 'logo' => array( 'default' => get_template_directory_uri() . '/images/logo.png', 'type' => 'image', 'label' => __('Logo Image', 'bakery'), 'sanitize_callback' => 'esc_url_raw', ), 'adress' => array( 'type' => 'text', 'label' => __('Adress', 'bakery'), 'default' => '77 Massachusetts Ave, Cambridge, MA, USA', 'sanitize_callback' => 'esc_attr', ), 'mail' => array( 'type' => 'text', 'label' => __('Adress', 'bakery'), 'default' => 'info@example.com', 'sanitize_callback' => 'esc_attr', ), 'phone' => array( 'type' => 'text', 'label' => __('Adress', 'bakery'), 'default' => '+1 617-253-1000', 'sanitize_callback' => 'esc_attr', ) ), ), 'general' => array( 'title' => __('General', 'bakery'), 'fields' => array( 'primary_color' => array( 'type' => 'color', 'label' => __('Primary Color', 'bakery'), 'default' => '#ff8800', 'sanitize_callback' => 'sanitize_hex_color', ), 'enable_homepage' => array( 'type' => 'checkbox', 'label' => __('Show recent posts on homepage', 'bakery'), 'default' => 1, 'sanitize_callback' => 'bakery_boolean', ), 'color_scheme' => array( 'type' => 'disabled-select', 'label' => __('Color Scheme', 'bakery'), 'choices' => array( '1' => __('Red', 'bakery'), '2' => __('Green', 'bakery'), '3' => __('Blue', 'bakery'), ), 'default' => 0, ), 'color_scheme' => array( 'type' => 'disabled-select', 'label' => __('Color Scheme', 'bakery'), 'choices' => array( '1' => __('Orange', 'bakery'), '2' => __('Green', 'bakery'), '3' => __('Blue', 'bakery'), ), 'default' => 0, ), ), ), 'slider' => array( 'title' => __('Slider', 'bakery'), 'fields' => bakery_generate_array ("slider"), ), 'services' => array( 'title' => __('Services Section', 'bakery'), 'fields' => bakery_generate_array ("services"), ), 'projects' => array( 'title' => __('Projects Section', 'bakery'), 'fields' => bakery_generate_array ("projects"), ), ) ), ) ); function bakery_boolean($value) { if(is_bool($value)) { return $value; } else { return false; } } function bakery_breadcrumb_char_choices($value='') { $choices = array('1','2','3'); if( in_array($value, $choices)) { return $value; } else { return '1'; } } ?>