Hello Jeff,
Thanks for reaching out.
I see that there are some issues in your code and they are not related to the way to get the field value on a settings page.
1. If enable_site_commenting
is the field ID and website-info
is the option name (not the settings page ID), you need to remove the $
character.
2. No brackets in the if
statement.
3. Use an assignment variable instead of comparison operator
$site_commenting_value = rwmb_meta( 'enable_site_commenting', ['object_type' => 'setting'], 'website-info' );
if ( $site_commenting_value == 'Enabled' ) {
RUN_THIS_CODE
}
If you are not able to complete the task, we offer a customization service with an extra fee. Please contact us here for more details https://metabox.io/contact/