'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 $corporatebusiness_slider_array = array( 'enable_slider' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'corporatebusiness'), 'default' => 0, 'sanitize_callback' => 'corporatebusiness_boolean', ), 'slider_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'corporatebusiness'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ) ); for ($i=1;$i<=4;$i++) { $corporatebusiness_slider_item = array(); $corporatebusiness_slider_item = array( 'sep'.$i => array( 'label' => __("Slider", 'corporatebusiness') . "#$i", 'type' => 'sep-title', ), 'slider_title'.$i => array( 'type' => 'text', 'label' => __('Title', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'slider_desc'.$i => array( 'type' => 'text', 'label' => __('Description', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'slider_link'.$i => array( 'type' => 'text', 'label' => __('Link', 'corporatebusiness'), 'sanitize_callback' => 'esc_url', ), 'slider_image'.$i => array( 'default' => get_template_directory_uri() . "/images/slider/$i.jpg", 'type' => 'image', 'label' => __('Image', 'corporatebusiness'), 'sanitize_callback' => 'esc_url_raw', ) ); $corporatebusiness_slider_array = array_merge($corporatebusiness_slider_array, $corporatebusiness_slider_item); } if ( $req == "slider" ) return $corporatebusiness_slider_array; // Services Section Array $corporatebusiness_services_array = array( 'enable_services' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'corporatebusiness'), 'default' => 0, 'sanitize_callback' => 'corporatebusiness_boolean', ), 'services_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'corporatebusiness'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ), 'services_title' => array( 'type' => 'text', 'label' => __('Title', 'corporatebusiness'), 'default' => "Nunc porta lectus dolor", 'sanitize_callback' => 'esc_attr', ), 'services_desc' => array( 'type' => 'textarea', 'label' => __('Description', 'corporatebusiness'), '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++) { $corporatebusiness_services_item = array(); $corporatebusiness_services_item = array( 'sep_services'.$i => array( 'label' => __("Service", 'corporatebusiness') . "#$i", 'type' => 'sep-title', ), 'service_title'.$i => array( 'default' => "Lorem ipsum", 'type' => 'text', 'label' => __('Title', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'service_desc'.$i => array( 'default' => "Nullam fringilla lorem sed ante pharetra, et ultrices nisl rhoncus!", 'type' => 'text', 'label' => __('Description', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'service_link'.$i => array( 'default' => esc_url( home_url( '/' ) ), 'type' => 'text', 'label' => __('Link', 'corporatebusiness'), 'sanitize_callback' => 'esc_url', ), 'service_icon'.$i => array( 'default' => "fa-briefcase", 'type' => 'select', 'label' => __('Icon', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', 'choices' => $fa_choices ), 'service_color'.$i => array( 'default' => "#645F54", 'type' => 'color', 'label' => __('Color', 'corporatebusiness'), 'sanitize_callback' => 'sanitize_hex_color', ) ); $corporatebusiness_services_array = array_merge($corporatebusiness_services_array, $corporatebusiness_services_item); } if ( $req == "services" ) return $corporatebusiness_services_array; // Projects Section Array $corporatebusiness_projects_array = array( 'enable_projects' => array( 'type' => 'checkbox', 'label' => __('Enable this section', 'corporatebusiness'), 'default' => 0, 'sanitize_callback' => 'corporatebusiness_boolean', ), 'projects_quantity' => array( 'type' => 'disabled-select', 'label' => __('Quantity', 'corporatebusiness'), 'default' => 4, 'choices' => $qty, 'sanitize_callback' => 'absint', ), 'projects_title' => array( 'type' => 'text', 'label' => __('Title', 'corporatebusiness'), 'default' => "Nunc porta lectus dolor", 'sanitize_callback' => 'esc_attr', ), 'projects_desc' => array( 'type' => 'textarea', 'label' => __('Description', 'corporatebusiness'), '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++) { $corporatebusiness_projects_item = array(); $corporatebusiness_projects_item = array( 'sep_projects'.$i => array( 'label' => __("Project", 'corporatebusiness') . "#$i", 'type' => 'sep-title', ), 'project_title'.$i => array( 'default' => "Lorem ipsum", 'type' => 'text', 'label' => __('Title', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'project_desc'.$i => array( 'default' => "Nullam fringilla lorem sed ante pharetra, et ultrices nisl rhoncus!", 'type' => 'text', 'label' => __('Description', 'corporatebusiness'), 'sanitize_callback' => 'esc_attr', ), 'project_link'.$i => array( 'default' => esc_url( home_url( '/' ) ), 'type' => 'text', 'label' => __('Link', 'corporatebusiness'), 'sanitize_callback' => 'esc_url', ), 'project_image'.$i => array( 'default' => get_template_directory_uri() . '/images/thumbnail.png', 'type' => 'upload', 'label' => __('Image', 'corporatebusiness'), 'sanitize_callback' => 'esc_url_raw', ) ); $corporatebusiness_projects_array = array_merge($corporatebusiness_projects_array, $corporatebusiness_projects_item); } if ( $req == "projects" ) return $corporatebusiness_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', 'corporatebusiness'), 'fields' => array( 'primary_colors' => array( 'type' => 'info', 'label' => "", 'default' => '#3C9DFF', 'sanitize_callback' => 'sanitize_hex_color', ), ), ) ), ), 'panels' => array( 'corporatebusiness' => array( 'priority' => 9, 'title' => __('CorporateBusiness Theme Options', 'corporatebusiness'), 'description' => __('CorporateBusiness Theme Options', 'corporatebusiness'), 'sections' => array( 'header' => array( 'title' => __('Header', 'corporatebusiness'), 'fields' => array( 'logo' => array( 'default' => get_template_directory_uri() . '/images/logo.png', 'type' => 'image', 'label' => __('Logo Image', 'corporatebusiness'), 'sanitize_callback' => 'esc_url_raw', ), 'adress' => array( 'type' => 'text', 'label' => __('Adress', 'corporatebusiness'), 'default' => '77 Massachusetts Ave, Cambridge, MA, USA', 'sanitize_callback' => 'esc_attr', ), 'mail' => array( 'type' => 'text', 'label' => __('Adress', 'corporatebusiness'), 'default' => 'info@example.com', 'sanitize_callback' => 'esc_attr', ), 'phone' => array( 'type' => 'text', 'label' => __('Adress', 'corporatebusiness'), 'default' => '+1 617-253-1000', 'sanitize_callback' => 'esc_attr', ) ), ), 'general' => array( 'title' => __('General', 'corporatebusiness'), 'fields' => array( 'primary_color' => array( 'type' => 'color', 'label' => __('Primary Color', 'corporatebusiness'), 'default' => '#3C9DFF', 'sanitize_callback' => 'sanitize_hex_color', ), 'enable_homepage' => array( 'type' => 'checkbox', 'label' => __('Show recent posts on homepage', 'corporatebusiness'), 'default' => 1, 'sanitize_callback' => 'corporatebusiness_boolean', ), 'color_scheme' => array( 'type' => 'disabled-select', 'label' => __('Color Scheme', 'corporatebusiness'), 'choices' => array( '1' => __('Red', 'corporatebusiness'), '2' => __('Green', 'corporatebusiness'), '3' => __('Blue', 'corporatebusiness'), ), 'default' => 0, ), 'color_scheme' => array( 'type' => 'disabled-select', 'label' => __('Color Scheme', 'corporatebusiness'), 'choices' => array( '1' => __('Orange', 'corporatebusiness'), '2' => __('Green', 'corporatebusiness'), '3' => __('Blue', 'corporatebusiness'), ), 'default' => 0, ), ), ), 'slider' => array( 'title' => __('Slider', 'corporatebusiness'), 'fields' => corporatebusiness_generate_array ( "slider" ), ), 'services' => array( 'title' => __('Services Section', 'corporatebusiness'), 'fields' => corporatebusiness_generate_array ( "services" ), ), 'projects' => array( 'title' => __('Projects Section', 'corporatebusiness'), 'fields' => corporatebusiness_generate_array ( "projects" ), ), ) ), ) ); function corporatebusiness_boolean($value) { if(is_bool($value)) { return $value; } else { return false; } } ?>