In lots of these recipes, you will see the instructions to add some bunch of code to the “active theme’s functions.php file” or “a custom plugin”. How do you go about creating a custom plugin? Like this.

You will need to be able to FTP into your website. If you don’t know how, ask your host or Google it.

  1. Create a folder called pmpro-customizations in the wp-content/plugins folder of your site.
  2. Create a file called pmpro-customizations.php in the folder you just created.
  3. Edit pmpro-customizations.php and paste this code into it:

    <?php
    /*
    Plugin Name: PMPro Customizations
    Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
    Description: Customizations for Paid Memberships Pro
    Version: .1
    Author: Stranger Studios
    Author URI: http://www.strangerstudios.com
    */
  4. Add the code for the recipe you are doing at the bottom of pmpro-customizations.php.
  5. Save it.
  6. Go to Plugins in your WP Dashboard and active the PMPro Customizations plugin.

Tada!

Author’s gravatar

this looks very doable. 3 questions.
1. do custom plug ins slow down the speed of my site?
2. do I need to do anything to the custom plugin when a new version of the PaidMembership pro updates?
3. I want to use this new plugin you got but don’t want to require Last Name. Should I create a custom plug in and edit the code from https://github.com/strangerstudios/pmpro-add-name-to-checkout OR just download this one and edit the code in there directly to NOT require last name?

thank you! love this help forum so far. great job!

Lei

Reply
Author’s gravatar

can you have more than one customized plug-in at a time? or do you put them into this one instance?

Reply

All customizations can go into the same pmpro-customizations file core plugin file (pmpro-customizations.php). We have some add ons that function as separate plugins but for code recipes and defining certain global variables in conjunction with add on plugins, you just need a single pmpro-customizations plugin.

Reply
Author’s gravatar

In that case, how would you tell the plugin to apply itself (for instance, if I add “company” field to checkout for businesses, but not individuals) only to one membership level, not all?

Author’s gravatar

You can set a “level” property on Register Helper fields so they are only applied to specific levels. So e.g.

`
$fields[] = new PMProRH_Field(
“company”, // input name, will also be used as meta key
“text”, // type of field
array(
“size”=>40, // input size
“class”=>”company”, // custom class
“profile”=>true, // show in user profile
“required”=>true, // make this field required
“level”=>array(1,2,3) //only add this field to levels 1,2, and 3
));
`

Author’s gravatar

Hi, Jason, I was sure there had to be a way! Here’s how I incorporated it, but there is no effect on the fields. Thoughts on where I went wrong?

//define the fields
$fields = array();
$fields[] = new PMProRH_Field(“Organization Name”, “text”, array(“size”=>40, “class”=>”Organization Name”, “profile”=>true, “required”=>true, “level”=>array(2)));
$fields[] = new PMProRH_Field(“Organization Email”, “text”, array(“size”=>40, “class”=>”Organization Email”, “profile”=>true, “required”=>false, “level”=>array(2)));
$fields[] = new PMProRH_Field(“Contact Name”, “text”, array(“size”=>40, “class”=>”Contact Name”, “profile”=>true, “required”=>true));
$fields[] = new PMProRH_Field(“Contact Email”, “text”, array(“size”=>40, “class”=>”Contact Email”, “profile”=>true, “required”=>true));

Author’s gravatar

Hate to beat a dead horse, but what IF I wanted to create seperate plugins for each of my customizations so I could control turning some of them on/off without affecting the others.. Can I do this?? If so HOW??

Reply
Author’s gravatar

You could do this. Just change the folder name, file name, and “Plugin Name” and “Plugin URI” to something unique for each plugin. Then they will show up as separate plugins in your dashboard. The plugin “Pluginception” is also an easy way to generate plugins in a WP install:

https://wordpress.org/plugins/pluginception/

Reply
Author’s gravatar

I installed PM Pro, the helper plugin and created the pmpro-customizations.php as instructed. The custom fields show up fine on checkout and profile BUT it doesn’t save to database. Did I miss a step? Thanks.

Reply
Author’s gravatar

This is not a known bug, you should post something to the member forums and we can help you out.

Reply
Author’s gravatar

Hi,

I followed the instruction, used this code (https://gist.github.com/strangerstudios/6003272) for the plugin and uploaded it. But for some reason it doesn´t show up in the plugin sections. I checked three times now, if I did anything wrong, but it´s basically just copy and paste. Do you now any common mistake that I could have made? It´s named correctly and in the right place – I really have no clue, why it doesn´t show up!?

Reply
Author’s gravatar

You need to put the “header” information from the pmpro-customizations template above the code from that gist. So paste them together with the pmpro-customizations on top and make sure it’s in the /wp-content/plugins/ folder. If you need more help, post to our member forums and we’ll help you out.

Reply
Author’s gravatar

Hi Jason,

Thank you for your reply. After checking everything a few more times and not finding any mistake, I just created folder and file again from scratch and for some reason now it works!?!?
I also sent an e-mail to your support over your contact form. Since the problem is already solved, please just ignore it.

Thank you!

Author’s gravatar

Hi, I am currently using the PMPro Customization and I am very happy with this plugin. The only item I am figuring out at the moment is how to inject javascript into the pmpro customization, because I am looking at having a datepicker for my date fields.

Reply
Author’s gravatar

Hi Jason. Is there any reason why using Code Snippets plugin (https://wordpress.org/plugins/code-snippets/) and adding each recipe as a snippet wouldn’t work? I have used it successfully to add functions before (it’s good because you can switch themes without worrying about your functions.php). It’s also handy because you can activate/deactivate functions (snippets) independently to aid troubleshooting.

Reply
Author’s gravatar

That looks really cool and I think that would be a good way to manage the code snippets we share on the site here. It is similar to what we suggest with the pmpro-customizations.php plugin, but you can add the code via the WP GUI instead of having to edit the plugin file directly.

Reply
Author’s gravatar

Hi Trishacupra, I have created snippets in almost all of my codes to customize wordpress and to do things that existing plugins don’t have. so far, I don’t have any issue and quite satisfied with it. With code snippets, you can do almost everything you want. :)

Author’s gravatar

I am launching a site for a 501(c)(3) non-profit. One of the constraints the Board has stipulated is that there can be no mention of the word “membership” in the membership section (I know – ironic right?). Instead everything has to be “patron” & donation. I have been able to accomodate so far by revising all front-facing instances of the word “membership” to “patron”, etc, EXCEPT for the Membership Levels page (for me – the Patron Levels page) which is generated when a prospective patron selects a patron level package (i.e. a Membership Level). I think I tracked it down to the PMPro functions.php file and the pmpro_getLevelCost() function called there. I tried creating a custom plugin – which initiated just fine – and pasted a modified copy of the pmpro_getLevelCost() function into it. Of course, it throws and error because I am asking the function to fire off twice. I have a couple ideas on how to proceed, but thought I would put it out there to you folks to see what you think – perhaps you can suggest something.

The non-profit folks would also like me to modifiy the URL / permalinks to remove all instances of the word “membership” as well. This is a lower priority for me.

Any contribution will be very much appreciated.

Bill

Reply
Author’s gravatar

Hi Jason,

Really this plugin awesome :). I found this plugin from wordpress.org then I downloaded it. Its working perfectly. But I’m facing a problem. one more I install this pmpro-register-helper for register. User can register without choose plan or level. Actually I want that for now. But I don’t understand how can i do this. can anyone help me?

Regards

Reply
Author’s gravatar

You can either create a free level and direct people there to sign up, or you can use the pmpro_register_redirect filter to disable the feature of PMPro that redirects the default WP registration to the PMPro levels page:
http://www.paidmembershipspro.com/hook/pmpro_register_redirect/

Reply
Author’s gravatar

hi Jason

I want a user see a video post only once per week.

How can I do it.
Please help me

Thanks & Regards
Manoj

Author’s gravatar

hi

thanks for it.

Please tell me how to set PMPRO_LPV_LIMIT to set the number of view of a post

Reply

Leave a Reply