Warning After Install of Multisite Shared Menus
-
I installed Multisite Shared Menus and all works well on main domain and six of my seven sub-domains, but on my Dating Service, when a logged in member clicks on “Members” we get a list of about 20 lines of the same warning as follows:
Warning: in_array() expects parameter 2 to be array, null given in /plugins/buddypress/bp-core/bp-core-filters.php on line 199
I am using WP 4.8, BP 2.8.2, GeneratePress Child Theme, but the issue is also there using Twenty-Sixteen
I have deleted BP and reinstalled but it didn’t help. Can you give me some idea of how I might fix this problem please.
-
The warning is referring to a line in
bp_core_menu_highlight_parent_page()
. The function adds CSS classes to the page. This is hackish but you could try this until you find a better solution.add_action( 'init', function() { remove_filter( 'page_css_class', 'bp_core_menu_highlight_parent_page', 10, 2 ); } );
Also you shouldn’t have
WP_DEBUG
set totrue
on your live site. Better to have a development site parallel your production site and useWP_DEBUG
in that environment.Thank you for your response. I tried adding it to the bp-core-filters.php file but it didn’t help. I also tried adding it as an mu-plugin, and also in my child-theme functions.php file, but none of them fixed the problem.
Where exactly should I be adding this code please.
Thanks!I hadn’t actually tested so it may be that the snippet doesn’t work. bp-custom.php is where it should go. You could try hooking to
wp
instead ofinit
.Thank you. I put the code in bp-custom.php but it didn’t work.
I don’t know how to hook to wp instead of init.
In the code snippet I posted, try replacing
init
withwp
. If that doesn’t work then the problem would need some debugging.Thank you but it still doesn’t work. I appreciate you trying though. Thank you again.
It might be worth messaging the Multisite Shared Menu author. If the plugin is causing PHP notices then likely the author will want to clean those up.
Thank you. I wrote to the support forums several days ago but nobody has replied. I will try to find the author.
You could try opening an issue here:
Thank you so much Henry. I have done as you suggest. Much appreciated!
- You must be logged in to reply to this topic.