Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/21/2020 01:21:21 AM (6 years ago)
Author:
imath
Message:

BP Types: merge BP Types saved in DB with the ones registered by code

  • Introduces the bp_get_taxonomy_types() to merge types saved into the database with the types registered by code. It's now possible to edit all properties of the registered by code types except for the type's slug which needs to be unique.
  • Caches these merged types.
  • Introduces the bp_get_member_types_registered_by_code() to only get member types registered by code.
  • Updates the test_bp_get_member_type_should_not_return_unregistered_types() unit test to test_bp_get_registered_by_code_member_type_should_not_return_unregistered_types() to check the previous point new function.
  • Introduces the bp_update_type_metadata() function to update a type's metadata.

Props mercime, DJPaul, dcavins, boonebgorges, tw2113, sbrajesh

See #7179
See #7181

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/types.php

    r11737 r12729  
    394394    }
    395395
    396     public function test_bp_get_member_type_should_not_return_unregistered_types() {
     396    public function test_bp_get_registered_by_code_member_type_should_not_return_unregistered_types() {
    397397        $u1 = self::factory()->user->create();
    398398        bp_register_member_type( 'foo' );
     
    402402        bp_set_object_terms( $u1, 'ugh', bp_get_member_type_tax_name(), true );
    403403
    404         $type = bp_get_member_type( $u1, false );
     404        $type = bp_get_member_type( $u1, false, false );
    405405        $this->assertEquals( array( 'foo' ), $type );
    406406    }
Note: See TracChangeset for help on using the changeset viewer.