Thread Starter
keyra
(@keyra)
Hi, thanks for the feedback. I tried to improve compatibility based on your helpful description. However, I don’t have a multisite install for development yet, so it’s untested. Please let me know if your encounter any other issue.
Thread Starter
keyra
(@keyra)
Last changes corrected PHP notices in the multisite dashboard under “Network Admin”, but broke the plugin’s added menu item for any site.
The plugin’s page that is supposed to be added under “Settings” (“Custom Content”) is missing.
There’s now a notice displayed on any page of sites mentioning:
Notice: Undefined index: settings_page_hook
Count: 3
Location: wp-content/plugins/custom-content-shortcode/includes/docs/docs.php:114
If I try to go directly to the page under:
wp-admin/options-general.php?page=ccs_reference
I get: You do not have sufficient permissions to access this page.
Thread Starter
keyra
(@keyra)
I don’t have a single WordPress site available to test it, but I corrected it on my multisite by doing these changes to includes\docs\docs.php on the current version :
delete line 23: $admin_menu_hook = ! is_multisite() ? ‘admin_menu’ : ‘network_admin_menu’;
Change line 24 to: add_action(‘admin_menu’, array($this, ‘content_settings_create_menu’));
Replace line 125 to 141 with:
function plugin_settings_link( $links ) {
$settings_link = ‘<a href=”‘ .
admin_url( ‘admin.php?page=’.self::$state[‘settings_page_name’] ) . ‘”>’
. ‘Reference’;
array_unshift( $links, $settings_link );
return $links;
}
Remove line 150-151:
if (!isset(self::$state[‘overview_page_hook’]))
self::$state[‘overview_page_hook’] = ”;
Add this above line 153: if(!is_network_admin())
Add this above line 632: if(!is_network_admin())
Thread Starter
keyra
(@keyra)
Forgot to mention that these changes remove all notices (both under the “Network Admin” and sites) and makes the page under “Settings”->”Custom content” work on sites.
It would need to be tested on a single site setup more thoroughly though.
I really love your plugin Eliot and it’s a real life-saver for me. 🙂
Thank you again for the helpful comment. I made the changes as you described. I finally got a multisite install set up, so I’ll test it out and keeping improving compatibility.
Thread Starter
keyra
(@keyra)