Ejemplo n.º 1
0
 public static function register_fields()
 {
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_5419e3faf1616', 'title' => 'Typography - Embed Code', 'fields' => array(array('key' => 'field_5419e99e1d489', 'label' => 'Embed Code', 'name' => 'fru_embed_code', 'prefix' => '', 'type' => 'textarea', 'instructions' => 'Paste the embed code here if you are using external resources. This will be added into the <b>head</b> tag. <br>Quick links: <a href="https://typekit.com/fonts" target="_blank">Typekit</a>, <a href="http://www.typography.com/" target="_blank">Typography.com</a>, <a href="https://www.google.com/fonts" target="_blank">Google Web Fonts</a>', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => 4, 'new_lines' => '', 'readonly' => 0, 'disabled' => 0)), 'location' => array(array(array('param' => 'options_page', 'operator' => '==', 'value' => 'acf-options-typography'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
         register_field_group(array('key' => 'group_5419eccd2892e', 'title' => 'Typography - Font Family', 'fields' => array(array('key' => 'field_541afb9f700b0', 'label' => 'Font Family', 'name' => 'fru_font_family', 'prefix' => '', 'type' => 'flexible_content', 'instructions' => 'Font family name may change depending on your font resources.', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'button_label' => 'Add Font Family Styling', 'min' => '', 'max' => '', 'layouts' => array(array('key' => '541afba414e26', 'name' => 'fru_body', 'label' => 'Body Text', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541afbce700b1', 'label' => 'Body Font Family Name', 'name' => 'fru_body_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541afc07700b2', 'label' => 'Body Font Family Fallback', 'name' => 'fru_body_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541afc38700b3', 'label' => 'Body Font Size', 'name' => 'fru_body_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541afc73700b4', 'label' => 'Body Font Color', 'name' => 'fru_body_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '')), 'min' => '', 'max' => 1), array('key' => '541b1d4bb9111', 'name' => 'fru_primary_menu_font', 'label' => 'Primary Menu', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b1d4bb9112', 'label' => 'Menu Font Family Name', 'name' => 'fru_primary_menu_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1d4bb9113', 'label' => 'Menu Font Family Fallback', 'name' => 'fru_primary_menu_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b1d4bb9114', 'label' => 'Menu Font Size', 'name' => 'fru_primary_menu_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1d4bb9115', 'label' => 'Menu Font Color', 'name' => 'fru_primary_menu_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '')), 'min' => '', 'max' => 1), array('key' => '541b18bb6bc89', 'name' => 'fru_heading_1', 'label' => 'Heading 1', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b18bb6bc8a', 'label' => 'H1 Font Family Name', 'name' => 'fru_h1_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b18bb6bc8b', 'label' => 'H1 Font Family Fallback', 'name' => 'fru_h1_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b18bb6bc8c', 'label' => 'H1 Font Size', 'name' => 'fru_h1_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b18bb6bc8d', 'label' => 'H1 Font Color', 'name' => 'fru_h1_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '')), 'min' => '', 'max' => 1), array('key' => '541afcebe92f4', 'name' => 'fru_heading_2', 'label' => 'Heading 2', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541afcebe92f5', 'label' => 'H2 Font Family Name', 'name' => 'fru_h2_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541afcebe92f6', 'label' => 'H2 Font Family Fallback', 'name' => 'fru_h2_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541afcebe92f7', 'label' => 'H2 Font Size', 'name' => 'fru_h2_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541afcebe92f8', 'label' => 'H2 Font Color', 'name' => 'fru_h2_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '#000000')), 'min' => '', 'max' => 1), array('key' => '541b1412abc72', 'name' => 'fru_heading_3', 'label' => 'Heading 3', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b1412abc73', 'label' => 'H3 Font Family Name', 'name' => 'fru_h3_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1412abc74', 'label' => 'H3 Font Family Fallback', 'name' => 'fru_h3_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b1412abc75', 'label' => 'H3 Font Size', 'name' => 'fru_h3_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1412abc76', 'label' => 'H3 Font Color', 'name' => 'fru_h3_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '#000000')), 'min' => '', 'max' => 1), array('key' => '541b1443abc77', 'name' => 'fru_heading_4', 'label' => 'Heading 4', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b1443abc78', 'label' => 'H4 Font Family Name', 'name' => 'fru_h4_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1443abc79', 'label' => 'H4 Font Family Fallback', 'name' => 'fru_h4_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b1443abc7a', 'label' => 'H4 Font Size', 'name' => 'fru_h4_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1443abc7b', 'label' => 'H4 Font Color', 'name' => 'fru_h4_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '#000000')), 'min' => '', 'max' => 1), array('key' => '541b1460abc7c', 'name' => 'fru_heading_5', 'label' => 'Heading 5', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b1460abc7d', 'label' => 'H5 Font Family Name', 'name' => 'fru_h5_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1460abc7e', 'label' => 'H5 Font Family Fallback', 'name' => 'fru_h5_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b1460abc7f', 'label' => 'H5 Font Size', 'name' => 'fru_h5_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b1460abc80', 'label' => 'H5 Font Color', 'name' => 'fru_h5_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '#000000')), 'min' => '', 'max' => 1), array('key' => '541b147babc81', 'name' => 'fru_heading_6', 'label' => 'Heading 6', 'display' => 'table', 'sub_fields' => array(array('key' => 'field_541b147babc82', 'label' => 'H6 Font Family Name', 'name' => 'fru_h6_font_family_name', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 30, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b147babc83', 'label' => 'H6 Font Family Fallback', 'name' => 'fru_h6_font_fallback', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 20, 'class' => '', 'id' => ''), 'choices' => array('sans-serif' => 'sans-serif', 'serif' => 'serif', 'mono' => 'mono'), 'default_value' => array('serif' => 'serif'), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_541b147babc84', 'label' => 'H6 Font Size', 'name' => 'fru_h6_font_size', 'prefix' => '', 'type' => 'number', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 10, 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_541b147babc85', 'label' => 'H6 Font Color', 'name' => 'fru_h6_font_color', 'prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => 40, 'class' => '', 'id' => ''), 'default_value' => '#000000')), 'min' => '', 'max' => 1)))), 'location' => array(array(array('param' => 'options_page', 'operator' => '==', 'value' => 'acf-options-typography'))), 'menu_order' => 2, 'position' => 'normal', 'style' => 'seamless', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
 public static function init()
 {
     if (!function_exists('register_field_group')) {
         return;
     }
     register_field_group(array('id' => 'acf_test-group', 'title' => 'Test group', 'fields' => array(array('key' => 'field_1000000000000', 'label' => 'Test bool', 'name' => 'test_bool', 'type' => 'true_false', 'message' => '', 'default_value' => 0)), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
 }
Ejemplo n.º 3
0
function load_acf_fields()
{
    if (function_exists('register_field_group')) {
        $welcome_fields = apply_filters(NS . 'Fields', array());
        register_field_group($welcome_fields);
    }
}
Ejemplo n.º 4
0
 function htFeatureNews()
 {
     parent::WP_Widget(false, 'HT Feature news', array('description' => 'Display feature news stories'));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54bfacd48f6e7', 'title' => 'Feature news widget', 'fields' => array(array('key' => 'field_54c03e5d0f3f4', 'label' => 'Pin stories', 'name' => 'pin_stories', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'news', 1 => 'blog', 2 => 'event'), 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id'), array('key' => 'field_54bfacd9a9fbb', 'label' => 'Exclude stories', 'name' => 'exclude_stories', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'news'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htfeaturenews'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'seamless', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
Ejemplo n.º 5
0
 function htIntraverts()
 {
     parent::WP_Widget(false, __('HT Intraverts', 'govintranet'), array('description' => __('Displays an individual spot from a selection of spots and hides from user if already viewed', 'govintranet')));
     /*
     Load css
     */
     wp_enqueue_style('intraverts', plugins_url("/ht-intraverts-ajax/css/ht_intraverts.css"));
     /*
     Register intravert custom post type
     */
     add_action('init', 'cptui_register_my_cpt_intravert');
     function cptui_register_my_cpt_intravert()
     {
         register_post_type('intravert', array('label' => 'Intraverts', 'description' => '', 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => array('slug' => 'intravert', 'with_front' => true), 'query_var' => true, 'has_archive' => true, 'exclude_from_search' => true, 'menu_position' => '30', 'menu_icon' => 'dashicons-welcome-view-site', 'supports' => array('title', 'editor', 'excerpt', 'revisions', 'thumbnail', 'author', 'page-attributes'), 'labels' => array('name' => 'Intraverts', 'singular_name' => 'Intravert', 'menu_name' => 'Intraverts', 'add_new' => __('Add Intravert', 'govintranet'), 'add_new_item' => __('Add New Intravert', 'govintranet'), 'edit' => __('Edit', 'govintranet'), 'edit_item' => __('Edit Intravert', 'govintranet'), 'new_item' => __('New Intravert', 'govintranet'), 'view' => __('View Intravert', 'govintranet'), 'view_item' => __('View Intravert', 'govintranet'), 'search_items' => __('Search Intraverts', 'govintranet'), 'not_found' => __('No Intraverts Found', 'govintranet'), 'not_found_in_trash' => __('No Intraverts Found in Trash', 'govintranet'), 'parent' => __('Parent Intravert', 'govintranet'))));
     }
     /*
     Register Advanced Custom Fields for the intraverts custom post type
     */
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_5494c172a5fb9', 'title' => 'Intraverts', 'fields' => array(array('key' => 'field_5494c635e6e0e', 'label' => __('Link text', 'govintranet'), 'name' => 'intravert_link_text', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_5494c648e6e0f', 'label' => __('Intranet destination page', 'govintranet'), 'name' => 'intravert_destination_page', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type', 2 => 'taxonomy'), 'elements' => array(0 => 'featured_image'), 'max' => 1, 'return_format' => 'id'), array('key' => 'field_54bc153f9a49c', 'label' => 'Cookie period', 'name' => 'intravert_cookie_period', 'prefix' => '', 'type' => 'number', 'instructions' => 'The number of days before the intravert will reappear after being viewed. Default is 14 days.', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_5494c1c796832', 'label' => __('Date range', 'govintranet'), 'name' => 'intravert_date_range', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'message' => '', 'default_value' => 0), array('key' => 'field_5494c21a96833', 'label' => __('Start date', 'govintranet'), 'name' => 'intravert_start_date', 'prefix' => '', 'type' => 'date_picker', 'instructions' => '', 'required' => 1, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c1c796832', 'operator' => '==', 'value' => '1'))), 'display_format' => 'd/m/Y', 'return_format' => 'd/m/Y', 'first_day' => 1), array('key' => 'field_5494c25596834', 'label' => __('End date', 'govintranet'), 'name' => 'intravert_end_date', 'prefix' => '', 'type' => 'date_picker', 'instructions' => '', 'required' => 1, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c1c796832', 'operator' => '==', 'value' => '1'))), 'display_format' => 'd/m/Y', 'return_format' => 'd/m/Y', 'first_day' => 1), array('key' => 'field_5494c18696831', 'label' => __('Target logged in users', 'govintranet'), 'name' => 'intravert_logged_in_only', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'message' => '', 'default_value' => 0), array('key' => 'field_5494d7fd784af', 'label' => __('Contributors and above', 'govintranet'), 'name' => 'intravert_contributors', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'message' => '', 'default_value' => 0), array('key' => 'field_5494c2af96836', 'label' => __('Teams', 'govintranet'), 'name' => 'intravert_teams', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'post_type' => array(0 => 'team'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'object'), array('key' => 'field_5494c30696837', 'label' => __('Grades', 'govintranet'), 'name' => 'intravert_grades', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'taxonomy' => 'grade', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'object', 'multiple' => 0), array('key' => 'field_5494c29196835', 'label' => __('Target content', 'govintranet'), 'name' => 'intravert_target_content', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'choices' => array('All' => 'All', 'Task category' => 'Task category', 'News type' => 'News type'), 'default_value' => array(), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_5494d3330049d', 'label' => __('Task category', 'govintranet'), 'name' => 'intravert_category', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_rule_0' => array('field' => 'field_5494c29196835', 'operator' => '==', 'value' => 'Task category'))), 'taxonomy' => 'category', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0), array('key' => 'field_5494d775784ae', 'label' => __('News type', 'govintranet'), 'name' => 'intravert_news_type', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_0' => array('field' => 'field_5494c29196835', 'operator' => '==', 'value' => 'News type'))), 'taxonomy' => 'news-type', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'intravert'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
         /*
         Register Advanced Custom Fields for the intraverts widget
         */
         register_field_group(array('key' => 'group_54c2f059881dc', 'title' => __('Intraverts widget', 'govintranet'), 'fields' => array(array('key' => 'field_54c2f09fa63e3', 'label' => __('Eligible intraverts', 'govintranet'), 'name' => 'eligible_intraverts', 'prefix' => '', 'type' => 'relationship', 'instructions' => __('Choose which intraverts are eligible to appear in this widget area.', 'govintranet'), 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'intravert'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => array(0 => 'featured_image'), 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htintraverts'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
Ejemplo n.º 6
0
 function __construct()
 {
     parent::__construct('htMostActive', __('HT Most active', 'govintranet'), array('description' => __('Display pages with most pageviews', 'govintranet')));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c3150a2b558', 'title' => __('Most active widget', 'govintranet'), 'fields' => array(array('key' => 'field_55327bd9f4f3d', 'label' => __('Show guide chapters', 'govintranet'), 'name' => 'show_guide_chapters', 'prefix' => '', 'type' => 'true_false', 'instructions' => __('If enabled, this option will show individual guide chapters. If disabled, only main guide pages will appear.', 'govintranet'), 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'message' => '', 'default_value' => 0), array('key' => 'field_54c31510b4670', 'label' => __('Exclude', 'govintranet'), 'name' => 'exclude_posts', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htmostactive'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
Ejemplo n.º 7
0
 function __construct()
 {
     parent::__construct('htAboutThisPage', __('HT About this page', 'govintranet'), array('description' => __('Display page metadata', 'govintranet')));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c8168128e72', 'title' => __('About this page widget', 'govintranet'), 'fields' => array(array('key' => 'field_54c816872d1e0', 'label' => __('Display also on children of:', 'govintranet'), 'name' => 'about_this_page_children', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'page'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htaboutthispage'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
Ejemplo n.º 8
0
/**
 * Register custom fields using Advanced Custom Fields (ACF). For example
 * 'Illustrator' field on posts.
 */
function my_acf_add_local_field_groups()
{
    write_log("my_acf_add_local_field_groups() called.");
    if (function_exists("register_field_group")) {
        register_field_group(array('id' => 'acf_skin-deep-article', 'title' => 'Skin Deep Article', 'fields' => array(array('key' => 'field_5833fcdadee6a', 'label' => 'Author', 'name' => 'author', 'type' => 'text', 'instructions' => 'The person who wrote the piece', 'required' => 1, 'default_value' => '', 'placeholder' => '', 'prepend' => ' ', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'field_5833fd0edee6b', 'label' => 'Illustrator', 'name' => 'illustrator', 'type' => 'text', 'instructions' => 'The person who created the illustrations', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'author')), 'menu_order' => 0));
    }
}
Ejemplo n.º 9
0
 function govsite_register_modular_custom_fields()
 {
     // Post - show full width featured image
     register_field_group(array('id' => 'acf_full-width-image', 'title' => 'Full width image', 'fields' => array(array('key' => 'field_543fdbe0826f8', 'label' => 'Show featured image', 'name' => 'show_featured_image', 'type' => 'true_false', 'instructions' => 'Show full width featured image?', 'message' => '', 'default_value' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
     // Contact page template - map
     register_field_group(array('id' => 'acf_location', 'title' => 'Location', 'fields' => array(array('key' => 'field_5481c4c36cfd7', 'label' => 'Google Maps URL', 'name' => 'google_maps_url', 'type' => 'text', 'instructions' => 'Paste the iframe src URL', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '')), 'location' => array(array(array('param' => 'page_template', 'operator' => '==', 'value' => 'template-contact.php', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
 }
Ejemplo n.º 10
0
 function htMostRecent()
 {
     parent::WP_Widget(false, __('HT MostRecent', 'govintranet'), array('description' => __('Display most recent posts', 'govintranet')));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c30b1243bd6', 'title' => _x('Most recent widget', 'Widget that lists the most recent posts', 'govintranet'), 'fields' => array(array('key' => 'field_54c30b1d69d24', 'label' => __('Exclude', 'govintranet'), 'name' => 'exclude_posts', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htmostrecent'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
 function acf_wpcli_register_groups()
 {
     global $blog_id;
     if (function_exists("register_field_group")) {
         global $wpdb;
         $db_field_groups = $wpdb->get_results("SELECT post_title FROM {$wpdb->posts} WHERE post_type='acf' AND post_status='publish';");
         $db_field_group_titles = array();
         foreach ($db_field_groups as $db_group) {
             $db_field_group_titles[] = $db_group->post_title;
         }
         $paths = array('active_theme' => get_template_directory() . '/field-groups/', 'active_child_theme' => get_stylesheet_directory() . '/field-groups/', 'child_themes_shared' => ABSPATH . 'field-groups/shared-childs/');
         $paths = apply_filters('acfwpcli_fieldgroup_paths', $paths);
         $patterns = array();
         foreach ($paths as $key => $value) {
             if (!is_dir($value)) {
                 continue;
             }
             $patterns[$key] = trailingslashit($value) . '*/data.php';
         }
         $added_groups = array();
         foreach ($patterns as $pattern) {
             // register the field groups specific for this subsite
             foreach (glob($pattern) as $file) {
                 $group = acf_wpcli_get_file_data($file);
                 // Don't register group when the group is already in the DB
                 if (!in_array($group['title'], $db_field_group_titles)) {
                     register_field_group($group);
                 }
                 $added_groups[] = $group['title'];
             }
         }
     }
 }
Ejemplo n.º 12
0
 public function register_field()
 {
     register_field_group(array('id' => 'acf_audio-settings', 'title' => 'Audio Settings', 'fields' => array(array('key' => 'field_55b283ac146d0', 'label' => 'MP3 File URL', 'name' => 'post_audio_mp3_file_url', 'type' => 'file', 'save_format' => 'url', 'library' => 'all'), array('key' => 'field_55b283df146d1', 'label' => 'OGA File URL', 'name' => 'post_audio_oga_file_url', 'type' => 'file', 'save_format' => 'url', 'library' => 'all')), 'location' => array(array(array('param' => 'post_format', 'operator' => '==', 'value' => 'audio', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
     register_field_group(array('id' => 'acf_gallery-settings', 'title' => 'Gallery Settings', 'fields' => array(array('key' => 'field_55b14eaf8363f', 'label' => 'The Gallery', 'name' => 'post_gallery', 'type' => 'gallery', 'preview_size' => 'thumbnail', 'library' => 'all')), 'location' => array(array(array('param' => 'post_format', 'operator' => '==', 'value' => 'gallery', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
     register_field_group(array('id' => 'acf_link-settings', 'title' => 'Link Settings', 'fields' => array(array('key' => 'field_55b147f427f78', 'label' => 'The Link', 'name' => 'post_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_format', 'operator' => '==', 'value' => 'link', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
     register_field_group(array('id' => 'acf_quote-settings', 'title' => 'Quote Settings', 'fields' => array(array('key' => 'field_55b13d4b062cc', 'label' => 'The Quote', 'name' => 'post_quote', 'type' => 'textarea', 'default_value' => '', 'placeholder' => 'Your Quote', 'maxlength' => '', 'rows' => '', 'formatting' => 'br'), array('key' => 'field_55b13ef04f5c1', 'label' => 'The Author', 'name' => 'post_quote_author', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_format', 'operator' => '==', 'value' => 'quote', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
     register_field_group(array('id' => 'acf_video-settings', 'title' => 'Video Settings', 'fields' => array(array('key' => 'field_55b167ec6dca9', 'label' => 'The Options', 'name' => 'post_video_options', 'type' => 'radio', 'choices' => array('upload' => 'Upload', 'embed' => 'Embed'), 'other_choice' => 0, 'save_other_choice' => 0, 'default_value' => 'embed', 'layout' => 'horizontal'), array('key' => 'field_55b168356dcaa', 'label' => 'Embedded Code', 'name' => 'post_video_embedded_code', 'type' => 'textarea', 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55b167ec6dca9', 'operator' => '==', 'value' => 'embed')), 'allorany' => 'all'), 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '', 'formatting' => 'none'), array('key' => 'field_55b168a20395f', 'label' => 'M4V File URL', 'name' => 'post_video_m4v_file_url', 'type' => 'file', 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55b167ec6dca9', 'operator' => '==', 'value' => 'upload')), 'allorany' => 'all'), 'save_format' => 'url', 'library' => 'all'), array('key' => 'field_55b168e903960', 'label' => 'OGV File URL', 'name' => 'post_video_ogv_file_url', 'type' => 'file', 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55b167ec6dca9', 'operator' => '==', 'value' => 'upload')), 'allorany' => 'all'), 'save_format' => 'url', 'library' => 'all'), array('key' => 'field_55b1696ce5209', 'label' => 'Poster Image', 'name' => 'post_video_poster_image', 'type' => 'file', 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55b167ec6dca9', 'operator' => '==', 'value' => 'upload')), 'allorany' => 'all'), 'save_format' => 'url', 'library' => 'all')), 'location' => array(array(array('param' => 'post_format', 'operator' => '==', 'value' => 'video', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
 }
Ejemplo n.º 13
0
/**
 * Construct and register default Persona group.
 *
 * Constructs and registers the default group with three fields. 
 * Note that this function / file serves as a good base for introducing
 * more persona groups. Persona groups are actually ACF field groups,
 * so there are many options / possibilities available.
 *
 * @since 1.0.0
 * @access public
 */
function mca_wp_register_default_group()
{
    $title = "Persona Details";
    if (function_exists("register_field_group")) {
        register_field_group(array('id' => 'acf_default-persona-details', 'title' => 'Default Persona Details', 'fields' => array(array('key' => 'mca_wp_default_persona_group_desc', 'label' => 'Persona Description', 'name' => 'persona_description', 'type' => 'textarea', 'instructions' => 'Enter a description of your Persona here.', 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '3', 'formatting' => 'br'), array('key' => 'mca_wp_default_persona_detail_1', 'label' => 'Persona Detail 1', 'name' => 'mca_wp_default_persona_detail_1', 'type' => 'text', 'instructions' => '<input class="code" type="text" onfocus="this.select();" readonly="readonly" value="[mca_d 1]"> <input class="code" type="text" onfocus="this.select();" readonly="readonly" value="<?php mca_wp_d( \'1\' ); ?>">', 'formatting' => 'html'), array('key' => 'mca_wp_default_persona_detail_2', 'label' => 'Persona Detail 2', 'name' => 'mca_wp_default_persona_detail_2', 'type' => 'text', 'instructions' => '<input class="code" type="text" onfocus="this.select();" readonly="readonly" value="[mca_d 2]"> <input class="code" type="text" onfocus="this.select();" readonly="readonly" value="<?php mca_wp_d( \'2\' ); ?>">', 'formatting' => 'html'), array('key' => 'mca_wp_default_persona_detail_3', 'label' => 'Persona Detail 3', 'name' => 'mca_wp_default_persona_detail_3', 'type' => 'text', 'instructions' => '<input class="code" type="text" onfocus="this.select();" readonly="readonly" value="[mca_d 3]"> <input class="code" type="text" onfocus="this.select();" readonly="readonly" value="<?php mca_wp_d( \'3\' ); ?>">', 'formatting' => 'html')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'persona', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'box', 'hide_on_screen' => array()), 'menu_order' => 0));
    }
    // END if
}
Ejemplo n.º 14
0
    function register_fields()
    {
        if (function_exists("register_field_group")) {
            register_field_group(array('id' => 'acf_casos', 'title' => 'Casos', 'fields' => array(array('key' => 'field_5650f2e430101', 'label' => 'Casos', 'name' => 'casos', 'type' => 'relationship', 'instructions' => 'Casos relacionados ao dossiê', 'return_format' => 'id', 'post_type' => array(0 => 'case'), 'taxonomy' => array(0 => 'all'), 'filters' => array(0 => 'search'), 'result_elements' => array(0 => 'post_type', 1 => 'post_title'), 'max' => ''), array('key' => 'field_casos_query', 'label' => 'Casos relacionados por consulta', 'name' => 'casos_query', 'type' => 'textarea', 'instructions' => 'Selecione casos através de consulta de metadados.
      <br/>Por ex: uf=Mato Grosso do Sul; povo=Guarani Kaiowá; ano=2013;

      <br/><br/>Se houver seleção de casos pelo método individual essa consulta não será utilizada.', 'default_value' => '', 'placeholder' => 'uf=Mato Grosso do Sul; povo=Guarani Kaiowá; ano=2013;', 'maxlength' => '', 'rows' => '', 'formatting' => 'none')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'dossier', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
        }
    }
Ejemplo n.º 15
0
 public function register_pins()
 {
     foreach ($this->posts as $key => $value) {
         register_post_type($key, $value);
     }
     /** Add metaboxes for Latitude and Longitude the lazy way */
     if (class_exists('acf')) {
         $opts = array('id' => 'acf_latitudelongitude', 'title' => 'Latitude/Longitude', 'fields' => array(array('key' => 'field_56b70ac065fef', 'label' => 'Latitude', 'name' => 'latitude', 'type' => 'text', 'required' => 1, 'default_value' => '', 'placeholder' => '16.7758', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'field_56b70ae565ff0', 'label' => 'Longitude', 'name' => 'longitude', 'type' => 'text', 'required' => 1, 'default_value' => '', 'placeholder' => '3.0094', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'pin', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'permalink', 1 => 'excerpt', 2 => 'custom_fields', 3 => 'discussion', 4 => 'comments', 5 => 'revisions', 6 => 'slug', 7 => 'author', 8 => 'format', 9 => 'send-trackbacks')), 'menu_order' => 0);
         register_field_group($opts);
     }
     /** @todo Add lat./lon., city or country metaboxes if ACF not present */
 }
Ejemplo n.º 16
0
 /**
  * Registers all the field groups added
  *
  * @author Tim Perry
  */
 public function registerFieldGroups()
 {
     if (!function_exists('register_field_group')) {
         return;
     }
     $this->fieldGroups->rewind();
     while ($this->fieldGroups->valid()) {
         $field = $this->fieldGroups->current();
         register_field_group($field->getConfig());
         $this->fieldGroups->next();
     }
 }
 /**
  * ACF register field group
  * @param $title
  * @param array $fields
  * @param array $location
  * @param array $options
  */
 private static function hw_acf_register_field_group($title, $fields = array(), $location = array(), $options = array())
 {
     //define( 'ACF_LITE', true );
     if (function_exists("register_field_group")) {
         //parse id
         $id = preg_replace('|[\\s,~\\!@#\\$%\\^&\\*\\(\\)\\-\\+\\/]+|', '_', $title);
         //valid options
         if (empty($options)) {
             $options = array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array());
         }
         //note, this create field group hidden not show in acf manager
         register_field_group(array('id' => 'acf_' . $id, 'title' => $title, 'fields' => $fields, 'location' => $location, 'options' => $options, 'menu_order' => 0));
     }
 }
 function loadCustomFields()
 {
     $cursos = $this->getCursosWp();
     $choices = array();
     foreach ($cursos as $curso) {
         $choices[$curso->id_grupo] = $curso->descripcion;
     }
     if (function_exists("register_field_group")) {
         register_field_group(array('id' => 'acf_testing', 'title' => 'Testing', 'fields' => array(array('key' => 'field_564b3a8ea80e7', 'label' => 'Curso Educativa', 'name' => 'educativa_curso_id', 'type' => 'select', 'choices' => $choices, 'default_value' => '', 'allow_null' => 1, 'multiple' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 19
0
function create_custom_ad_image()
{
    register_post_type('custom_ad_images', array('labels' => array('name' => 'Adapt Ads', 'singular_name' => 'Adapt Ads', 'add_new' => 'Add New', 'add_new_item' => 'Add New Image', 'edit' => 'Edit', 'edit_item' => 'Edit Image', 'new_item' => 'New Image', 'view' => 'View', 'view_item' => 'View Image', 'search_items' => 'Search Images', 'not_found' => 'No Images Found', 'not_found_in_trash' => 'No Images Found in Trash', 'parent' => 'Parent Image'), 'public' => true, 'menu_position' => 15, 'supports' => array('title'), 'taxonomies' => array(''), 'menu_icon' => 'dashicons-format-image', 'has_archive' => true));
    if (function_exists("register_field_group")) {
        register_field_group(array('id' => 'acf_ad-image-fields', 'title' => 'Ad Image Fields', 'fields' => array(array('key' => 'field_550e1c2b18e21', 'label' => 'Image', 'name' => 'image', 'type' => 'image', 'required' => 1, 'save_format' => 'object', 'preview_size' => 'medium', 'library' => 'all'), array('key' => 'field_550e1cb413108', 'label' => 'Message Font', 'name' => 'message_font', 'type' => 'file', 'instructions' => 'Upload a .ttf Font File', 'required' => 1, 'save_format' => 'object', 'library' => 'all'), array('key' => 'field_550e1d0b1310a', 'label' => 'Font Size', 'name' => 'font_size', 'type' => 'number', 'required' => 1, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => 1, 'max' => '', 'step' => 1), array('key' => 'field_550e1cf913109', 'label' => 'Message Color', 'name' => 'message_color', 'type' => 'color_picker', 'required' => 1, 'default_value' => ''), array('key' => 'field_550e2bae40024', 'label' => 'Distance from Top', 'name' => 'distance_from_top', 'type' => 'number', 'instructions' => 'Distance from the top of the image in pixels', 'required' => 1, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => 0, 'max' => '', 'step' => 1), array('key' => 'field_550e2cd740025', 'label' => 'Distance from Left', 'name' => 'distance_from_left', 'type' => 'number', 'instructions' => 'Distance from the left of the image in pixels', 'required' => 1, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => 0, 'max' => '', 'step' => 1)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'custom_ad_images', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
    }
    // Add Additional MIME Type Support
    function my_myme_types($mime_types)
    {
        $mime_types['ttf'] = 'ttf';
        //Add ttf extension
        return $mime_types;
    }
    add_filter('upload_mimes', 'my_myme_types', 1, 1);
}
Ejemplo n.º 20
0
 protected static function register_field_group($group_data)
 {
     if (!function_exists("register_field_group")) {
         throw new Exception("Missing register_field_group function. Did you include ACF plugin?", 1);
     }
     $group_id = isset($group_data['id']) ? $group_data['id'] : $group_data['key'];
     $fields = $group_data['fields'];
     $newly_registered = array();
     foreach ($fields as $f) {
         $field_key = $f['key'];
         $newly_registered[$field_key] = array('group_id' => $group_id, 'field' => $f);
     }
     static::add_registered_fields($newly_registered);
     register_field_group($group_data);
 }
Ejemplo n.º 21
0
function webseries_fields()
{
    // Artist Info
    if (function_exists("register_field_group")) {
        $artist_fields = array('id' => 'acf_webseries', 'title' => 'Webseries', 'fields' => array(array('key' => 'artist', 'label' => 'Artist', 'name' => '', 'type' => 'tab'), array('key' => 'site', 'label' => 'Site', 'name' => 'site', 'type' => 'text', 'instructions' => 'Enter artist\'s web page.', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'description', 'label' => 'Description', 'name' => 'description', 'type' => 'textarea', 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '3', 'formatting' => 'br'), array('key' => 'main_image', 'label' => 'Main Image', 'name' => 'main_image', 'type' => 'image', 'instructions' => 'Upload image size 1600x800 only.', 'required' => 1, 'save_format' => 'url', 'preview_size' => 'medium', 'library' => 'all'), array('key' => 'thumbnail_image', 'label' => 'Thumbnail Image', 'name' => 'thumbnail_image', 'type' => 'image', 'instructions' => 'Upload image size 400x200 (optionally the main Webseries photo).', 'required' => 1, 'save_format' => 'url', 'preview_size' => 'medium', 'library' => 'all'), array('key' => 'gallery', 'label' => 'Gallery', 'name' => '', 'type' => 'tab'), array('key' => 'photos', 'label' => 'Photos', 'name' => 'photos', 'type' => 'repeater', 'instructions' => 'Upload image size 1600x800 only.', 'sub_fields' => array(array('key' => 'name', 'label' => 'Name', 'name' => 'name', 'type' => 'text', 'column_width' => '', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'photo', 'label' => 'Photo', 'name' => 'photo', 'type' => 'image', 'column_width' => '', 'save_format' => 'url', 'preview_size' => 'medium', 'library' => 'all')), 'row_min' => '', 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row'), array('key' => 'videos_tab', 'label' => 'Videos', 'name' => '', 'type' => 'tab'), array('key' => 'videos', 'label' => 'Videos', 'name' => 'videos', 'type' => 'repeater', 'instructions' => 'Limit only to three (3) videos', 'sub_fields' => array(array('key' => 'video_type', 'label' => 'Video Type', 'name' => 'video_type', 'type' => 'select', 'column_width' => '', 'choices' => array('youtube' => 'Youtube', 'vevo' => 'Vevo'), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0), array('key' => 'video_title', 'label' => 'Title', 'name' => 'title', 'type' => 'text', 'column_width' => '', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => 100), array('key' => 'video_url', 'label' => 'Video Code', 'name' => 'video_url', 'type' => 'text', 'instructions' => 'Only the video code, not the URL. Youtube only, please.', 'column_width' => '', 'default_value' => '', 'placeholder' => '', 'prepend' => 'http://www.youtube.com/embed/', 'append' => '', 'formatting' => 'none', 'maxlength' => '')), 'row_min' => '', 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row'), array('key' => 'album', 'label' => 'Album', 'name' => '', 'type' => 'tab'), array('key' => 'album_title', 'label' => 'Album Title', 'name' => 'album_title', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'album_link', 'label' => 'Album Link', 'name' => 'album_link', 'type' => 'text', 'instructions' => 'Set the album link to iTunes (complete URL)', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'album_thumbnail', 'label' => 'Album Thumbnail', 'name' => 'album_thumbnail', 'type' => 'image', 'instructions' => 'Add image size 150x150 only.', 'save_format' => 'url', 'preview_size' => 'large', 'library' => 'all')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'webisodes', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array(0 => 'the_content', 1 => 'discussion', 2 => 'comments', 3 => 'format', 4 => 'featured_image', 5 => 'categories', 6 => 'tags', 7 => 'send-trackbacks')), 'menu_order' => 0);
        register_field_group($artist_fields);
    }
    // Season Info
    if (function_exists("register_field_group")) {
        $season_info = array('id' => 'acf_webisode', 'title' => 'Webisode', 'fields' => array(array('key' => 'season', 'label' => 'Season', 'name' => 'season', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'episode', 'label' => 'Episode', 'name' => 'episode', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'is_featured', 'label' => 'Is Featured?', 'name' => 'is_featured', 'type' => 'select', 'choices' => array('No', 'Yes'), 'default_value' => "1", 'layout' => 'vertical')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'webisodes', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'side', 'layout' => 'default', 'hide_on_screen' => array(0 => 'the_content', 1 => 'discussion', 2 => 'comments', 3 => 'format', 4 => 'featured_image', 5 => 'categories', 6 => 'tags', 7 => 'send-trackbacks')), 'menu_order' => 0);
        register_field_group($season_info);
    }
    if (function_exists("register_field_group")) {
        $gcproduct_url = array('id' => 'acf_gc-products-url', 'title' => 'GC Products URL', 'fields' => array(array('key' => 'product_url', 'label' => 'GC Product URL', 'name' => 'url', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'product_description', 'label' => 'Product Description', 'name' => 'product_description', 'type' => 'textarea', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'gcproducts', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0);
        register_field_group($gcproduct_url);
    }
}
Ejemplo n.º 22
0
 function video_metabox()
 {
     global $wp_post_types;
     $exclude_pt = array('revision', 'nav_menu_item', 'acf', 'attachment', 'deprecated_log', 'page');
     $post_id = isset($_REQUEST['post']) ? (int) $_REQUEST['post'] : null;
     $post_type_array = array();
     foreach ($wp_post_types as $pt) {
         if (!empty($pt->name) && !in_array($pt->name, $exclude_pt)) {
             $post_type_array[$pt->name] = $pt->label;
         }
     }
     if (function_exists("register_field_group")) {
         register_field_group(array('id' => 'acf_video', 'title' => 'Video', 'fields' => array(array('key' => 'field_530fdb12d0660', 'label' => __('Video URL', 'mars'), 'name' => '', 'type' => 'tab'), array('key' => 'field_530eea326c4fa', 'label' => __('Video URL', 'mars'), 'name' => 'video_url', 'type' => 'text', 'default_value' => '', 'placeholder' => 'http://www.youtube.com/watch?v=X6pQ-pNSnRE', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'field_530fdb12d0661', 'label' => __('iFrame/Object', 'mars'), 'name' => '', 'type' => 'tab'), array('key' => 'field_530eea326c4fb', 'label' => __('iFrame/Object', 'mars'), 'name' => 'video_frame', 'type' => 'textarea', 'default_value' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'field_530fdc0e6fafe', 'label' => __('Upload Video', 'mars'), 'name' => '', 'type' => 'tab'), array('key' => 'field_530fdcf98024b', 'label' => __('Video File (mp4, m4v, webm, ogv, wmv, flv)', 'mars'), 'name' => 'video_file', 'type' => 'file', 'save_format' => 'id', 'library' => 'all')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'video', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
         register_field_group(array('id' => 'acf_layout', 'title' => __('Choose Layout', 'mars'), 'fields' => array(array('key' => 'field_531980e906752', 'label' => '', 'name' => 'layout', 'type' => 'radio', 'choices' => array('small' => __('Small', 'mars'), 'large' => __('Large', 'mars')), 'other_choice' => 0, 'save_other_choice' => 0, 'default_value' => 'small', 'layout' => 'horizontal')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'video', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
         register_field_group(array('id' => 'acf_post-type', 'title' => __('Post Type', 'mars'), 'fields' => array(array('key' => 'field_535765e9e7089', 'label' => __('Post Type', 'mars'), 'name' => 'videotube_post_type', 'type' => 'select', 'instructions' => __('This option is used in infinity rolling page. ', 'mars'), 'choices' => $post_type_array, 'default_value' => '', 'allow_null' => 0, 'multiple' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'page', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'side', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 10));
     }
 }
 public function include_fields()
 {
     if (get_current_blog_id() == 1) {
         // don't need to do this on the network main site, bail
         return;
     }
     switch_to_blog(1);
     $theme = get_option('stylesheet');
     restore_current_blog();
     $path = get_theme_root() . '/' . $theme . '/acf-json';
     //echo $path; die;
     if (!is_dir($path)) {
         // the acf-json folder does not exist, bail
         return;
     }
     $files = scandir($path);
     //print_r($files); die;
     if ($files === false) {
         // error reading files, bail
         return;
     }
     if (!count($files)) {
         // no filee found, bail
         return;
     }
     $this->get_acf_field_groups();
     foreach ($files as $file) {
         $file_path = $path . '/' . $file;
         if (is_dir($file_path) || !preg_match('/\\.json$/', $file)) {
             continue;
         }
         $group_key = preg_replace('/\\.json$/', '', $file);
         if (isset($this->acf_field_groups[$group_key])) {
             continue;
         }
         if (($json = file_get_contents($file_path)) !== false) {
             $field_group = json_decode($json, true);
             if ($field_group) {
                 register_field_group($field_group);
             }
         }
         // end if read file
     }
     // end foreach file
 }
Ejemplo n.º 24
0
function setup_touch_easy_seo_settings_page()
{
    if (function_exists('acf_add_options_sub_page')) {
        acf_add_options_sub_page(array('title' => 'Settings', 'parent' => 'touch_easy_seo', 'slug' => "touch-easy-seo-settings", 'capability' => 'read_touch-easy-seo-settings', 'menu' => 'Touch Easy SEO Settings'));
    }
    if (function_exists("register_field_group")) {
        $roles = get_editable_roles();
        // Do not allow rights modification of administrator and current role
        if (isset($roles["administrator"])) {
            unset($roles["administrator"]);
        }
        $field_value = array();
        foreach ($roles as $role_name => $role_info) {
            $field_value[$role_name] = ucfirst($role_name);
        }
        register_field_group(array('id' => 'acf_touch-easy-seo-settings', 'title' => 'Touch Easy SEO Settings', 'fields' => array(array('key' => 'field_5409423015b00', 'label' => 'Select who is able to edit the meta tags', 'name' => 'allowed_roles_for_touch_seo', 'type' => 'checkbox', 'instructions' => 'Admins are always allowed, you can not remove their rights.', 'choices' => $field_value, 'default_value' => '', 'layout' => 'horizontal')), 'location' => array(array(array('param' => 'options_page', 'operator' => '==', 'value' => 'touch-easy-seo-settings', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
    }
}
Ejemplo n.º 25
0
/**
 * Load the Advanced Custom Fields configuration. The configuration was created via the admin panel
 * then exported via settings, export field groups to PHP. This is so that the field groups
 * can easily be edited without requiring database changes. Do not manually edit. To edit first load
 * the custom fields into the database using the WordPress importer and the file
 * in tools/installation/advanced-custom-field-export.xml, after importing do export PHP
 * and paste the code below.
 */
function ikit_load_acf()
{
    /**
     * Register field groups
     * The register_field_group function accepts 1 array which holds the relevant data to register a field group
     * You may edit the array as you see fit. However, this may result in errors if the array is not compatible with ACF
     * This code must run every time the functions.php file is read
     */
    if (function_exists("register_field_group")) {
        register_field_group(array('id' => '5107f5b222da8', 'title' => 'Ikit Event', 'fields' => array(0 => array('key' => 'field_13', 'label' => 'Additional Information', 'name' => 'additional_information', 'type' => 'wysiwyg', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => '', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'toolbar' => 'full', 'media_upload' => 'yes', 'the_content' => 'yes'), 1 => array('key' => 'field_14', 'label' => 'Registration Link', 'name' => 'registration_type', 'type' => 'select', 'order_no' => 1, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'choices' => array(0 => 'Enabled', 1 => 'Disabled'), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0), 2 => array('key' => 'field_185', 'label' => 'Display Priority', 'name' => 'display_priority', 'type' => 'text', 'order_no' => 2, 'instructions' => 'Supercede ordering by date, higher values mean the item will appear ealier. Reset to 0 to disable.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 3 => array('key' => 'field_222', 'label' => 'Image Gallery', 'name' => 'image_gallery', 'type' => 'repeater', 'order_no' => 3, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'sub_fields' => array('field_223' => array('label' => 'Image', 'name' => 'image', 'type' => 'image', 'instructions' => '', 'column_width' => '', 'save_format' => 'id', 'preview_size' => 'thumbnail', 'order_no' => 0, 'key' => 'field_223'), 'field_224' => array('label' => 'Title', 'name' => 'title', 'type' => 'text', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'formatting' => 'html', 'order_no' => 1, 'key' => 'field_224')), 'row_min' => 0, 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row'), 4 => array('key' => 'field_38', 'label' => 'Preview Description', 'name' => 'preview_description', 'type' => 'textarea', 'order_no' => 4, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'br')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_event', 'order_no' => 0)), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '5107f5b22368d', 'title' => 'Ikit Image Gallery', 'fields' => array(0 => array('key' => 'field_12', 'label' => 'Image Gallery', 'name' => 'image_gallery', 'type' => 'repeater', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'sub_fields' => array(0 => array('key' => 'field_4f84a6722a9d6', 'label' => 'Image', 'name' => 'image', 'type' => 'image', 'save_format' => 'id', 'preview_size' => 'thumbnail', 'order_no' => 0), 1 => array('key' => 'field_4f84a6722a9f4', 'label' => 'Title', 'name' => 'title', 'type' => 'text', 'default_value' => '', 'formatting' => 'html', 'order_no' => 1), 2 => array('key' => 'field_4f84a6722aa0b', 'label' => 'Link URL', 'name' => 'link_url', 'type' => 'text', 'default_value' => '', 'formatting' => 'html', 'order_no' => 2), 3 => array('key' => 'field_4f84a6722aa51', 'label' => 'Link Target', 'name' => 'link_target', 'type' => 'select', 'choices' => array('_self' => 'Standard', '_blank' => 'New Window', '' => ''), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0, 'order_no' => 3)), 'row_limit' => '', 'layout' => 'table', 'button_label' => '+ Add Row')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_image_gallery', 'order_no' => '0')), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '5107f5b223eea', 'title' => 'Ikit Link', 'fields' => array(0 => array('key' => 'field_3', 'label' => 'Image', 'name' => 'image', 'type' => 'image', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'save_format' => 'url', 'preview_size' => 'thumbnail'), 1 => array('key' => 'field_2', 'label' => 'Highlighted Image', 'name' => 'highlighted_image', 'type' => 'image', 'order_no' => 1, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'save_format' => 'url', 'preview_size' => 'thumbnail'), 2 => array('key' => 'field_1', 'label' => 'URL', 'name' => 'url', 'type' => 'text', 'order_no' => 2, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'none'), 3 => array('key' => 'field_4', 'label' => 'Display Order', 'name' => 'display_order', 'type' => 'text', 'order_no' => 3, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'none')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_link', 'order_no' => '0')), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '5107f5b226a61', 'title' => 'Ikit Sponsor', 'fields' => array(0 => array('key' => 'field_5', 'label' => 'Primary Image', 'name' => 'primary_image', 'type' => 'image', 'order_no' => 0, 'instructions' => 'If you are using the iKit Two theme, please upload an image double the width and height of your intended image dimensions. For example if you like to display the image as 50px by 100px, you should upload an image that is 100px by 200px. This ensures the image will not appear blurred on retina displays.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'save_format' => 'id', 'preview_size' => 'thumbnail'), 1 => array('key' => 'field_8', 'label' => 'Secondary Image', 'name' => 'secondary_image', 'type' => 'image', 'order_no' => 1, 'instructions' => 'If you are using the iKit Two theme, please upload an image double the width and height of your intended image dimensions. For example if you like to display the image as 50px by 100px, you should upload an image that is 100px by 200px. This ensures the image will not appear blurred on retina displays.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'save_format' => 'id', 'preview_size' => 'thumbnail'), 2 => array('key' => 'field_6', 'label' => 'URL', 'name' => 'url', 'type' => 'text', 'order_no' => 2, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'none'), 3 => array('key' => 'field_7', 'label' => 'Display Order', 'name' => 'display_order', 'type' => 'text', 'order_no' => 3, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'html')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_sponsor', 'order_no' => '0')), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '5107f5b2278b9', 'title' => 'Page', 'fields' => array(0 => array('key' => 'field_11', 'label' => 'Ikit Section', 'name' => 'ikit_section', 'type' => 'post_object', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => '', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'post_type' => array(0 => 'ikit_section'), 'taxonomy' => array(0 => 'all'), 'allow_null' => 0, 'multiple' => 0)), 'location' => array('rules' => array(0 => array('param' => 'page_type', 'operator' => '!=', 'value' => 'child', 'order_no' => 0), 1 => array('param' => 'post_type', 'operator' => '==', 'value' => 'page', 'order_no' => 1)), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '5107f5b227f3a', 'title' => 'Post', 'fields' => array(0 => array('key' => 'field_10', 'label' => 'Preview Description', 'name' => 'preview_description', 'type' => 'textarea', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'default_value' => '', 'formatting' => 'br'), 1 => array('key' => 'field_9', 'label' => 'Image Gallery', 'name' => 'image_gallery', 'type' => 'repeater', 'order_no' => 1, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'allorany' => 'all', 'rules' => 0), 'sub_fields' => array(0 => array('key' => 'field_4f7b11d3e7729', 'label' => 'Image', 'name' => 'image', 'type' => 'image', 'save_format' => 'id', 'preview_size' => 'thumbnail', 'order_no' => 0), 1 => array('key' => 'field_4f7b11d3e7737', 'label' => 'Title', 'name' => 'title', 'type' => 'text', 'default_value' => '', 'formatting' => 'html', 'order_no' => 1)), 'row_limit' => '', 'layout' => 'table', 'button_label' => '+ Add Row'), 2 => array('key' => 'field_101', 'label' => 'Attribution', 'name' => 'attribution', 'type' => 'text', 'order_no' => 2, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 3 => array('key' => 'field_180', 'label' => 'Display Priority', 'name' => 'display_priority', 'type' => 'text', 'order_no' => 3, 'instructions' => 'Supercede ordering by date, higher values mean the item will appear ealier. Reset to 0 to disable.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => '0')), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '537e6ea07e482', 'title' => 'iKit Internal Event', 'fields' => array(0 => array('key' => 'field_256', 'label' => 'Image Gallery', 'name' => 'image_gallery', 'type' => 'repeater', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'sub_fields' => array('field_257' => array('label' => 'Image', 'name' => 'image', 'type' => 'image', 'instructions' => '', 'column_width' => '', 'save_format' => 'id', 'preview_size' => 'thumbnail', 'order_no' => 0, 'key' => 'field_257'), 'field_258' => array('label' => 'Title', 'name' => 'title', 'type' => 'text', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'formatting' => 'html', 'order_no' => 1, 'key' => 'field_258')), 'row_min' => 0, 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row'), 1 => array('key' => 'field_244', 'label' => 'Preview Description', 'name' => 'preview_description', 'type' => 'textarea', 'order_no' => 1, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'br'), 2 => array('key' => 'field_246', 'label' => 'Start Date', 'name' => 'start_date', 'type' => 'date_picker', 'order_no' => 2, 'instructions' => '', 'required' => 1, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'date_format' => 'yy-mm-dd', 'display_format' => 'mm/dd/yy'), 3 => array('key' => 'field_247', 'label' => 'End Date', 'name' => 'end_date', 'type' => 'date_picker', 'order_no' => 3, 'instructions' => '', 'required' => 1, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'date_format' => 'yy-mm-dd', 'display_format' => 'mm/dd/yy'), 4 => array('key' => 'field_33', 'label' => 'Start Time', 'name' => 'start_time', 'type' => 'repeater', 'order_no' => 4, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'sub_fields' => array('field_46' => array('choices' => array('00' => 0, '01' => 1, '02' => 2, '03' => 3, '04' => 4, '05' => 5, '06' => 6, '07' => 7, '08' => 8, '09' => 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), 'label' => 'Hour', 'name' => 'hour', 'type' => 'select', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'allow_null' => 1, 'multiple' => 0, 'order_no' => 0, 'key' => 'field_46'), 'field_47' => array('choices' => array('00' => 0, '01' => 1, '02' => 2, '03' => 3, '04' => 4, '05' => 5, '06' => 6, '07' => 7, '08' => 8, '09' => 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, 31 => 31, 32 => 32, 33 => 33, 34 => 34, 35 => 35, 36 => 36, 37 => 37, 38 => 38, 39 => 39, 40 => 40, 41 => 41, 42 => 42, 43 => 43, 44 => 44, 45 => 45, 46 => 46, 47 => 47, 48 => 48, 49 => 49, 50 => 50, 51 => 51, 52 => 52, 53 => 53, 54 => 54, 55 => 55, 56 => 56, 57 => 57, 58 => 58, 59 => 59), 'label' => 'Minute', 'name' => 'minute', 'type' => 'select', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'allow_null' => 1, 'multiple' => 0, 'order_no' => 1, 'key' => 'field_47')), 'row_min' => 1, 'row_limit' => 1, 'layout' => 'table', 'button_label' => 'Add Row'), 5 => array('key' => 'field_34', 'label' => 'End Time', 'name' => 'end_time', 'type' => 'repeater', 'order_no' => 5, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'sub_fields' => array('field_48' => array('choices' => array('00' => 0, '01' => 1, '02' => 2, '03' => 3, '04' => 4, '05' => 5, '06' => 6, '07' => 7, '08' => 8, '09' => 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), 'label' => 'Hour', 'name' => 'hour', 'type' => 'select', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'allow_null' => 1, 'multiple' => 0, 'order_no' => 0, 'key' => 'field_48'), 'field_49' => array('choices' => array('00' => 0, '01' => 1, '02' => 2, '03' => 3, '04' => 4, '05' => 5, '06' => 6, '07' => 7, '08' => 8, '09' => 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, 31 => 31, 32 => 32, 33 => 33, 34 => 34, 35 => 35, 36 => 36, 37 => 37, 38 => 38, 39 => 39, 40 => 40, 41 => 41, 42 => 42, 43 => 43, 44 => 44, 45 => 45, 46 => 46, 47 => 47, 48 => 48, 49 => 49, 50 => 50, 51 => 51, 52 => 52, 53 => 53, 54 => 54, 55 => 55, 56 => 56, 57 => 57, 58 => 58, 59 => 59), 'label' => 'Minute', 'name' => 'minute', 'type' => 'select', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'allow_null' => 1, 'multiple' => 0, 'order_no' => 1, 'key' => 'field_49')), 'row_min' => 1, 'row_limit' => 1, 'layout' => 'table', 'button_label' => 'Add Row'), 6 => array('key' => 'field_266', 'label' => 'URL', 'name' => 'url', 'type' => 'text', 'order_no' => 6, 'instructions' => 'Enter the website address for the event, make sure to enter a properly formatted URL starting with http://. For example, http://myevent.com/event1.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 7 => array('key' => 'field_267', 'label' => 'URL Name', 'name' => 'url_name', 'type' => 'text', 'order_no' => 7, 'instructions' => 'Enter the name you would like to display for the website address for the event, for example, \'Register Now\', or \'More Information\'.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 8 => array('key' => 'field_254', 'label' => 'Display Priority', 'name' => 'display_priority', 'type' => 'text', 'order_no' => 8, 'instructions' => 'Supercede ordering by date, higher values mean the item will appear ealier. Reset to 0 to disable.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 9 => array('key' => 'field_255', 'label' => 'Location Name', 'name' => 'location_name', 'type' => 'text', 'order_no' => 9, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 10 => array('key' => 'field_259', 'label' => 'Location Address 1', 'name' => 'location_address_1', 'type' => 'text', 'order_no' => 10, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 11 => array('key' => 'field_260', 'label' => 'Location Address 2', 'name' => 'location_address_2', 'type' => 'text', 'order_no' => 11, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 12 => array('key' => 'field_261', 'label' => 'Location City', 'name' => 'location_city', 'type' => 'text', 'order_no' => 12, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 13 => array('key' => 'field_262', 'label' => 'Location State/Province', 'name' => 'location_state_province', 'type' => 'text', 'order_no' => 13, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 14 => array('key' => 'field_264', 'label' => 'Location Postal Code', 'name' => 'location_postal_code', 'type' => 'text', 'order_no' => 14, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 15 => array('key' => 'field_263', 'label' => 'Location Country', 'name' => 'location_country', 'type' => 'text', 'order_no' => 15, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_event_internal', 'order_no' => 0)), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
        register_field_group(array('id' => '551c220d3d9f6', 'title' => 'iKit Person', 'fields' => array(0 => array('key' => 'field_57', 'label' => 'Positions', 'name' => 'positions', 'type' => 'repeater', 'order_no' => 0, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'sub_fields' => array('field_58' => array('label' => 'Title', 'name' => 'title', 'type' => 'text', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'formatting' => 'html', 'order_no' => 0, 'key' => 'field_58')), 'row_min' => 0, 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row'), 1 => array('key' => 'field_50', 'label' => 'Display Priority', 'name' => 'display_priority', 'type' => 'text', 'order_no' => 1, 'instructions' => 'Higher values mean the item will appear earlier.', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'default_value' => '', 'formatting' => 'html'), 2 => array('key' => 'field_51', 'label' => 'Image Gallery', 'name' => 'image_gallery', 'type' => 'repeater', 'order_no' => 2, 'instructions' => '', 'required' => 0, 'conditional_logic' => array('status' => 0, 'rules' => array(0 => array('field' => 'null', 'operator' => '==', 'value' => '')), 'allorany' => 'all'), 'sub_fields' => array('field_52' => array('label' => 'Image', 'name' => 'image', 'type' => 'image', 'instructions' => '', 'column_width' => '', 'save_format' => 'id', 'preview_size' => 'thumbnail', 'order_no' => 0, 'key' => 'field_52'), 'field_53' => array('label' => 'Title', 'name' => 'title', 'type' => 'text', 'instructions' => '', 'column_width' => '', 'default_value' => '', 'formatting' => 'html', 'order_no' => 1, 'key' => 'field_53')), 'row_min' => 0, 'row_limit' => '', 'layout' => 'table', 'button_label' => 'Add Row')), 'location' => array('rules' => array(0 => array('param' => 'post_type', 'operator' => '==', 'value' => 'ikit_person', 'order_no' => 0)), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
    }
}
function register_cpt_portfolio_item()
{
    /*--------------------------------------------*
     * Labels
     *--------------------------------------------*/
    $labels = array('name' => _x('Portfolio items', 'portfolio_item'), 'singular_name' => _x('Portfolio item', 'portfolio_item'), 'add_new' => _x('Add New', 'portfolio_item'), 'add_new_item' => _x('Add New Portfolio item', 'portfolio_item'), 'edit_item' => _x('Edit Portfolio item', 'portfolio_item'), 'new_item' => _x('New Portfolio item', 'portfolio_item'), 'view_item' => _x('View Portfolio item', 'portfolio_item'), 'search_items' => _x('Search Portfolio items', 'portfolio_item'), 'not_found' => _x('No portfolio items found', 'portfolio_item'), 'not_found_in_trash' => _x('No portfolio items found in Trash', 'portfolio_item'));
    /*--------------------------------------------*
     * Supports
     *--------------------------------------------*/
    $supports = array('title', 'editor', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'page-attributes');
    /*--------------------------------------------*
     * Arguments
     *--------------------------------------------*/
    $args = array('labels' => $labels, 'supports' => $supports, 'hierarchical' => false, 'description' => 'A singular item or art work example in you portfolio post type', 'taxonomies' => array('category', 'post_tag'), 'public' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'show_ui' => true, 'menu_position' => 4, 'menu_icon' => 'dashicons-portfolio', 'has_archive' => 'portfolio-items', 'query_var' => true, 'can_export' => true, 'rewrite' => true, 'capability_type' => 'post', 'rewrite' => array('slug' => 'portfolio-item'));
    /*--------------------------------------------*
     * REGISTER CUSTOM FIELD GROUPS
     *--------------------------------------------*/
    if (function_exists("register_field_group")) {
        register_field_group(array('id' => 'acf_optimal-project-details', 'title' => 'PROJECT DETAILS :<i> are optional</i>', 'fields' => array(array('key' => 'field_532cda305049d', 'label' => 'thumb-nail-image', 'name' => 'thumb-nail-image', 'type' => 'image', 'instructions' => 'Add a full sized image for lightbox', 'required' => 1, 'save_format' => 'url', 'preview_size' => 'thumbnail', 'prepend' => '<a href=', 'maxlength' => '', 'library' => 'all'), array('key' => 'field_532bc31d1ac83', 'label' => 'Client Name:', 'name' => 'client_name', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'field_532bc3931ac84', 'label' => 'Development Roles:', 'name' => 'development_role', 'type' => 'checkbox', 'instructions' => 'Pick a role', 'required' => 1, 'choices' => array('Group Project' => 'Group Project', 'Developer' => 'Developer', 'Designer' => 'Designer', 'Project Manager' => 'Project Manager', 'Production' => 'Production', 'Lead Designer and Developer' => 'Lead Designer and Developer', '' => ''), 'default_value' => '', 'layout' => 'horizontal'), array('key' => 'field_532bd7f41ac87', 'label' => 'Url: ', 'name' => 'site_url', 'type' => 'text', 'instructions' => 'Your live project web address', 'default_value' => '', 'prepend' => '', 'placeholder' => 'www.yourproject.com', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'field_5334f29cb8a81', 'label' => 'Work Flow Examples', 'name' => 'work_flow_examples', 'type' => 'gallery', 'instructions' => 'Include work flow in order: logo design, information architecture, wire-frames, visual designs, final template.', 'preview_size' => 'thumbnail', 'library' => 'all')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'portfolio_item', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array(0 => 'custom_fields')), 'menu_order' => 0));
    }
    // close fields
    register_post_type('portfolio_item', $args);
}
Ejemplo n.º 27
0
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* **********************************************************************
*/
function cap_short_urls_register()
{
    $labels = array('name' => _x('Short URLs', 'post type general name'), 'singular_name' => _x('Short URL', 'post type singular name'), 'add_new' => __('Add New'), 'add_new_item' => __('Short URL'), 'edit_item' => __('Edit Short URL'), 'new_item' => __('New Short URL'), 'view_item' => __('View Short URL'), 'search_items' => __('Search Short URL'), 'not_found' => __('No Short URL Found'), 'not_found_in_trash' => __('No Short URL in Trash'), 'parent_item_colon' => __('Short URL'), 'menu_name' => __('Short URL'));
    $taxonomies = array();
    $supports = array('title', 'revisions');
    $post_type_args = array('labels' => $labels, 'singular_label' => __('Short URL'), 'public' => true, 'exclude_from_search' => true, 'show_ui' => true, 'publicly_queryable' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'rewrite' => array('slug' => 's', 'with_front' => false), 'supports' => $supports, 'menu_position' => 15, 'taxonomies' => $taxonomies);
    register_post_type('cap_short_urls', $post_type_args);
}
add_action('init', 'cap_short_urls_register');
if (function_exists("register_field_group")) {
    register_field_group(array('id' => 'acf_short-url-options', 'title' => 'Short URL Options', 'fields' => array(array('key' => 'field_53ecd7d73bc7f', 'label' => 'URL to redirect to', 'name' => 'url_redirect_target', 'type' => 'text', 'default_value' => '', 'placeholder' => 'http://thinkprogress.org/post-name', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'field_53ecd7d73bc00', 'label' => 'LEGACY URL to redirect to', 'name' => 'legacy_url_redirect_target', 'type' => 'text', 'default_value' => '', 'placeholder' => 'http://thinkprogress.org/post-name', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => ''), array('key' => 'field_53ecf5f30bfbb', 'label' => 'Post to redirect to', 'name' => 'post_redirect_target', 'type' => 'number', 'instructions' => 'Enter a posts ID number here', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'cap_short_urls', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
}
/**
* Register the post type template
* @todo figure out why this breaks things.
*/
function cap_short_url_template_register($single_template)
{
    global $post;
    /**
     * Checks for single template by post type
     * @todo this is interferring with the normal template loading and causes the post to return to a loop view with just that one post. Could literally be anywhere.
     */
    if ($post->post_type == "cap_short_urls" && is_user_logged_in()) {
        if (file_exists(plugin_dir_path(__FILE__) . '/single-cap_short_urls.php')) {
            return plugin_dir_path(__FILE__) . '/single-cap_short_urls.php';
Ejemplo n.º 28
0
<?php

//Hide ACF Admin Menu Item
define('ACF_LITE', true);
//ACF Fields
if (function_exists("register_field_group")) {
    register_field_group(array('id' => 'acf_nimbly-custom-archive-options', 'title' => 'Nimbly Custom Archive Options', 'fields' => array(array('key' => 'field_55e4b10e40a74', 'label' => 'Archive Categories', 'name' => 'archive_categories', 'type' => 'taxonomy', 'instructions' => 'Select categories of posts to display. If no categories are selected, the archive will display all posts.', 'taxonomy' => 'category', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0)), 'location' => array(array(array('param' => 'page_template', 'operator' => '==', 'value' => 'template-custom_archive.php', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'the_content', 1 => 'excerpt', 2 => 'discussion', 3 => 'comments', 4 => 'revisions', 5 => 'featured_image', 6 => 'categories')), 'menu_order' => 0));
    register_field_group(array('id' => 'acf_nimbly-content-options-2', 'title' => 'Nimbly Content Options', 'fields' => array(array('key' => 'field_55fdfcca487e7', 'label' => 'Show Featured Articles Section', 'name' => 'show_featured_articles_section', 'type' => 'true_false', 'message' => '', 'default_value' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0)), array(array('param' => 'post_type', 'operator' => '==', 'value' => 'page', 'order_no' => 0, 'group_no' => 1)), array(array('param' => 'page_type', 'operator' => '==', 'value' => 'posts_page', 'order_no' => 0, 'group_no' => 2)), array(array('param' => 'page_template', 'operator' => '==', 'value' => 'template-custom_archive.php', 'order_no' => 0, 'group_no' => 3))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 4));
    register_field_group(array('id' => 'acf_nimbly-front-page-options', 'title' => 'Nimbly Front Page Options', 'fields' => array(array('key' => 'field_55e1f1fb40705', 'label' => 'Hero Content', 'name' => 'hero_content', 'type' => 'post_object', 'instructions' => 'Select the content that will appear most prominently on the homepage.', 'required' => 1, 'post_type' => array(0 => 'all'), 'taxonomy' => array(0 => 'all'), 'allow_null' => 0, 'multiple' => 0), array('key' => 'field_55e1f31d40706', 'label' => 'Small Hero Content', 'name' => 'small_hero_content', 'type' => 'relationship', 'instructions' => 'Select three pieces of content that will appear bellow the homepage hero.', 'return_format' => 'object', 'post_type' => array(0 => 'all'), 'taxonomy' => array(0 => 'all'), 'filters' => array(0 => 'search'), 'result_elements' => array(0 => 'post_type', 1 => 'post_title'), 'max' => 3), array('key' => 'field_55fdf9b42da93', 'label' => 'Post List Categories', 'name' => 'post_list_categories', 'type' => 'taxonomy', 'taxonomy' => 'category', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0)), 'location' => array(array(array('param' => 'page_type', 'operator' => '==', 'value' => 'front_page', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'the_content', 1 => 'excerpt', 2 => 'custom_fields', 3 => 'discussion', 4 => 'comments', 5 => 'featured_image', 6 => 'categories', 7 => 'tags')), 'menu_order' => 0));
    register_field_group(array('id' => 'acf_nimbly-hero-options', 'title' => 'Nimbly Hero Options', 'fields' => array(array('key' => 'field_55e1f47491089', 'label' => 'Hero Media', 'name' => 'hero_media_type', 'type' => 'select', 'choices' => array('none' => 'None', 'image' => 'Image', 'video_loop' => 'Video Loop'), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0), array('key' => 'field_55e1f4a29108a', 'label' => 'Hero Image', 'name' => 'hero_image', 'type' => 'image', 'instructions' => 'Recommended Image Size: 2120px by 1400px', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e1f47491089', 'operator' => '==', 'value' => 'image')), 'allorany' => 'all'), 'save_format' => 'object', 'preview_size' => 'thumbnail', 'library' => 'all'), array('key' => 'field_55e1f4e29108b', 'label' => 'Hero MP4 Video', 'name' => 'hero_mp4_video', 'type' => 'file', 'instructions' => 'Upload each video codec so that videos play on a range of devices.', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e1f47491089', 'operator' => '==', 'value' => 'video_loop')), 'allorany' => 'all'), 'save_format' => 'object', 'library' => 'all'), array('key' => 'field_55e1f58f9108e', 'label' => 'Hero OGG Video', 'name' => 'hero_ogg_video', 'type' => 'file', 'instructions' => 'Upload each video codec so that videos play on a range of devices.', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e1f47491089', 'operator' => '==', 'value' => 'video_loop')), 'allorany' => 'all'), 'save_format' => 'object', 'library' => 'all'), array('key' => 'field_55e1f5799108d', 'label' => 'Hero WebM Video', 'name' => 'hero_webm_video', 'type' => 'file', 'instructions' => 'Upload each video codec so that videos play on a range of devices.', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e1f47491089', 'operator' => '==', 'value' => 'video_loop')), 'allorany' => 'all'), 'save_format' => 'object', 'library' => 'all'), array('key' => 'field_55e1f5b99108f', 'label' => 'Hero Image Fallback', 'name' => 'hero_image_fallback', 'type' => 'image', 'instructions' => 'Upload an image to display on devices that don\'t support video.', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e1f47491089', 'operator' => '==', 'value' => 'video_loop')), 'allorany' => 'all'), 'save_format' => 'object', 'preview_size' => 'large', 'library' => 'all')), 'location' => array(array(array('param' => 'page_type', 'operator' => '!=', 'value' => 'front_page', 'order_no' => 0, 'group_no' => 0), array('param' => 'page_type', 'operator' => '!=', 'value' => 'posts_page', 'order_no' => 1, 'group_no' => 0), array('param' => 'page_template', 'operator' => '!=', 'value' => 'template-custom_archive.php', 'order_no' => 2, 'group_no' => 0), array('param' => 'ef_media', 'operator' => '!=', 'value' => 'all', 'order_no' => 3, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array()), 'menu_order' => 0));
    register_field_group(array('id' => 'acf_nimbly-side-info-section', 'title' => 'Nimbly Side Info Section', 'fields' => array(array('key' => 'field_55e46b12bacb8', 'label' => 'Info Section Title', 'name' => 'info_section_title', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'field_55e46bc8bacb9', 'label' => 'Info Section Added Media', 'name' => 'info_section_media_type', 'type' => 'select', 'choices' => array('none' => 'None', 'image' => 'Image', 'map' => 'Map', 'video_embed' => 'Video Embed'), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0), array('key' => 'field_55e46c86bacba', 'label' => 'Image', 'name' => 'info_section_image', 'type' => 'image', 'instructions' => 'Recommended Image Size: 1060px by 700px', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e46bc8bacb9', 'operator' => '==', 'value' => 'image')), 'allorany' => 'all'), 'save_format' => 'object', 'preview_size' => 'medium', 'library' => 'all'), array('key' => 'field_55e46d03bacbb', 'label' => 'Map Location', 'name' => 'info_section_map_location', 'type' => 'google_map', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e46bc8bacb9', 'operator' => '==', 'value' => 'map')), 'allorany' => 'all'), 'center_lat' => '', 'center_lng' => '', 'zoom' => '', 'height' => ''), array('key' => 'field_55e46fbebacbc', 'label' => 'Video Embed Code', 'name' => 'info_section_video_embed_code', 'type' => 'textarea', 'required' => 1, 'conditional_logic' => array('status' => 1, 'rules' => array(array('field' => 'field_55e46bc8bacb9', 'operator' => '==', 'value' => 'video_embed')), 'allorany' => 'all'), 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '', 'formatting' => 'none'), array('key' => 'field_55e47038bacbd', 'label' => 'Info Section Text', 'name' => 'info_section_text', 'type' => 'textarea', 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '', 'formatting' => 'html'), array('key' => 'field_55e4c23ed8c0c', 'label' => 'Info Section Links', 'name' => 'info_section_links', 'type' => 'repeater', 'sub_fields' => array(array('key' => 'field_55e4c255d8c0d', 'label' => 'Link Name', 'name' => 'link_name', 'type' => 'text', 'column_width' => '', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => ''), array('key' => 'field_55e4c25fd8c0e', 'label' => 'Link URL', 'name' => 'link_url', 'type' => 'text', 'column_width' => '', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '')), 'row_min' => '', 'row_limit' => '', 'layout' => 'row', 'button_label' => '+ Add Link')), 'location' => array(array(array('param' => 'page_type', 'operator' => '!=', 'value' => 'front_page', 'order_no' => 0, 'group_no' => 0), array('param' => 'page_type', 'operator' => '!=', 'value' => 'posts_page', 'order_no' => 1, 'group_no' => 0), array('param' => 'page_template', 'operator' => '!=', 'value' => 'template-custom_archive.php', 'order_no' => 2, 'group_no' => 0))), 'options' => array('position' => 'side', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'featured_image')), 'menu_order' => 0));
}
Ejemplo n.º 29
0
function add_review_custom_fields()
{
    if (post_type_exists('review')) {
        //Add custom fields
        if (function_exists("register_field_group")) {
            register_field_group(array('id' => 'acf_leafly-reviews-fields', 'title' => 'Leafly Reviews Fields', 'fields' => array(array('key' => 'field_66140db8b48dd', 'label' => 'User Name', 'name' => 'user_name', 'type' => 'text', 'instructions' => 'Name of the person who made this review.', 'default_value' => '', 'placeholder' => 'Ex: Susan Jones', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'review', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array(0 => 'custom_fields', 1 => 'discussion', 2 => 'comments', 3 => 'revisions', 4 => 'slug', 5 => 'format', 6 => 'send-trackbacks')), 'menu_order' => 0));
        }
    } else {
        return;
    }
}
Ejemplo n.º 30
0
<?php

if (function_exists("register_field_group")) {
    register_field_group(array('id' => 'acf_slider-options', 'title' => 'Slider options', 'fields' => array(array('key' => 'field_533c175bc30c9', 'label' => 'Slider category', 'name' => 'slider_category', 'type' => 'taxonomy', 'instructions' => 'If not selected will show the last posts', 'taxonomy' => 'category', 'field_type' => 'select', 'allow_null' => 1, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0), array('key' => 'field_533c17a9c30ca', 'label' => 'Post count', 'name' => 'post_count', 'type' => 'number', 'instructions' => 'How many posts to show?', 'required' => 1, 'default_value' => 4, 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => 1, 'max' => 10, 'step' => 1)), 'location' => array(array(array('param' => 'page_template', 'operator' => '==', 'value' => 'template-slider.php', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'acf_after_title', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
}