The Issue we were facing:
1. The Non-super-admin users cannot create new forums.
2. The problem is for site administrators, they see invalid post type error on trying to create a New Forum from the frontend of the site. The Forum menus disappear completely in the back admin dashboard.
Why is it happening?
All checks to see confirm whether a user can or cannot take an action are based on what WordPress calls capabilities. WordPress roles are groups of these capabilities, such as administrator, editor, etc.
BBPress has a slew of custom actions that users can take, so BBPress creates its own roles. This is performed on the fly, so BBPress’ roles are not stored in the db. This is performed on the
after_setup_theme hook, which is fired just before WordPress sets up the logged-in user object.
Plugins shouldn’t perform any action on the user object until its actually instantiated, i.e. after the
init hook. Not all plugins are adhering to this rule, and they are all WPMUDEV plugins.
A number of these plugins invoke the
current_user_can() function on the
plugins_loaded hook, which is well before the
init hook. This includes default-theme, admin-message, google-analytics-async, pretty-plugins, lock-posts and remove-email-verifications, all WPMUDEV plugins.
Some of the WPMU plugins (all of the above installed on our network) use outdated wpmudev-dash-notification.php file which uses
plugins_loaded hook instead of
init hook (which was corrected in latest version of this external file. But some of these plugins still use the older version and it should be updated by WPMU.
So is there any possibility that you can make the appropriate fixes in the next release of these plugins? That would be really appreciated.
Feel free to contact me if you need any further information about this.