Display more than 10 invitation codes per page.

I’m working with M2P and I need to be able to see more than 10 invitation codes on the screen at once. The ‘Screen Options’ section isn’t appearing. Any workaround? Please check and help.

  • Dimitris
    • Support Star

    Hello there Lucy,

    hope you’re doing well!

    It seems to me that this is hard-coded in the plugin here:

    wp-content/plugins/membership-pro/premium/addon/invitation/helper/class-ms-addon-invitation-helper-listtable.php

    in line #58

    $per_page = $this->get_items_per_page( 'invitation_per_page', 10 );

    Changing this into a higher value like 50 items per page, does the trick:

    $per_page = $this->get_items_per_page( 'invitation_per_page', 50 );

    I’ve also forwarded this to our Second Level Support team, as this change is going to be lost with any future update of the Membership 2 Pro plugin. We’ll keep you posted here in case there’s a safer workaround. :slight_smile:

    Thank you,

    Dimitris

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Lucy ,

    You can revert the changes that you made in the plugins core files and you can add an extra mu-plugin to achieve the 100 listing of codes without the need of altering the plugins code.

    How to install:

    Always make sure to keep a backup of your site before changing/adding custom code.

    1] Navigate to your /wp-content/ directory and create a new one named mu-plugins if it doesn’t exist.

    2] Inside the mu-plugins folder create a file named filter-for-invitation-codes.php

    3] Edit the file and copy / paste this code snippet inside.

    <?php

    add_filter(
    'invitation_per_page',
    function( $per_page ) {
    $per_page = 100;
    return $per_page;
    },
    15
    );

    4] Save and close the file.

    4] The final path should look like /wp-content/mu-plugins/filter-for-invitation-codes.php

    5] Everything should work after that automatically.

    Could you also tell me a little bit more about what you’d like to change with Memberships and Multisite Content Copier ?

    Regards,

    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.