is_multisite() via 'show_on_cb'
-
Hi.
I’m trying to get an individual meta field to display if an installation is multisite enabled using the function
is_multisite()
.It doesn’t seem to be working for some reason, and my field is showing regardless. Here is the code:
$cmb->add_field( array( 'name' => __( 'Global Welcome Message', 'cm_lang' ), 'desc' => __( 'This will act as the default Welcome Message (displayed on each site\'s homepage). This can be overridden by adding a Welcome Message on an individual site\'s Site Options.', 'cm_lang' ), 'id' => 'global_welcome_message', 'type' => 'wysiwyg', 'show_on_cb' => cmb_is_multisite() ) );
And the callback function:
function cmb_is_multisite() { if ( is_multisite() ) { return true; } }
I wrote the callback function since using plain
is_multisite()
didn’t work.Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘is_multisite() via 'show_on_cb'’ is closed to new replies.