Title: CodeWaggle's Replies | WordPress.org

---

# CodeWaggle

  [  ](https://wordpress.org/support/users/codewaggle/)

 *   [Profile](https://wordpress.org/support/users/codewaggle/)
 *   [Topics Started](https://wordpress.org/support/users/codewaggle/topics/)
 *   [Replies Created](https://wordpress.org/support/users/codewaggle/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/codewaggle/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/codewaggle/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/codewaggle/engagements/)
 *   [Favorites](https://wordpress.org/support/users/codewaggle/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Sample Custom Role Code Shown in Readme](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/#post-4732157)
 * Hey that’s great, it’s even easier to customize than what I wrote!
 * Feel free to use anything I’ve posted, just makes the effort all the more worthwhile.
 * Joe
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Sample Custom Role Code Shown in Readme](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/#post-4732155)
 * I was hoping that Dave would check back and see it, I just missed him by 10 minutes.
 * Hopefully someone else will find it helpful in the future.
 * Next time you do an update you could change the description to note that it’s
   very flexible.
 * This plugin lets you hide custom menu items based on user roles. So if you have
   a link in the menu that you only want to show to logged in users, certain types
   of users, or even only to logged out users, this plugin is for you.
 * In addition to user roles, you can customize the functionality by adding check
   boxes with custom labels using the “`nav_menu_roles`” filter and then use the“`
   nav_menu_roles_item_visibility`” filter to check against whatever criteria you
   need. You can check against any user meta values (like capabilities) and any 
   custom attributes added by other plugins.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Sample Custom Role Code Shown in Readme](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/#post-4732142)
 * You can use it for anything you want, including capabilities.
 * Here’s what I’m doing:
    I make up names that I want to appear in the “Access 
   Role” section of the menu item:
 *     ```
       function cwaga_new_roles( $roles ){
       	$roles['member'] = 'Member';
       	$roles['registered'] = 'Registered';
       	return $roles;
       }
       add_filter( 'nav_menu_roles', 'cwaga_new_roles' );
       ```
   
 * Then I write code that tells it what to do if my custom “role” is checked for
   that menu item. So you can write code that pulls the capabilities for the current
   user from the user_meta table and check if they have the capability that you 
   want them to have. In my case I’m checking the users membership level, so my 
   code gets their level and compares it based on my criteria.
 *     ```
       function cwaga_item_visibility( $visible, $item ){
         global $pmpro_ready;
         if( is_user_logged_in() && isset($pmpro_ready) ){
           if( isset( $item->roles ) && is_array( $item->roles ) && in_array( 'member', $item->roles ) ){
             global $current_user;
             $user_id = $current_user->ID;
             $cwjds_member_level_info = pmpro_getMembershipLevelForUser($user_id);
   
             if ( $cwjds_member_level_info->ID > 1 ){
               $visible = true;
             } else {
               $visible = false;
             }
           } elseif( isset( $item->roles ) && is_array( $item->roles ) && in_array( 'registered', $item->roles ) ){
             global $current_user;
             $user_id = $current_user->ID;
             $cwjds_member_level_info = pmpro_getMembershipLevelForUser($user_id);
   
             if ( isset($cwjds_member_level_info) && $cwjds_member_level_info->ID == 1 ){
               $visible = true;
             } else {
               $visible = false;
             }
           }
         }
       	return $visible;
       }
       add_filter( 'nav_menu_roles_item_visibility', 'cwaga_item_visibility', 10, 2 );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Sample Custom Role Code Shown in Readme](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/sample-custom-role-code-shown-in-readme/#post-4732060)
 * Glad to help,
    Joe
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin Organizer] Notice: Undefined variable: enabledMobilePlugins and disabledMobilePlugins](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358363)
 * Your Welcome.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin Organizer] Notice: Undefined variable: enabledMobilePlugins and disabledMobilePlugins](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358240)
 * P.S.
 * Forgot to mention what a great plugin this is. I just came across it a few hours
   ago and it’s taken care of a conflict with the order that two plugins are loading(
   I was using a small function to change the priority, this is easier to keep track
   of).
 * Plus it’s taken care of the main goal which was to disable a plugin on a page
   where it was causing a conflict and isn’t needed.
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions] Conflict with Page Builder by SiteOrigin](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/#post-4323937)
 * Thanks for explaining the reason for the early priority, makes great sense.
 * Updating the priority via an action is a great option. It may be a little slower
   to let the shortcodes and such run, but my client will be happy that they can
   use widgets in the content area without messing with the plugin code each time
   it’s updated.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions] Conflict with Page Builder by SiteOrigin](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/#post-4323915)
 * It occurs to me that because this isn’t a bug, it’s just cluttering up this forum.
 * I’m mark it resolved and move on.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions] Conflict with Page Builder by SiteOrigin](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-page-builder-by-siteorigin/#post-4323914)
 * Hi,
 * I understand that you may not consider this to be a problem with Paid Memberships
   Pro as using a widget to create the main content is unusual.
 * I’m thinking of manually changing the priority of the “add_filter(‘the_content’…”
   call so that I can use the two plugins together. Can you tell me if there is 
   some problem that was resolved by using priority 5 for the call so that I can
   see if that will cause any problems with the way we’re using it?
 * I tried looking at the file history for the content.php file on GitHub, but the
   oldest version already has the priority set to 5, so I’m not able to see why 
   it was set to 5.
 * I tried searching through the change log, but didn’t see anything that would 
   seem to be a problem if I change the priority:
    Searched for “priority”: = 1.3.19
   = * Updated the priority of a few actions/hooks so the “besecure” https stuff
   gets run as soon as possible. Before it was possible that some URLs could be 
   written out with http: on an HTTPS page before PMPro had a chance to fix things.
   You should have fewer SSL errors on the checkout page to deal with now.
 * Searched for “the_content”:
    = 1.5.2 = * the_content filter removes any class
   =”more-link” class from the content if showing an excerpt.
 * = 1.4 =
    * Now applying “the_content” filters on the confirmation message on 
   the confirmation page. e.g. wpautop will be run on the text to automatically 
   add paragraphs.
 * = 1.3.4 =
    * Changed the membership shortcode to apply the_content filters to
   the return value instead of just wpautop. This allows shortcodes within that 
   shortcode and other filters to be run on the content. (Let me know if issues 
   arrise from this.)
 * Thanks,
    Joe
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions] Conflict with Black Studio TinyMCE Widget](https://wordpress.org/support/topic/conflict-with-black-studio-tinymce-widget/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/conflict-with-black-studio-tinymce-widget/#post-4323338)
 * I’ll close this thread and start a new one with a more accurate title.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions] Conflict with Black Studio TinyMCE Widget](https://wordpress.org/support/topic/conflict-with-black-studio-tinymce-widget/)
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/conflict-with-black-studio-tinymce-widget/#post-4323337)
 * It’s not a problem with the Black Studio TinyMCE Widget.
 * It’s a conflict between the Page Builder plugin and Paid Memberships Pro.
 * I’ll be posting the details of my test results soon.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Breezing Forms] Can't add form](https://wordpress.org/support/topic/cant-add-form/)
 *  [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/cant-add-form/#post-3892379)
 * [Creating a simple multiple-page form in WordPress®](http://crosstec.de/en/creating-a-simple-multiple-page-form-in-wordpress.html)
 * Step 8.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Breezing Forms] Show/Hide Conditions on the Same Field?](https://wordpress.org/support/topic/showhide-conditions-on-the-same-field/)
 *  [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/showhide-conditions-on-the-same-field/#post-3542040)
 * [Turn fields and sections on or off conditionally](http://crosstec.de/en/turn-fields-and-sections-on-or-off-conditionally.html)

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