Is there a way for me to add functionality to your plugin that won't get removed with an update

I need to customize this plugin so that I can add more options to the access levels because the options that I need are not available, but I don't want to spend days worth of coding and add them and then you push an update and overwrite everything I did. Is this possible?

  • Vaughan

    Hi Michael,

    Hope you're well?

    I'm not entirely sure on this, could you give me some more details of the options you are wanting to add? I can then look at the plugin code to see if there's any filters that could be used. But off the top of my head, i'm not sure this would be possible.

    If it helps you though, not sure if you are using windows, but there's a great little program called winmerge, which is like a diff tool, it can scan entire folders/files and will highlight the differences in each file between different versions, which would make it easier for you to add your changes back into the updated files. just an idea in case this isn't possible.

    Hope this helps

  • David

    Hello Vaughan,

    Thank you. I am actually building a subscription Job Site and I need to be able to restrict specific job types to subscribing members. Because this is a custom post type and a custom meta field, I will have to add this to your plugin. I've figured out part of how to do this already, but I didn't want to spend too many days working on this only to have someone update the plugin and wipe out multiple days of programming.

    I am actually working on a Mac, but I do know of the website https://www.diffchecker.com/ which will also do this. I was just hoping for a better way. Like the ability to do this from the themes functions.php file.

    If you don't have this ability yet, maybe it could be an added feature later??? :slight_smile:

    I just don't like going in an editing other people's code, especially when it has to be in multiple files of something that gets updated on a regular basis, if you know what I mean.

  • Vaughan

    Hi,

    I've just flagged one of our developers to see if he can come up with a solution using a filter or hook, it's most likely the hook required would be in the Jobs & experts plugin itself though rather than membership plugin as it's the jobs plugin you're wanting to restrict. (I'm assuming you're using the Jobs & experts plugin for the jobs). Hopefully there might be a solution, but I can't make any guarantees.

    Hope this helps

  • David

    Hello,

    Actually, I'm not using a plugin for this. I wrote all of the code. But you actually gave me an idea. I may be able to tell Wordpress to only show those job types if a user is logged in, because they shouldn't be able to login unless they have already subscribed.

    I just thought that it would be better if it was in the membership plugin because you already have it setup to look for positive and negative rules based on the subscription level. This is where I was trying to add this feature into, but didn't want to spend a bunch of time customizing it only to have someone update the plugin in the future and overwrite all of my code.

    Thank you,
    Michael

  • Vaughan

    Hi,

    So depending on these job types, if you add accessibility into them so you can restrict them based on user roles, this could work with membership subscriptions. When you configure the access levels for membership, if you select the advanced rules tab rather than positive/negative, the advanced rules will allow you to assign a user role to that access level, so when anybody signs up to that plan, they are assigned that user role for that level.

    That might be an idea?

    Hope this helps

  • David

    Hello,

    Actually, I think that is excellent. I have reset my code to look for the user roles and that seems to be working. The next step for me is to sign up as a new member and see if it really does change their role to member. If this is the case, then I believe that this will be perfect. That just saved me days worth of coding customizations into your plugin as well.

    I'm pretty sure that I won't need any hooks now, although they could become useful to another programmer in the future. Another idea that I had would be if your plugin actually checked to see if there was any custom post types or custom taxonomies so that users would be able to add those to the rules also. Currently it only use's the built in "post" post type and the built in "categories" taxonomy. I think if you were to check to see if any custom post types were installed and if any custom taxonomies were installed and if they were, added them to the options, that could be very useful to another person. Just a thought.

    Thank you again. I really do appreciate it.

    Michael

  • Ash

    Hello @Michael

    I hope you are well today.

    Would you please make sure you have all pages selected in Membership > Options > Membership Pages? Every pages need to be unique, I mean no pages should not be selected in two options.

    If pages are selected as it should, would you please grant support access from your Dashboard > WPMU DEV > Support > Support Access so that I can check?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    I will be happy to take a look :slight_smile:

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.