Hi, I have a simple settings page with the following setup:
add_filter( 'mb_settings_pages', 'limit_settings_code' );
function limit_settings_code( $settings_pages ) {
$settings_pages[] = [
'menu_title' => __( 'Limit Settings', 'bbcm' ),
'option_name' => 'Limit Settings',
'position' => 25,
'style' => 'no-boxes',
'columns' => 1,
'icon_url' => 'dashicons-welcome-widgets-menus',
];
return $settings_pages;
}
add_filter( 'rwmb_meta_boxes', 'credit_limit_code' );
function credit_limit_code( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'Credit Limit', 'bbcm' ),
'id' => 'credit_limit',
'settings_pages' => ['limit_settings'],
'fields' => [
[
'name' => __( 'Credit Limit Amount', 'bbcm' ),
'id' => $prefix . 'credit_limit_amount',
'type' => 'text',
'required' => true,
'columns' => 4,
],
],
];
return $meta_boxes;
}
=================
With the code above, I want to get the value of the settings in function.php but rwmb_meta() return null.
According to this page, https://support.metabox.io/topic/code-not-working-with-updated-version/
I also tried get_option():
$test1 = get_option( 'limit_settings' )['credit_limit_amount'];
$test1 is still null.
WordPress v5.9
Meta Box v5.5.1
Meta Box AIO v1.15.5
Please help.