/**
 * Register all custom fields after the plugin is safely loaded.
 */
function wpas_user_custom_fields()
{
    /* You can start adding your custom fields safely after this line */
    wpas_add_custom_field('custom_complain_department', array('title' => __('Department', 'wpas'), 'callback' => 'taxonomy', 'placeholder' => 'Select Department', 'required' => true, 'show_column' => false, 'sortable_column' => true, 'filterable' => true, 'taxo_std' => false, 'label' => 'Department', 'label_plural' => 'Departments'));
    wpas_add_custom_field('wing', array('title' => __('Wing', 'wpas'), 'callback' => 'text', 'placeholder' => 'Wing', 'required' => true, 'show_column' => true, 'sortable_column' => true, 'filterable' => true, 'taxo_std' => false, 'label' => 'Wing', 'label_plural' => 'Wing'));
    wpas_add_custom_field('room_no', array('title' => __('Room No', 'wpas'), 'callback' => 'text', 'placeholder' => 'Room No', 'required' => true, 'show_column' => true, 'sortable_column' => true, 'filterable' => true, 'taxo_std' => false, 'label' => 'Room No', 'label_plural' => 'Room No'));
    /* Do NOT write anything after this line */
}
 function setUp()
 {
     parent::setUp();
     /**
      * Add a text field.
      */
     wpas_add_custom_field('my_test_field', array('field_type' => 'text', 'capability' => 'create_ticket', 'sanitize' => 'sanitize_text_field', 'title' => 'Test Field', 'html5_pattern' => ''));
     /**
      * Add a test ticket.
      */
     $this->ticket_id = wpas_insert_ticket(array('post_title' => 'Test Ticket', 'post_name' => 'Test Ticket', 'post_author' => 1, 'post_content' => 'In hac habitasse platea dictumst. Nulla neque dolor, sagittis eget, iaculis quis, molestie non, velit. Nullam cursus lacinia erat. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Donec vitae orci sed dolor rutrum auctor.'), false);
     /**
      * Get all the custom fields.
      */
     $this->fields = WPAS()->custom_fields->get_custom_fields();
     /**
      * Instantiate the custom fields objects.
      */
     $this->text_field = new WPAS_Custom_Field('my_test_field', $this->fields['my_test_field']);
 }
/**
 * Register all custom fields after the plugin is safely loaded.
 */
function awp_as_custom_fields()
{
    wpas_add_custom_field('product_name', array('title' => __('Name of Your Plugin/Theme'), 'callback' => 'text', 'label' => __('Name of Your Plugin/Theme')));
    wpas_add_custom_field('product_url', array('title' => __('Product URL'), 'callback' => 'text', 'label' => __('Product URL'), 'placeholder' => 'https://github.com/username/product-name'));
}
function awp_as_custom_fields2()
{
    wpas_add_custom_field('awp_product_url', array('title' => __('Product URL'), 'callback' => 'text', 'label' => __('Product URL'), 'placeholder' => 'https://github.com/username/product-name'));
    /* Do NOT write anything after this line */
}
/**
 * Register the cure custom fields.
 *
 * @since  3.0.0
 * @return void
 */
function wpas_register_core_fields()
{
    wpas_add_custom_field('assignee', array('core' => true, 'show_column' => false, 'log' => true, 'title' => __('Support Staff', 'awesome-support')));
    wpas_add_custom_field('status', array('core' => true, 'show_column' => true, 'log' => false, 'field_type' => false, 'column_callback' => 'wpas_cf_display_status', 'save_callback' => null));
    wpas_add_custom_field('ticket-tag', array('core' => true, 'show_column' => true, 'log' => true, 'field_type' => 'taxonomy', 'taxo_std' => true, 'column_callback' => 'wpas_cf_display_status', 'save_callback' => null, 'label' => __('Tag', 'awesome-support'), 'name' => __('Tag', 'awesome-support'), 'label_plural' => __('Tags', 'awesome-support'), 'taxo_hierarchical' => false, 'update_count_callback' => 'wpas_update_ticket_tag_terms_count', 'select2' => false));
    $options = maybe_unserialize(get_option('wpas_options', array()));
    if (isset($options['support_products']) && true === boolval($options['support_products'])) {
        $slug = defined('WPAS_PRODUCT_SLUG') ? WPAS_PRODUCT_SLUG : 'product';
        /* Filter the taxonomy labels */
        $labels = apply_filters('wpas_product_taxonomy_labels', array('label' => __('Product', 'awesome-support'), 'name' => __('Product', 'awesome-support'), 'label_plural' => __('Products', 'awesome-support')));
        wpas_add_custom_field('product', array('core' => false, 'show_column' => true, 'log' => true, 'field_type' => 'taxonomy', 'taxo_std' => false, 'column_callback' => 'wpas_show_taxonomy_column', 'label' => $labels['label'], 'name' => $labels['name'], 'label_plural' => $labels['label_plural'], 'taxo_hierarchical' => true, 'update_count_callback' => 'wpas_update_ticket_tag_terms_count', 'rewrite' => array('slug' => $slug), 'select2' => false));
    }
    if (isset($options['departments']) && true === boolval($options['departments'])) {
        $slug = defined('WPAS_DEPARTMENT_SLUG') ? WPAS_DEPARTMENT_SLUG : 'department';
        /* Filter the taxonomy labels */
        $labels = apply_filters('wpas_product_taxonomy_labels', array('label' => __('Department', 'awesome-support'), 'name' => __('Department', 'awesome-support'), 'label_plural' => __('Departments', 'awesome-support')));
        wpas_add_custom_field('department', array('core' => false, 'show_column' => true, 'log' => true, 'field_type' => 'taxonomy', 'taxo_std' => false, 'column_callback' => 'wpas_show_taxonomy_column', 'label' => $labels['label'], 'name' => $labels['name'], 'label_plural' => $labels['label_plural'], 'taxo_hierarchical' => true, 'update_count_callback' => 'wpas_update_ticket_tag_terms_count', 'rewrite' => array('slug' => $slug), 'select2' => false));
    }
}