Forum Replies Created
-
AuthorPosts
-
September 29, 2022 at 6:16 PM in reply to: ✅Please provide example for custom sanitization of nested subgroup fields #38479
Prabakaran Shankar
ParticipantHi, thank you for the above example. Could you please provide example for cloneable? For example, consider 'sub_text1' is the id of cloneable textarea field in the subgroup.
September 28, 2022 at 9:07 AM in reply to: ✅Please provide example for custom sanitization of nested subgroup fields #38445Prabakaran Shankar
ParticipantHi, thank you for the reference.
add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'Multi-level nested groups', 'fields' => [ [ 'id' => 'group', 'type' => 'group', 'sanitize_callback' => 'my_subfield_validation', 'fields' => [ [ 'name' => 'Text', 'id' => 'text', ], [ 'name' => 'Sub group', 'id' => 'sub_group', 'type' => 'group', 'fields' => [ // Normal field (cloned) [ 'name' => 'Sub text1', 'id' => 'sub_text1', 'type'=> 'text', ], [ 'name' => 'Sub text2', 'id' => 'sub_text2', 'type'=> 'textarea', ], ], ], ], ], ], ]; return $meta_boxes; } ); function my_subfield_validation( $value ) { // this is for fields if ( empty( $value['text'] ) ) { $value['text'] = 'Hello World!'; } // this is for sub-group $sub_group = isset($value['sub_group'])? $value['sub_group']:[]; $tags = array(); if(!empty($sub_group)){ $value['sub_group'] = wp_kses($value['sub_group'], $tags); } //above condition results "PHP Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string" return $value; }how to pass sub-group value to sanitize
Prabakaran Shankar
ParticipantHi, it is solved?
I'm also getting the same PHP warning.July 1, 2022 at 12:44 PM in reply to: ✅Geolocation failed to load - how to identify the issue? #36754Prabakaran Shankar
ParticipantHello,
Thank you very much for your immediate support.
Now it is working fine with the help additional map field.
Actually, I don't need to load the map in the frontend. Just showing data stored in the database as text.
But in the frontend it loads 4 (3+1) scripts,1. <script src="https://maps.google.com/maps/api/js?key&libraries=places&ver=5.6.4" id="google-maps-js"></script>
2. <script type="text/javascript" charset="UTF-8" src="https://maps.google.com/maps-api-v3/api/js/49/7/common.js"></script>
3. <script type="text/javascript" charset="UTF-8" src="https://maps.google.com/maps-api-v3/api/js/49/7/util.js"></script>
4. <script src="https://nviewscareer.com/wp-content/plugins/meta-box/js/map-frontend.js" id="rwmb-map-frontend-js" defer=""></script>which leads to a console warning.
warning #1: util.js:240 Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
pv.l @ util.js:240 (anonymous) @ js?key&libraries=places&ver=5.6.4:217 Promise.then (async), (anonymous) @ js?key&libraries=places&ver=5.6.4:217
warning #2: util.js:240 Google Maps JavaScript API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-keyJuly 1, 2022 at 11:43 AM in reply to: ✅Geolocation failed to load - how to identify the issue? #36751Prabakaran Shankar
ParticipantThank you very much for identifying the problem. Please close this ticket.
June 30, 2022 at 1:45 PM in reply to: ✅Geolocation failed to load - how to identify the issue? #36732Prabakaran Shankar
ParticipantPlease check your inbox.
June 27, 2022 at 2:43 PM in reply to: ✅Geolocation failed to load - how to identify the issue? #36681Prabakaran Shankar
ParticipantYes, I checked that the MB Geolocation extension is enabled on the Meta Box > Extensions page. But still the same problem. I even checked it again in the default WordPress theme without other plugins. Still the same problem.
June 22, 2022 at 11:32 AM in reply to: ✅Geolocation failed to load - how to identify the issue? #36626Prabakaran Shankar
ParticipantAny updates Mr. Long.
June 17, 2022 at 12:22 AM in reply to: ✅Geolocation failed to load - how to identify the issue? #36542Prabakaran Shankar
ParticipantThanks for your kind update
Prabakaran Shankar
ParticipantThank you Mr Long, for your kind update. The user registration process is now more convenient.
Prabakaran Shankar
ParticipantHello Mr. Tran, Please consider adding this feature.
Prabakaran Shankar
ParticipantHello Metabox Team,
It would be better to provide this option to set the permalink structure when creating the custom post type. Please think about including this in your future plan. Instead of using an external plugin, native development would provide more optimization and flexibility.
Prabakaran Shankar
ParticipantThanks for your suggestion.
Prabakaran Shankar
ParticipantThank you so much. It is working.
Prabakaran Shankar
ParticipantHello,
I added the shortcode in the function.php/Child theme and used that shortcode in the elements module [Generatepress] for page template.
Group metabox code is below
[ 'name' => __( 'Application Details', 'your-text-domain' ), 'id' => $prefix . 'app_details', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Application Method', 'your-text-domain' ), 'id' => $prefix . 'method', 'type' => 'radio', 'options' => [ 'online' => __( 'Online Application', 'your-text-domain' ), 'email' => __( 'Send Email', 'your-text-domain' ), ], 'required' => true, 'inline' => false, ], [ 'name' => __( 'Url', 'your-text-domain' ), 'id' => $prefix . 'url', 'type' => 'url', 'desc' => __( 'paste the application url', 'your-text-domain' ), 'required' => true, 'visible' => [ 'when' => [['method', '=', 'online']], 'relation' => 'or', ], ], [ 'name' => __( 'Email', 'your-text-domain' ), 'id' => $prefix . 'email', 'type' => 'email', 'desc' => __( 'paste the email address', 'your-text-domain' ), 'required' => true, 'prepend' => 'mailto:', 'visible' => [ 'when' => [['method', '=', 'email']], 'relation' => 'or', ], ], [ 'name' => __( 'Ref No', 'your-text-domain' ), 'id' => $prefix . 'ref_no', 'type' => 'text', 'label_description' => __( 'Job Reference Number or Text given in the Post', 'your-text-domain' ), 'desc' => __( 'Default \'-\'', 'your-text-domain' ), 'required' => true, ], [ 'name' => __( 'Application Procedure', 'your-text-domain' ), 'id' => $prefix . 'procedure', 'type' => 'wysiwyg', 'label_description' => __( 'Paste the content from job advertisement', 'your-text-domain' ), 'desc' => __( 'Default - Basic documents required for the application', 'your-text-domain' ), 'required' => true, ], ], ], -
AuthorPosts