Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 86 total)
  • Author
    Posts
  • Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi, 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.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi, 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

    in reply to: PHP Warning on edit View #36762
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi, it is solved?
    I'm also getting the same PHP warning.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello,
    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-key

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thank you very much for identifying the problem. Please close this ticket.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Please check your inbox.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Yes, 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.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Any updates Mr. Long.

    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thanks for your kind update

    in reply to: Email confirmation before add user #34564
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thank you Mr Long, for your kind update. The user registration process is now more convenient.

    in reply to: Email confirmation before add user #34560
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello Mr. Tran, Please consider adding this feature.

    in reply to: Permalinks #34130
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello 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.

    in reply to: Save, Preview Button option - Frontend Submission #33881
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thanks for your suggestion.

    in reply to: Assign sub-field value to the variable #33297
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thank you so much. It is working.

    in reply to: Assign sub-field value to the variable #33281
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello,

    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,
                        ],
                    ],
                ],
Viewing 15 posts - 31 through 45 (of 86 total)