Skip to:
Content

BuddyPress.org


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

BP Types: add functions to generate the Group types WP Admin screens

  • Adds labels and arguments to the Group Type taxonomy.
  • Adds the Group type's Administration screens.
  • Introduces the bp_groups_register_group_type_taxonomy() function to register the Group type's taxonomy and stop doing it from the BP_Groups_Component::register_taxonomies() method.
  • Introduces the bp_get_group_type_metadata_schema() to add custom metadata for the Group type's taxonomy.
  • Introduces the bp_get_group_types_registered_by_code() to only get Group types registered by code.
  • Stops using the hardcoded bp_group_type identifier in favor of the filterable bp_get_group_type_tax_name() function.
  • Updates the test_groups_get_type_should_not_return_unregistered_types() unit test to test_groups_registered_by_code_group_type_should_not_return_unregistered_types() to check the previous point new function.

Props mercime, DJPaul, dcavins, boonebgorges

Fixes #7179

File:
1 edited

Legend:

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

    r11739 r12731  
    247247    }
    248248
    249     public function test_groups_get_type_should_not_return_unregistered_types() {
     249    public function test_groups_registered_by_code_group_type_should_not_return_unregistered_types() {
    250250        $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) );
    251251        bp_groups_register_group_type( 'foo' );
     
    255255        bp_set_object_terms( $g, 'ugh', 'bp_group_type', true );
    256256
    257         $type = bp_groups_get_group_type( $g, false );
     257        $type = bp_groups_get_group_type( $g, false, false );
    258258        $this->assertEquals( array( 'foo' ), $type );
    259259    }
Note: See TracChangeset for help on using the changeset viewer.