Hi,
I’ve 2 problems related to dynamic select list options, trying to add them to the settings of our custom module.
- Fetch options from db, inserted into array and add to options list:
'font_list' => array(
'type' => 'select',
'label' => __('Dynamic Fonts', 'fl-builder'),
'default' => '',
'options' => DBUtils::get_fonts_array(),
),
How is this possible to do it, if say, I need the $wp_query to read from DB?
- In one of the themes function.php files, we have this function:
function get_theme_test_options() {
$styles = array(
'option1' => __( 'Option 1', 'fl-builder' ),
'option2' => __( 'Option 2', 'fl-builder' ),
);
return apply_filters( 'theme_test_options', $styles );
}
But when calling it from the register_module 2nd parameter:
'font_list' => array(
'type' => 'select',
'label' => __('Dynamic Fonts', 'fl-builder'),
'default' => '',
'options' => get_theme_test_options(),
),
I get ‘Call to undefined function theme_test_options’.
This is not our theme, obviously this is a 3rd party. Using require_once will break it, the theme does not use function_exist() on some of the functions.
Any solution?
–
Thanks in advance.