Title: Code Changes
Last modified: August 22, 2016

---

# Code Changes

 *  Resolved [titan21](https://wordpress.org/support/users/titan21/)
 * (@titan21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/code-changes-1/)
 * Hi,
 * I am using this plugin in a project I am working on and had to make some changes
   to the source code of the plugin to cater for some additional functionality. 
   Basically, it’s just adding some filters in to allow developers to change the
   way the menu is displayed. I tried adding the proposed change via GitHub but 
   it was rejected as this is not where it is developed. Can I send someone the 
   proposed changes to review and possibly include into the code? I may need to 
   make some further amendments and it seems a shame to not make those amendments
   available to other users of the plugin.
 * Tim
 * [https://wordpress.org/plugins/front-end-pm/](https://wordpress.org/plugins/front-end-pm/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/code-changes-1/#post-5521226)
 * I am also working to add action and filter to this plugin. Your modification 
   can help me.
    Next release of this plugin you will find some action and filters.
   You can give me the code and i can modify if needed and add with this plugin 
   code. Thnks
 *  Thread Starter [titan21](https://wordpress.org/support/users/titan21/)
 * (@titan21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/code-changes-1/#post-5521242)
 * Good stuff! The code I’ve chnaged is the dispHeader function at line 1622:
 *     ```
       function dispMenu()
           {
       	global $user_login;
   
             $numNew = $this->getNewMsgs_btn();
       	  $allNew = $this->getNewMsgs_admin();
       	  $numAnn = $this->getAnnouncementsNum_btn();
       	  $myconNew = $this->mycontact_new();
       	  $conNew = $this->getcontact_new();
       	  $spamNew = $this->getSpam_new();
       	  $tocheck = get_option('fep_cf_to_field');
   
       	  $label_newmessage = apply_filters("fep_newmessage_label", "New Message");
       	  $label_messagebox = apply_filters("fep_messagebox_label", "Message Box");
       	  $label_contactmessages = apply_filters("fep_contactmessages_label", "Contact Messages");
       	  $label_announcements = apply_filters("fep_announcements_label", "Announcements");
       	  $label_directory = apply_filters("fep_directory_label", "Directory");
       	  $label_settings = apply_filters("fep_settings_label", "Settings");
       	  $label_viewallmgs = apply_filters("fep_viewallmessages_label", "All Messages");
       	  $label_contactmgs = apply_filters("fep_viewallcontactmessages_label", "All Contact Messages");
       	  $label_spam = apply_filters("fep_spam_label", "Spam");
       	  $label_newemail = apply_filters("fep_newemail_label", "Send Email");
   
             $menu = apply_filters("fep_menu_open", "<div id='fep-menu'>");
             $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "newmessage", $this->actionURL."newmessage", __($label_newmessage, "fep")), "newmessage", $this->actionURL."newmessage", __($label_newmessage, "fep"));
             $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "messagebox", $this->pageURL, sprintf(__($label_messagebox."%s", "fep"), $numNew)), "messagebox", $this->actionURL."messagebox", sprintf(__($label_messagebox."%s", "fep"), $numNew));
       	  if ($tocheck){
       	  if (in_array($user_login,$tocheck)){
       	  $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "mycontactmgs", $this->actionURL."mycontactmgs", sprintf(__($label_contactmessages."%s", "fep"), $myConNew)), "mycontactmgs", $this->actionURL."mycontactmgs", sprintf(__($label_contactmessages."%s", "fep"), $myConNew));}}
             $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "viewannouncements", $this->actionURL."viewannouncements", sprintf(__($label_announcements."%s", "fep"), $numAnn)), "viewannouncements", $this->actionURL."viewannouncements", sprintf(__($label_announcements."%s", "fep"), $numAnn));
       	  if($this->adminOps['hide_directory'] != '1' || current_user_can('manage_options'))
             $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "directory", $this->actionURL."directory", __($label_directory, "fep")), "directory", $this->actionURL."directory", __($label_directory, "fep"));
             $menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "settings", $this->actionURL."settings", __($label_settings, "fep")), "settings", $this->actionURL."settings", __($label_settings, "fep"));
       	  if(current_user_can('manage_options')){
       		$menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "viewallmgs", $this->actionURL."viewallmgs", sprintf(__($label_viewallmgs."%s", "fep"), $allNew)), "viewallmgs", $this->actionURL."viewallmgs", sprintf(__($label_viewallmgs."%s", "fep"), $allNew));
       		$menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "contactmgs", $this->actionURL."contactmgs", sprintf(__($label_contactmgs."%s", "fep"), $conNew)), "vcontactmgs", $this->actionURL."contactmgs", sprintf(__($label_contactmgs."%s", "fep"), $conNew));
       		$menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "spam", $this->actionURL."spam", sprintf(__($label_spam."%s", "fep"), $spamNew)), "spam", $this->actionURL."spam", sprintf(__($label_spam."%s", "fep"), $spamNew));
       		$menu .= apply_filters("fep_menu_button", sprintf("<a class='fep-button %s' href='%s'>%s</a>", "newemail", $this->actionURL."newemail", __($label_newemail, "fep")), "newemail", $this->actionURL."newemail", __($label_newemail, "fep"));}
       	  $menu .= apply_filters("fep_menu_close", "</div>");
             $menu .= "<div id='fep_menu_open'>";
             return $menu;
           }
       ```
   
 * And this was the original comment with the Pull Request on GitHib:
 * > I was looking to customize a few areas of the plugin so was looking for filters/
   > actions to plug into. I have rewritten the function dispMenu to include some
   > filters for changing the label text for each of the buttons:
   > fep_newmessage_label
   >  fep_messagebox_label fep_contactmessages_label fep_announcements_label
   > fep_directory_label fep_settings_label fep_viewallmessages_label fep_viewallcontactmessages_label
   > fep_spam_label fep_newemail_label
   > In addition, I have created two filters to amend the html generated for the
   > beginning and end sections of the menu area:
   > fep_menu_open
   >  fep_menu_open
   > I have also added a filter to enable styling of the buttons themselves:
   > fep_menu_button
   > This also allows the insertion of a css class for further styling if needed.
 * Are you planning on putting your code on GitHub as I may make some further amendments
   which may be useful to the plugin generally and Pull Requests would seem a sensible
   way of doing this.
 *  Thread Starter [titan21](https://wordpress.org/support/users/titan21/)
 * (@titan21)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/code-changes-1/#post-5521438)
 * Hi Shamim,
 * Can you advise whether these changes will be incorporated into the new release?
 * Thanks,
 * Tim
 *  Plugin Author [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/code-changes-1/#post-5521439)
 * new version is almost ready. u will get new version next month with lots of action
   and filters.
    hope everybody will like this release.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Code Changes’ is closed to new replies.

 * ![](https://ps.w.org/front-end-pm/assets/icon-256x256.gif?rev=2309447)
 * [Front End PM](https://wordpress.org/plugins/front-end-pm/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/front-end-pm/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/front-end-pm/)
 * [Active Topics](https://wordpress.org/support/plugin/front-end-pm/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/front-end-pm/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/front-end-pm/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/code-changes-1/#post-5521439)
 * Status: resolved