Ejemplo n.º 1
0
     $wp_customize->add_control('openlab_ourfocus_button_nf_form', array('label' => __('Select a form...', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'type' => 'select', 'settings' => 'openlab_ourfocus_button_nf_form', 'priority' => 5, 'choices' => $available_forms));
 } else {
     $wp_customize->add_section('openlab_ourfocus_section', array('title' => __('Our focus section', 'openlab-txtd'), 'priority' => 32, 'description' => __('The main content of this section is customizable in: Customize -> Widgets -> Our focus section. There you must add the "Openlab - Our focus widget"', 'openlab-txtd')));
     /* show/hide */
     $wp_customize->add_setting('openlab_ourfocus_show', array('sanitize_callback' => 'openlab_sanitize_text'));
     $wp_customize->add_control('openlab_ourfocus_show', array('type' => 'checkbox', 'label' => __('Hide our focus section?', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'priority' => 1));
     /* our focus title */
     $wp_customize->add_setting('openlab_ourfocus_title', array('sanitize_callback' => 'openlab_sanitize_text', 'default' => __('Participate in Open Lab', 'openlab-txtd')));
     $wp_customize->add_control('openlab_ourfocus_title', array('label' => __('Title', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'settings' => 'openlab_ourfocus_title', 'priority' => 2));
     /* our focus subtitle */
     $wp_customize->add_setting('openlab_ourfocus_subtitle', array('sanitize_callback' => 'openlab_sanitize_text', 'default' => __('Get in touch, using the participation form', 'openlab-txtd')));
     $wp_customize->add_control('openlab_ourfocus_subtitle', array('label' => __('Our focus subtitle', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'settings' => 'openlab_ourfocus_subtitle', 'priority' => 3));
     /* Call to action Button */
     $wp_customize->add_setting('openlab_ourfocus_button_label', array('sanitize_callback' => 'openlab_sanitize_text', 'default' => __('Join Us', 'openlab-txtd')));
     $wp_customize->add_control('openlab_ourfocus_button_label', array('label' => __('Join Us label', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'settings' => 'openlab_ourfocus_button_label', 'priority' => 4));
     $available_forms = get_available_nf_forms();
     $available_forms[0] = __('-- Disabled --', 'openlab-txtd');
     $wp_customize->add_setting('openlab_ourfocus_button_nf_form', array('sanitize_callback' => 'openlab_sanitize_text', 'default' => '0'));
     $wp_customize->add_control('openlab_ourfocus_button_nf_form', array('label' => __('Select a form...', 'openlab-txtd'), 'section' => 'openlab_ourfocus_section', 'type' => 'select', 'settings' => 'openlab_ourfocus_button_nf_form', 'priority' => 5, 'choices' => $available_forms));
 }
 /************************************/
 /******* ABOUT US SECTION ***********/
 /************************************/
 if (class_exists('WP_Customize_Panel')) {
     $wp_customize->add_panel('panel_about', array('priority' => 34, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('About us section', 'openlab-txtd')));
     $wp_customize->add_section('openlab_aboutus_settings_section', array('title' => __('Settings', 'openlab-txtd'), 'priority' => 1, 'panel' => 'panel_about'));
     /* about us show/hide */
     $wp_customize->add_setting('openlab_aboutus_show', array('sanitize_callback' => 'openlab_sanitize_text'));
     $wp_customize->add_control('openlab_aboutus_show', array('type' => 'checkbox', 'label' => __('Hide about us section?', 'openlab-txtd'), 'section' => 'openlab_aboutus_settings_section', 'priority' => 1));
     $wp_customize->add_section('openlab_aboutus_main_section', array('title' => __('Main content', 'openlab-txtd'), 'priority' => 2, 'panel' => 'panel_about'));
     /* title */
Ejemplo n.º 2
0
function openlab_register_meta_boxes($meta_boxes)
{
    // Date time Picker for event START
    $meta_boxes[] = array('title' => __('The Date/Time Event Starts', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('name' => __('Date and time', 'openlab-txtd'), 'id' => 'event_datetime_start', 'type' => 'datetime', 'timestamp' => true, 'js_options' => array('stepMinute' => 15, 'showTimepicker' => true))), 'validation' => array('rules' => array('event_datetime_start' => array('required' => true)), 'messages' => array('event_datetime_start' => array('required' => __('Please select a date/time', 'openlab-txtd')))));
    // Date time Picker for event END time
    $meta_boxes[] = array('title' => __('The Date/Time Event Ends', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('name' => __('Date and time', 'openlab-txtd'), 'id' => 'event_datetime_end', 'type' => 'datetime', 'timestamp' => true, 'js_options' => array('stepMinute' => 15, 'showTimepicker' => true))), 'validation' => array('rules' => array('event_datetime_end' => array('required' => true)), 'messages' => array('event_datetime_end' => array('required' => __('Please select a date/time', 'openlab-txtd')))));
    // Google Map
    $meta_boxes[] = array('title' => __('Location of Event', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('id' => 'event_location', 'name' => __('Address', 'openlab-txtd'), 'type' => 'text', 'std' => __('Athens, Greece', 'openlab-txtd')), array('id' => 'map', 'name' => __('Location', 'openlab-txtd'), 'type' => 'map', 'std' => '37.9758306,23.7389269,15', 'address_field' => 'event_location')));
    //Type of event
    $meta_boxes[] = array('title' => __('Select the Type of Event', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('name' => __('Select the Type of Event', 'openlab-txtd'), 'id' => 'event_type', 'type' => 'select', 'options' => array('speech' => __('Speech', 'openlab-txtd'), 'seminar' => __('Seminar', 'openlab-txtd'), 'workshop' => __('Workshop', 'openlab-txtd')), 'multiple' => false, 'placeholder' => __('Select...', 'openlab-txtd'))), 'validation' => array('rules' => array('event_type' => array('required' => true)), 'messages' => array('event_type' => array('required' => __('Please select an event type', 'openlab-txtd')))));
    //Event Price field
    $meta_boxes[] = array('title' => __('Participation Ticket Price', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('name' => __('Event Price', 'openlab-txtd'), 'id' => 'event_price', 'type' => 'text', 'std' => __('FREE', 'openlab-txtd'), 'size' => '30')), 'validation' => array('rules' => array('event_price' => array('required' => true)), 'messages' => array('event_price' => array('required' => __('Please add the Event Price', 'openlab-txtd')))));
    $available_forms = get_available_nf_forms();
    if ($available_forms) {
        $meta_boxes[] = array('title' => __('Select a Ninja Form', 'openlab-txtd'), 'post_types' => 'event', 'fields' => array(array('name' => __('Select a ninja Form', 'openlab-txtd'), 'id' => 'selected_ninja_form_id', 'type' => 'select', 'options' => $available_forms, 'multiple' => false, 'placeholder' => __('Select...', 'openlab-txtd'))));
    }
    return $meta_boxes;
}