function activate_feature_block_fields()
{
    if (class_exists('ECF_Panel')) {
        $feature_block_text = ECF_Field::factory('textarea', 'feature_block_text', 'Feature Block Text');
        $feature_block_button_title = ECF_Field::factory('text', 'feature_block_button_title', 'Button Text');
        $feature_block_button_url = ECF_Field::factory('text', 'feature_block_button_url', 'Button URL');
        $feature_block_panel = new ECF_Panel('feature_block_panel', __('ESPRESSO: Feature Block Settings', 'espresso'), 'feature-block-items', 'normal', 'high');
        $feature_block_panel->add_fields(array($feature_block_text, $feature_block_button_title, $feature_block_button_url));
    } else {
        add_action('admin_notices', 'espresso_error');
    }
}
示例#2
0
$widget_block_2->add_options(array(false => 'Default (Page Widget Block B)', 1 => 'Page Widget Block A', 3 => 'Page Widget Block C'));
// Widget Block 3
$widget_block_3 = ECF_Field::factory('select', 'widget_block_3', __('Widget Block for ZONE 3:', 'espresso'));
$widget_block_3->add_options(array(false => 'Default (Page Widget Block C)', 1 => 'Page Widget Block A', 2 => 'Page Widget Block B'));
////////////////////////////////////////////////////////////////////////////////
// SEPARATORS //
$page_option_sep_1 = ECF_Field::factory('sep', 'seperator1');
$page_option_sep_2 = ECF_Field::factory('sep', 'seperator2');
$page_option_sep_3 = ECF_Field::factory('sep', 'seperator3');
$page_option_sep_4 = ECF_Field::factory('sep', 'seperator4');
$page_option_sep_5 = ECF_Field::factory('sep', 'seperator5');
$page_option_sep_6 = ECF_Field::factory('sep', 'seperator6');
$page_option_sep_7 = ECF_Field::factory('sep', 'seperator7');
////////////////////////////////////////////////////////////////////////////////
// SET UP THE PANEL //
$page_settings_panel = new ECF_Panel('page_settings_panel', __('ESPRESSO: Page Settings', 'espresso'), 'page', 'normal', 'high');
// Feature Blocks
if (post_type_exists('feature-block-items')) {
    $page_field_array[] = $slider_choice;
    $page_field_array[] = $page_option_sep_1;
    $page_field_array[] = $feature_block_layout;
    $page_field_array[] = $feature_blocks_order;
    $page_field_array[] = $feature_block_1;
    $page_field_array[] = $feature_block_2;
    $page_field_array[] = $feature_block_3;
    $page_field_array[] = $page_option_sep_2;
}
// Page Options
$page_field_array[] = $page_content_order;
$page_field_array[] = $page_options;
$page_field_array[] = $page_option_sep_3;
示例#3
0
<?php

////////////////////////////////////////////////////////////////////////////////
// SIDEBAR SETTINGS //
$sidebar_layout = ECF_Field::factory('imageradio', 'post_sidebar_layout', __('Sidebar Layout', 'savior'));
$sidebar_layout->add_options(array('right' => get_template_directory_uri() . '/_theme_settings/images/sidebar_right.png', 'left' => get_template_directory_uri() . '/_theme_settings/images/sidebar_left.png', 'no-sidebar' => get_template_directory_uri() . '/_theme_settings/images/sidebar_none.png'));
global $wp_registered_sidebars;
$sidebar_dropdown_elements = array();
foreach ($wp_registered_sidebars as $sidebar_id => $sidebar) {
    $sidebar_dropdown_elements[$sidebar['id']] = $sidebar['name'];
}
// Sidebar Choice
$sidebar_choice = ECF_Field::factory('select', 'post_sidebar_choice', __('Choose a sidebar:', 'savior'));
$sidebar_choice->add_options($sidebar_dropdown_elements);
////////////////////////////////////////////////////////////////////////////////
// POST CONTENT //
$post_options = ECF_Field::factory('set', 'post_options', __('Post Options', 'espresso'));
$post_options->add_options(array('hide_post_breadcrumbs' => __('Hide the breadcrumbs above the title.', 'espresso'), 'hide_post_title' => __('Hide the post title.', 'espresso')));
$post_option_sep_8 = ECF_Field::factory('sep', 'seperator8');
////////////////////////////////////////////////////////////////////////////////
// SET UP THE PANEL //
$post_settings_panel = new ECF_Panel('post_settings_panel', __('ESPRESSO: Post Settings', 'espresso'), 'post', 'normal', 'high');
$post_settings_panel->add_fields(array($post_options, $post_option_sep_8, $sidebar_layout, $sidebar_choice));
<?php

// Panel for Testimonials
$testimonial_person = ECF_Field::factory('text', 'person', 'Person\'s Name (optional)');
$testimonial_company = ECF_Field::factory('text', 'company', 'Company Name (optional)');
$testimonial_content = ECF_Field::factory('textarea', 'content', 'Testimonial');
$testimonial_settings_panel = new ECF_Panel('testimonial_settings_panel', __('Testimonial Settings', 'espresso'), 'testimonial-items', 'normal', 'high');
$testimonial_settings_panel->add_fields(array($testimonial_content, $testimonial_person, $testimonial_company));