Forum Replies Created
-
I’ve used this action
add_action('bp_before_group_header_meta', 'show_info_in_header');
and it worked perfectly.Thank you so much for your help! Really appreciate it!
@venutius
Hi! Could you please guide me or provide me any reference?@venutius
This is the code which I’m using to add two fields in group creation form.function custom_field($meta_key='') { //get current group id and load meta_key value if passed. If not pass it blank return groups_get_groupmeta( bp_get_group_id(), $meta_key) ; } function group_header_fields_save( $group_id ) { global $bp, $wpdb; $plain_fields = array( 'group-month', 'group-year' ); foreach( $plain_fields as $field ) { $key = $field; if ( isset( $_POST[$key] ) ) { $value = $_POST[$key]; groups_update_groupmeta( $group_id, $field, $value ); } } } add_action( 'groups_group_details_edited', 'group_header_fields_save' ); add_action( 'groups_created_group', 'group_header_fields_save' ); // Show the custom field in the group header function show_field_in_header( ) { echo "<p> Month: " . custom_field('group-month') . "</p>"; echo "<p> Year: " . custom_field('group-year') . "</p>"; } add_action('bp_group_header_meta' , 'show_field_in_header') ;
I’ve manually added the code to display the fields in create.php file. In frontend, the field is visible on group listing (groups-loop.php) and on single group page.
Now, I want to add a meta box to the group edit to update the field information directly from the admin panel.
I’ll be grateful If you can help me out! Looking forward to your reply.
Thanks!
@venutius
Hi, Thank you so much for reply!
I tried it but it’s not working. I just need them to display on the group admin to edit/remove the fields data.Hi @venutius,
Thanks for the reply. Could you please elaborate a bit? Are you talking about this function and how we access it using a filter/action?function bp_nouveau_set_nav_item_order( $nav = null, $order = array(), $parent_slug = '' ) { if ( ! is_object( $nav ) || empty( $order ) || ! is_array( $order ) ) { return false; } $position = 0; foreach ( $order as $slug ) { $position += 10; $key = $slug; if ( ! empty( $parent_slug ) ) { $key = $parent_slug . '/' . $key; } $item_nav = $nav->get( $key ); if ( ! $item_nav ) { continue; } if ( (int) $item_nav->position !== (int) $position ) { $nav->edit_nav( array( 'position' => $position ), $slug, $parent_slug ); } } return true; }
Hi Varun,
Thanks for the reply. The navigation API does not solve my problem. I don’t want to change the inner pages navigation menu. I want to rearrange the menu items in the header under the user profile picture.Rearranging the below menu:
- Dashboard
- Profile
- Notifications
- Messages
- Friends
- Groups
- Settings
- Logout
to the this menu:
- Dashboard
- Groups
- Notifications
- Messages
- Friends
- Profile
- Settings
- Logout
Hello,
can anyone help to make group avatar uploading mandatory?No, I haven’t used the hook. I explored the templates and found out that it’s using another plugin for file handling. The js file are as follows:
1. plupload.min.js
2. moxie.min.jsI even tried making the input field required using jquery but the id in the input field is coming dynamically. I cannot target the input field directly.
function group_header_fields_save( $group_id ) {