Search Results for 'group_id'
-
Search Results
-
Topic: Display the group id PHP ?
Hello,
This is my problem, I use ACF PRO to create my own fields on my WordPress theme, for the member profiles part everything works with this code:
<?php /** * BuddyPress - Members Settings ( General ) * * @since 3.0.0 * @version 3.1.0 */ acf_form_head (); $author_id = bp_displayed_user_id(); ?><div class="col-lg-6"> <?php acf_form(array( 'id' => 'acf-formA', /* Groupe de champs ID utilisé */ 'field_groups' => array('663'), //CHANGE ID IN LIVE /* Quelle est la function meta utiliser en $ sur ID auteur ? */ 'post_id' => 'user_'.$author_id, /* Quel est le nom sur le bouton du button de sauvegarde */ 'submit_value' => __("SAUVEGARDER", 'acf'), /* Le message que je retourne en cas de réussite sur l'infobox bootstrap */ 'updated_message' => __("Mise à jour réalisée", 'acf'), /* Button de submit de formulaire */ 'html_submit_button' => '<div class="text-center"><input name="updateuser1" type="submit" id="updateuser1" class="btn-style1" value="%s" /></div>', /* Le spinner de chargement */ 'html_submit_spinner' => '<span class="acf-spinner"></span>', 'form' => true, 'return' => '' )); add_action('acf/save_post', 'my_acf_save_post', 20); ?> </div>So far no problem to display then on the member’s profile page the information of the ACF field.
My Problem:
On the other hand, on the Groups part I can’t find how to attach the field to the ID group, that’s what I tried.In my edit-details.php (in group),My field works, I enter test in my acf form
it comes out in the echo “test” but on all the groups, I can’t associate this field with the group id.<?php /** * BP Nouveau Group's edit details template. * * @since 3.0.0 * @version 3.1.0 * @version 4.0.0 Removed 'Notify group members' checkbox in favor of hooked callback. */ acf_form_head (); $group_id = bp_displayed_user_id(); $group = new BP_Groups_Group( $group_id ); ?><?php echo get_field('test_group', 'group_'. $group_id); ?><?php acf_form(array( 'id' => 'acf-formA', /* Groupe de champs ID utilisé */ 'field_groups' => array('714'), //CHANGE ID IN LIVE /* Quelle est la function meta utiliser en $ sur ID auteur ? */ 'post_id' => 'group_'.$group_id, /* Quel est le nom sur le bouton du button de sauvegarde */ 'submit_value' => __("SAUVEGARDER", 'acf'), /* Le message que je retourne en cas de réussite sur l'infobox bootstrap */ 'updated_message' => __("Mise à jour réalisée", 'acf'), /* Button de submit de formulaire */ 'html_submit_button' => '<div class="text-center"><input name="updateuser1" type="submit" id="updateuser1" class="btn-style1" value="%s" /></div>', /* Le spinner de chargement */ 'html_submit_spinner' => '<span class="acf-spinner"></span>', 'form' => true, 'return' => '' )); add_action('acf/save_post', 'my_acf_save_post', 20); ?>Thanks for your help !
demo : https://cryodev.fr/branch/build/alpha/groupes/le-groupe-a-demo/Topic: Get all groups in admin side
Hi There!
I don’t know why it’s very complicated to get groups, Anyway I need to make a dropdownlist so I need GroupID => Group Name pair.
I tried to get all groups in Admin pages but it failed because of those errors
[Undefined property: BP_Groups_Component::$table_name]
[Undefined property: BP_Groups_Component::$table_name_groupmeta]— Code 1
return BP_Groups_Group::get( array( 'type' => null, 'orderby' => 'date_created', 'order' => 'DESC', 'per_page' => null, 'page' => null, 'user_id' => 0, 'slug' => array(), 'search_terms' => false, 'search_columns' => array(), 'group_type' => '', 'group_type__in' => '', 'group_type__not_in' => '', 'meta_query' => false, 'include' => false, 'parent_id' => null, 'update_meta_cache' => true, 'update_admin_cache' => false, 'exclude' => false, 'show_hidden' => false, 'status' => array(), 'fields' => 'all', ) );— Another one
if( bp_has_groups() ) { while( bp_groups() ): bp_the_group(); return array( 'id' => bp_get_group_id(), 'title' => bp_get_group_name(), 'type' => bp_get_group_type(), 'members' => bp_get_group_member_count() ); endwhile; }Hello all,
I have four groups that all users join upon registration, which they cannot leave. But this means that from the member count of these groups, everyone can see the total number of members of the community. This is not good.
How can I remove the member count of these groups from everywhere it appears?– In the Groups directory, and in profiles in the Groups tab, the line ‘Public Group / 100 members’.
– In each group’s page in the Members tab.
– In each group’s page when clicking the Members tab, the line ‘Viewing 1 – 100 of 100 members’.This is the code (by Boone Gorges) I used to hide the Leave button of these groups. I’m posting it in case it helps.
function bbg_remove_leave_group_button( $button ) { $cant_leave_these_groups = array( 1, 2, 3, 4 ); if ( 'leave_group' == $button['id'] ) { // Hack to get the group id in any context $group_id = (int) array_pop( explode( '-', $button['wrapper_id'] ) ); if ( in_array( $group_id, $cant_leave_these_groups ) ) { return false; } } return $button; } add_filter( 'bp_get_group_join_button', 'bbg_remove_leave_group_button' );Could a similar code be used to remove the member count of the same groups?
Thanks,
DaveTopic: list of all groups
I would like to force the action to the user ,
I am trying to get the list of all groups but is not working groups_get_groups ($args) and BP_Groups_Group:: get ($args); they come back with 0 groups how do I get all the groups on my db so that I can add them to the group if exist with groups_accept_invite ($user_id, $group_id);