Home › Forums › Front End PM PRO › Custom code clash pre update check
Tagged: check, clash, code, Pre update
- This topic has 4 replies, 2 voices, and was last updated 5 years, 4 months ago by Andrew Perryman.
-
AuthorPosts
-
August 10, 2019 at 10:05 pm #27998Andrew PerrymanParticipant
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; }
August 11, 2019 at 2:43 pm #28017Shamim HasanKeymasterHi,
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 insteadadd_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.
August 11, 2019 at 3:02 pm #28019Andrew PerrymanParticipantHi 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’sAndrew
August 11, 2019 at 5:48 pm #28022Shamim HasanKeymasterAugust 21, 2019 at 7:10 pm #28355Andrew PerrymanParticipantHi Shamim,
Thanks for your support for all the above all is now working correctly..
Andrew.. 😉
-
AuthorPosts
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.