Custom code clash pre update check


Home Forums Front End PM PRO Custom code clash pre update check

This topic is: Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27998
    Andrew Perryman
    Participant

    Hi Shamim,

    Current Version 10.2.1

    Before I update to the next latest version 11.1.1 can you please check over the batch of custom PHP and CSS I have setup?

    I have them in a separate plugin to be able to isolate them easily, they are as listed below..

    Look forward to your update on your findings.

    custom PHP……

    // FEPM set reply message viewing accordion order.
    add_filter( 'fep_filter_get_message_with_replies', function( $args ){
        $args['order'] = 'DESC';
        return $args;
    });
    
    // FEPM Re-establishing reenforcing autosuggestion search.
    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;
    }
    
    // FEPM extra mail group tag variable
    add_filter( 'fep_eb_email_legends', function( $legends, $mgs, $user_email ){
        $legends['cus_group'] = array(
            'description' => __('Mail group name', 'front-end-pm'),
            'where' => array( 'newmessage', 'reply' ),
            'replace_with' => ! empty( $mgs->mgs_id ) ? apply_filters( 'fep_is_group_message', '', $mgs->mgs_id ) : '',
        );
        return $legends;
    }, 10, 3);
    
    // FEPM set Advanced group visibility for selected role.
    add_filter( 'fep_get_option', function( $value, $option, $default, $is_default ) {
    	if ( 'gm_groups' !== $option ) {
    		return $value;
    	}
    	
    	If (function_exists('get_current_screen')){
    		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( 'bureau', 'conseil', 'leaders', 'moderators', 'development' );
    	
    	foreach ( $groups as $group ) {
    		unset( $value[ $group ] );
    	}
    	
    	return $value;
    }, 10, 4 );
    
    ?>
    

    and finally CSS..

    @media screen and (max-width: 480px){
    #fep-menu .fep-button, .fep-button, .fep-button-active { width: 90%;}
    }
    
    .fep_unread_message_count_text { 
    color: #edbf1a;
    font-weight: bold;
    }
    .fep_unread_announcement_count_text { 
    color: #edbf1a;
    font-weight: bold;
    }
    .fep_unread_message_count_text:hover { 
    color: #ff0000;
    font-weight: bold;
    }
    .fep_unread_announcement_count_text:hover { 
    color: #ff0000;
    font-weight: bold;
    }
    
    #28017
    Shamim Hasan
    Keymaster

    Hi,
    Your most of the code if ok. Last part is changed. You can remove all under “FEPM set Advanced group visibility for selected role.” and add following instead

    add_filter( 'fep_get_all_groups', function( $groups ){
    	// 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 $groups;
    	}
    	
    	// Change this with your desire group ids
    	$restricted_groups = array( 11, 12, 15 );
    	
    	foreach ( $restricted_groups as $group_id ) {
    		unset( $groups[ $group_id ] );
    	}
    	return $groups;
    });
    

    Please note that group slug is no longer relevant. Use group id (post id of that group) instead.

    Let me know.

    #28019
    Andrew Perryman
    Participant

    Hi Shamim,
    Thanks for the update I will make the amendments and then update.
    One question, how or where do I look to identify the group ID’s

    Andrew

    #28022
    Shamim Hasan
    Keymaster

    After update follow bellow screenshot.

    Attachments:
    You must be logged in to view attached files.
    #28355
    Andrew Perryman
    Participant

    Hi Shamim,

    Thanks for your support for all the above all is now working correctly..

    Andrew.. 😉

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.