diff --git src/bp-xprofile/bp-xprofile-loader.php src/bp-xprofile/bp-xprofile-loader.php
index 71d84e3..f8b5c91 100644
|
|
class BP_XProfile_Component extends BP_Component { |
102 | 102 | // Set the support field type ids |
103 | 103 | $this->field_types = apply_filters( 'xprofile_field_types', array_keys( bp_xprofile_get_field_types() ) ); |
104 | 104 | |
| 105 | // 'option' is a special case. It is not a top-level field, so |
| 106 | // does not have an associated BP_XProfile_Field_Type class, |
| 107 | // but it must be whitelisted |
| 108 | $this->field_types[] = 'option'; |
| 109 | |
105 | 110 | // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter |
106 | 111 | $this->visibility_levels = array( |
107 | 112 | 'public' => array( |
diff --git tests/phpunit/testcases/xprofile/functions.php tests/phpunit/testcases/xprofile/functions.php
index 84391be..5b58308 100644
|
|
Bar!'; |
568 | 568 | |
569 | 569 | $this->assertEquals( 0, xprofile_get_field_data( 'Pens', $u ) ); |
570 | 570 | } |
| 571 | |
| 572 | /** |
| 573 | * @group xprofile_insert_field |
| 574 | */ |
| 575 | public function test_xprofile_insert_field_type_option() { |
| 576 | $g = $this->factory->xprofile_group->create(); |
| 577 | $parent = $this->factory->xprofile_field->create( array( |
| 578 | 'field_group_id' => $g, |
| 579 | 'type' => 'selectbox', |
| 580 | 'name' => 'Parent', |
| 581 | ) ); |
| 582 | |
| 583 | $f = xprofile_insert_field( array( |
| 584 | 'field_group_id' => $g, |
| 585 | 'parent_id' => $parent, |
| 586 | 'type' => 'option', |
| 587 | 'name' => 'Option 1', |
| 588 | 'field_order' => 5, |
| 589 | ) ); |
| 590 | |
| 591 | $this->assertNotEmpty( $f ); |
| 592 | } |
571 | 593 | } |