I'm using Bricks and have a few settings page and a couple hundred custom the the entire website. I've been using the theme code to get values from various pages to accomplish various tasks, but no matter what I do I cannot get the theme code to return any values at all from a settings page.
Here's 2 examples of nothing returned from settings page options:
function get_top_bar_cta() {
$group = rwmb_meta( 'header_alpha_settings', [ 'object_type' => 'setting' ], 'easy_settings' );
return $group[ 'top_bar_call_to_action' ] ?? '';
}
- Nothing
function get_header_type_setting() {
$group = rwmb_meta( 'header_alpha_settings', [ 'object_type' => 'setting' ], 'easy_settings' );
return $group[ 'top_bar_call_to_action' ] ?? '';
}
- Nothing
Here's a couple page options:
function get_mini_cta_value() {
$mini_cta = rwmb_the_value( 'mini_cta' );
return $mini_cta;
}
- No problem, returns "
Take your landscaping to the next level with our professional and creative design solutions."
function get_hero_status() {
$hero_sw_status = rwmb_meta( 'quick_settings_options' )[ 'hero_section_on_off' ] ?? 0;
return $hero_sw_status;
}
- No problem, returns 1 (switch position)
Here's the settings page code:
<?php
add_filter( 'mb_settings_pages', 'ru360_easy_settings' );
function ru360_easy_settings( $settings_pages ) {
$settings_pages[] = [
'menu_title' => __( 'RU360 Easy Settings', 'rampup360.com' ),
'id' => 'easy-settings',
'position' => 2,
'class' => 'ru360SettingsPage',
'style' => 'no-boxes',
'columns' => 1,
'tabs' => [
'configure_company_data' => 'Configure Company Data',
'configure_website_settings' => 'Configure Website Settings',
'configure_sidebar_settings' => 'Configure Sidebar Settings',
'configure_module_settings' => 'Configure Module Settings',
'configure_crm_integration' => 'Configure CRM Integration',
'backup_and_restore' => 'Backup & Restore',
],
'tab_style' => 'left',
'submit_button' => __( 'SAVE SETTINGS', 'rampup360.com' ),
'message' => __( 'Your Settings Have Been Saved!', 'rampup360.com' ),
'option_name' => 'easy_settings',
'icon_url' => 'dashicons-admin-generic',
];
return $settings_pages;
}