-
vidyutdev
I tried showing option page data like email id, phone etc (created using JetEngine0 using GB Pro. But it can’t fetch.
Is there anything im missing?
thanks…)
-
Alvind
Hi there,
You may need to add the JetEngine option fields to the allowed list.
Could you try the snippet provided in this topic and see if it works for your setup?
https://generate.support/topic/fetching-dynamic-data-from-options-page/#post-174828
-
vidyutdev
No not worked…
-
What is the exact code you are using? And how did you add the code?
-
vidyutdev
Here is the code
add_filter('generateblocks_dynamic_tags_allowed_options', function($allowed_options) { $allowed_options[] = 'email_id'; return $allowed_options; });
Added the code inside snippet plugin…
-
Alvind
Could you check the exact option key name that JetEngine stores in the
wp_optionstable?Sometimes a plugin doesn’t use the exact field name configured in its settings. For example, even if the field is named
email_id, the plugin may store it with a custom prefix or under a different option key.I’m not sure how JetEngine handles this, so you’ll need to check the database or confirm the actual option key with their support team.
-
vidyutdev
Hi, so yes it is stored with `option page name’
business-info_email_id
I tried with new codes but it’s weird some fields working and some not..
-
Alvind
I tried with new codes but it’s weird some fields working and some not..
Have you included the names of the other fields in the snippet as well?
-
vidyutdev
Yes I did.. I added the fields in the snippet.
The tried fetching with GB but not working..
-
George
Hi,
The reason some fields work and others don’t comes down to how JetEngine stores an options page. Rather than saving each field as its own row in the
wp_optionstable, JetEngine saves the whole options page as a single array under one option key (in your casebusiness-info, containingemail_id,phone, and so on). Any field that happens to be stored as its own top-level option resolves fine through the allowed-options filter, but GB can’t reach a value nested inside that array — which is what you’re seeing.To pull a nested field you’ll need a custom dynamic tag that reads the option array and returns the specific key. Here’s a working example you can adapt:
add_action( 'init', function () { if ( ! class_exists( 'GenerateBlocks_Register_Dynamic_Tag' ) ) { return; } new GenerateBlocks_Register_Dynamic_Tag( [ 'title' => 'Option Page Field', 'tag' => 'option_page_field', 'type' => 'option', 'supports' => [ 'multiple' ], 'return' => function ( $options, $block, $instance ) { $group = $options['group'] ?? ''; $field = $options['field'] ?? ''; if ( ! $group || ! $field ) { return ''; } $data = get_option( $group ); if ( ! is_array( $data ) || ! isset( $data[ $field ] ) ) { return ''; } $value = $data[ $field ]; return is_scalar( $value ) ? (string) $value : ''; }, ] ); } );Use it in a GB block like this, with the option key as
groupand the field name asfield:{{option_page_field group:business-info|field:email_id}} -
vidyutdev
thanks, i noticed there is an option on jetengine to store separately instead of arrays. So i turned it on. And working.
Thanks
-
George
Ok, no problem!
-
George
Hello,
Don’t you see GenerateBlocks Forms in the backend?

- You must be logged in to reply to this topic.