strangerstudios / pmpro-nav-menus

Creates member navigation menus and swaps your theme's navigation based on a user's Membership Level
https://www.paidmembershipspro.com/add-ons/pmpro-nav-menus/
14 stars 15 forks source link

Multisite Membership add-on compatibility #16

Open dparker1005 opened 4 years ago

dparker1005 commented 4 years ago

Currently, sub-sites using the Multisite Membership add-on cannot add menus for specific membership levels. This is because the 'pmpro_nav_menu_hidden_level_' . $level_id option (which contains whether there should be level-specific menus for a particular level) is stored in the wp_options table, which does not get mapped over to sub-sites via Multisite Membership add-on: https://github.com/strangerstudios/pmpro-nav-menus/blob/9bf0fe9f16dbd4ec6a556d83884116de9ffef7e2/pmpro-nav-menus.php#L76

The best way to fix resolve this conflict would probably change 'pmpro_nav_menu_hidden_level_' . $level_id to be stored in the pmpro_membership_levelmeta table, which will be accessible by sub-sites using Multisite Membership.

dparker1005 commented 4 years ago

Created a workaround here: https://gist.github.com/dparker1005/61325314c7d056c5a9a60bb51e0974dc