What I need to achieve is have a Buddypress group admin with access to the dashboard and have only accessibility to manage the WC Orders and also User profiles of members of his/her group. The site has over 80 groups, each group has many members and basically one group admin should be assigned with this “special” role that has access to the dashboard and when accessing “Users” he will only see and be able to edit members of his group, as well as the woocommerce “orders” page, only edit and view orders of his group members.
How can this be achieved?
If at all?
I am trying to add a “group/s name” or “group/s ID” column to the Woocommerce orders list page in Admin panel.
It should show for each order line in the list the bp group that the user is registered to.
On this website except for admins, all the members are each registered to one bp group only.
Using the following code I can add a sortable column but I a breaking my fingers trying to get the BP group ID or name to show as the values.
add_filter( 'manage_edit-shop_order_columns', 'MY_COLUMNS_FUNCTION' );
function MY_COLUMNS_FUNCTION($columns){
$new_columns = (is_array($columns)) ? $columns : array();
unset( $new_columns['order_actions'] );
//edit this for you column(s)
//all of your columns will be added before the actions column
$new_columns['MY_COLUMN_ID_1'] = '????';
//stop editing
$new_columns['order_actions'] = $columns['order_actions'];
return $new_columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'MY_COLUMNS_VALUES_FUNCTION', 2 );
function MY_COLUMNS_VALUES_FUNCTION($column){
global $post;
$data = get_post_meta( $post->ID );
//start editing, I was saving my fields for the orders as custom post meta
//if you did the same, follow this code
if ( $column == 'MY_COLUMN_ID_1' ) {
echo (isset($data['MY_COLUMN_1_POST_META_ID']) ? $data['MY_COLUMN_1_POST_META_ID'] : '');
}
//stop editing
}
add_filter( "manage_edit-shop_order_sortable_columns", 'MY_COLUMNS_SORT_FUNCTION' );
function MY_COLUMNS_SORT_FUNCTION( $columns ) {
$custom = array(
//start editing
'MY_COLUMN_ID_1' => 'MY_COLUMN_1_POST_META_ID'
//stop editing
);
return wp_parse_args( $custom, $columns );
}
Any idea on what I should add to the functions so that the new custom column will be for Group ID or Group Name?
]]>For the users list I could only find a custom field for the Group ID, any idea on how I could show the group name?
As for the woocommerce orders page, how could I show a column of the customer’s registered BP groups at all?
Hope that someone could help with this as I must accomplish this somehow.
Thanks!
Strict Standards: Declaration of BPGE::display() should be compatible with BP_Group_Extension::display($group_id = NULL) in /srv/users/serverpilot/apps/mainsite/public/wp-content/plugins/buddypress-groups-extras/core/loader.php on line 0
https://www.ads-software.com/plugins/buddypress-groups-extras/
]]>This plugin solves a big problem and work’s great for my project. However, one issue is that I don’t want the child group’s slug to be affected. For example, if a parent group has the slug “groups/music”, and I have a child group called jass, then the slug for child group become “groups/music/jass”. I don’t want this to happen. I still want the child group’s slug to be “groups/jass”.
Is it possible, and how can I achieve this?
Thanks,
Manish
https://www.ads-software.com/extend/plugins/bp-group-hierarchy/
]]>