Title: Customizing via a Custom Plugin
Last modified: January 29, 2018

---

# Customizing via a Custom Plugin

 *  Resolved [diondkb](https://wordpress.org/support/users/diondkb/)
 * (@diondkb)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/)
 * Hi,
 * I followed the instructions at this url – [https://www.paidmembershipspro.com/documentation/templates/](https://www.paidmembershipspro.com/documentation/templates/),
   but get an error when loading the plugin. The error is ‘Fatal error: Cannot redeclare
   pmpro_shortcode_account() (previously declared …’.
 *     ```
       function my_pmpro_pages_shortcode_pmpro_account($content)
       {
       	ob_start();
       	include(plugin_dir_path(__FILE__) . "templates/pmpro_account.php");
       	$temp_content = ob_get_contents();
       	ob_end_clean();
       	return $temp_content;
       }
       add_filter("pmpro_pages_shortcode_account", "my_pmpro_pages_shortcode_pmpro_account");
       ```
   
 * I want to overwrite the password and profile url.
 * Any help would be appreciated.
 * Dion

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

 *  [The API Guys](https://wordpress.org/support/users/pbarthmaier/)
 * (@pbarthmaier)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/#post-9920281)
 * Hi Dion,
 * This type of error is related to the requirement for php to have unique functions
   in order to run properly. What you can simple do is to rename the function and
   it will run. There isn’t anything magical about the NAME of the function; what
   matters is that you run on the proper hook and that you pass in the $content 
   argument. Go for something like this:
 *     ```
       function my_second_pmpro_pages_shortcode($content)
       {
       	ob_start();
       	include(plugin_dir_path(__FILE__) . "templates/pmpro_account.php");
       	$temp_content = ob_get_contents();
       	ob_end_clean();
       	return $temp_content;
       }
       add_filter("pmpro_pages_shortcode_account", "my_second_pmpro_pages_shortcode");
       ```
   
 *  Thread Starter [diondkb](https://wordpress.org/support/users/diondkb/)
 * (@diondkb)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/#post-9921770)
 * Hi,
 * Thanks for the reply. I think the problem is that pmpro_account.php contains 
   the function pmpro_shortcode_account() which at that stage has already been loaded.
   Its as if the included file(in the customisation plugin), “plugin_dir_path(__FILE__).“
   templates/pmpro_account.php” is loaded twice, the first being the original and
   the second time the one I have adjusted?
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/#post-9948009)
 * Is this throwing an error on your site?
 * If so I would recommend in renaming the `pmpro_shortcode_account` function to
   something like `pmpro_shortcode_account_custom`.
 * This should resolve the issue of redeclaring function names.
 *  Thread Starter [diondkb](https://wordpress.org/support/users/diondkb/)
 * (@diondkb)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/#post-9949237)
 * Hi Andrew. Not sure where you found that function – pmpro_shortcode_account. 
   I thought the idea behind this all is to replace the original file – pmpro-account.
   php, or pmpro-checkout.php etc with your file of the same name, but with your
   changes, saved in the template folder off of the pmpro-customizations sub directory.
   This is how I understand this link – [https://www.paidmembershipspro.com/documentation/templates/customizing-via-a-custom-plugin/](https://www.paidmembershipspro.com/documentation/templates/customizing-via-a-custom-plugin/)

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

The topic ‘Customizing via a Custom Plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [pmpro](https://wordpress.org/support/topic-tag/pmpro/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 4 replies
 * 3 participants
 * Last reply from: [diondkb](https://wordpress.org/support/users/diondkb/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/customizing-via-a-custom-plugin/#post-9949237)
 * Status: resolved