bp_core_install_group_message_email()
Add default invites emails.
Description
Source
File: bp-core/admin/bp-core-admin-schema.php
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 | function bp_core_install_group_message_email() { $defaults = array ( 'post_status' => 'publish' , 'post_type' => bp_get_email_post_type(), ); $emails = bp_email_get_schema(); $descriptions = bp_email_get_type_schema( 'description' ); // Add these emails to the database. foreach ( $emails as $id => $email ) { if ( strpos ( $id , 'group-message-' , 0 ) === false ) { continue ; } // Some emails are multisite-only. if ( ! is_multisite() && isset( $email [ 'args' ] ) && ! empty ( $email [ 'args' ][ 'multisite' ] ) ) { continue ; } $post_id = wp_insert_post( bp_parse_args( $email , $defaults , 'install_email_' . $id ) ); if ( ! $post_id ) { continue ; } $tt_ids = wp_set_object_terms( $post_id , $id , bp_get_email_tax_type() ); foreach ( $tt_ids as $tt_id ) { $term = get_term_by( 'term_taxonomy_id' , (int) $tt_id , bp_get_email_tax_type() ); wp_update_term( (int) $term ->term_id, bp_get_email_tax_type(), array ( 'description' => $descriptions [ $id ], ) ); } } /** * Fires after BuddyPress adds the posts for its bbp emails. * * @since BuddyBoss 1.0.0 */ do_action( 'bp_core_install_group_message_email' ); } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.2.9 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.