Shamim Hasan

Forum Replies Created

Viewing 15 posts - 1,561 through 1,575 (of 2,484 total)
  • Author
    Posts
  • in reply to: Group Visibility (Role Restriction) In personal settings #17270
    Shamim Hasan
    Keymaster

    Add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_get_option', function( $value, $option, $default, $is_default ) {
    	if ( 'gm_groups' !== $option ) {
    		return $value;
    	}
    	if ( is_admin() && 'users' !== @get_current_screen()->parent_base ) {
    		return $value;
    	}
    	if ( ! is_admin() && 'settings' !== @$_GET['fepaction'] ) {
    		return $value;
    	}
    	
    	// Change this with which role you want to give access to all groups
    	$allowed_roles = array( 'editor', 'administrator' );
    	
    	if ( array_intersect( $allowed_roles, wp_get_current_user()->roles ) ) {
    		return $value;
    	}
    	
    	// Change this with your desire groups slug
    	$groups = array( 'test1', 'test2' );
    	
    	foreach ( $groups as $group ) {
    		unset( $value[ $group ] );
    	}
    	
    	return $value;
    }, 10, 4 );
    

    Change roles and groups as required

    in reply to: Group Visibility (Role Restriction) In personal settings #17254
    Shamim Hasan
    Keymaster

    So you want to restrict those groups so that only editor and administrator can see those group in user settings page, other users cannot see those groups in settings page (in front-end), right?

    in reply to: Group message #17251
    Shamim Hasan
    Keymaster

    From version 10.1.1 this works your way. Users can get only messages which is sent when they are in that group.

    in reply to: How to see old announcements after the role change #17249
    Shamim Hasan
    Keymaster

    From version 10.1.1 both group message and announcement work this way. Users can access group messages/ announcements only which is sent when they are in that role/group.

    I have tested above code again and find working.
    I have created an announcement to test role RA. Then i have checked if user UA (which user role is not RA) have got that announcement. find that user UA have no access to that announcement. Now i changed that user role to RA and now that user have access to that announcement.

    Please check and let me know.

    in reply to: How to see old announcements after the role change #17233
    Shamim Hasan
    Keymaster

    Add following code in your theme’s (child theme’s if any) functions.php

    add_action( 'set_user_role', function( $user_id, $role, $old_roles ) {
    	global $wpdb;
    	
    	if ( ! defined( 'FEP_PARTICIPANT_TABLE' ) ) {
    		return false;
    	}
    	$mgs_ids = $wpdb->get_col( $wpdb->prepare( "SELECT fep_message_id FROM $wpdb->fep_messagemeta where meta_key = %s AND meta_value = %s", '_fep_participant_roles', $role ) );
    	if ( $mgs_ids ) {
    		$query = 'INSERT INTO ' . FEP_PARTICIPANT_TABLE . ' (mgs_id, mgs_participant) VALUES ';
    		
    		foreach ( $mgs_ids as $mgs_id ) {
    			$values[] = $mgs_id;
    			$values[] = $user_id;
    			
    			$place_holders[] = '(%d, %d)';
    		}
    		$query .= implode( ', ', $place_holders );
    		$wpdb->query( $wpdb->prepare( $query, $values ) );
    		
    		delete_user_meta( $user_id, '_fep_user_announcement_count' );
    	}
    }, 10, 3 );
    
    in reply to: How to create a new announcement #17210
    Shamim Hasan
    Keymaster

    Next version i will enable this by default.

    in reply to: Message URL link from Email #17197
    Shamim Hasan
    Keymaster

    May be next week.

    in reply to: autosuggestion inconsistant #17180
    Shamim Hasan
    Keymaster

    Thank you.
    “Display name publicly as” is the name which is made to show publicly.
    First Name and Last Name is saved in meta and is not searchable by default.
    When you search a user it searches by id, Username, Nickname, Email, Website url. So when you do not found any user please check if you are searching by any of these.

    in reply to: In need of both Reply and ReplyAll buttons #17168
    Shamim Hasan
    Keymaster

    Thank you.
    I really appreciate.

    in reply to: autosuggestion inconsistant #17166
    Shamim Hasan
    Keymaster

    Can you please go to profile edit page of that user and see under which name “Margaret Argent” is showing?

    in reply to: In need of both Reply and ReplyAll buttons #17160
    Shamim Hasan
    Keymaster

    Hi Andrew
    I wrote “Same Message” by mistake and it already sent email to subscribers. Then i corrected that in this forum.

    Forum one is correct.

    in reply to: In need of both Reply and ReplyAll buttons #17146
    Shamim Hasan
    Keymaster

    Please go to Front End PM PRO > Settings > Recipient > Message type and select “Separate Message”.
    Now when user will send message to multiple recipient (select one by one) then everyone will receive a separate message and users can send reply separately.

    in reply to: autosuggestion inconsistant #17144
    Shamim Hasan
    Keymaster

    Please add following code in your theme’s (child theme’s if any) functions.php

    add_action( 'fep_autosuggestion_arguments', 'fep_cus_autosuggestion' );
    add_action( 'fep_group_members_suggestion_arguments', 'fep_cus_autosuggestion' );
    
    function fep_cus_autosuggestion( $args ){
    	unset( $args['search_columns'] );
    	return $args;
    }
    

    Let me know.

    in reply to: Message URL link from Email #17143
    Shamim Hasan
    Keymaster

    Next version will show full thread.
    If you need urgently, please let me know so that i can give you code for this.

    in reply to: Lost Facility to Edit Messages #17129
    Shamim Hasan
    Keymaster

    I see.
    You can use some regex to automatically remove phone numbers, email address (not always works).
    I will add this feature in next version.

Viewing 15 posts - 1,561 through 1,575 (of 2,484 total)