Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 136 through 150 (of 221 total)
  • Author
    Posts
  • in reply to: Backend validation for registration form #35388
    Nicholas CoxNicholas Cox
    Participant

    Hi, did this feature ever get implemented at all?

    in reply to: Share unique ID with render_template and JS asset #34518
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Ok thanks, well I thought about using $attributes['id'] as it would work for my case; as its just for JS function purposes. It would be a useful if there was a way to pass the $attributes['id'] inside Javascript.

    Thanks

    in reply to: MB Block and MB Group Cloning display Issue #34439
    Nicholas CoxNicholas Cox
    Participant

    Hi Long,

    Ah ok, that works now, thanks!!!

    Nick

    in reply to: MB Block and MB Group Cloning display Issue #34394
    Nicholas CoxNicholas Cox
    Participant

    just an update, I have tested the same group field on the front end submission and it displays correctly.

    front-end-form-group-block-working

    So the issue is only in the WordPress Admin Block Editor (seems no css or js is being loaded)

    front-end-form-group-block-working

    in reply to: Prevent Metabox form creating a new post #34364
    Nicholas CoxNicholas Cox
    Participant

    Hi Long,

    Yes that is correct in regards to the save posts (data). I did not want to create a custom form ideally as Metabox already has the functionality and before and after form submission actions. So saves alot of dev work as i may need more forms in the near future.

    I will try the deletion option. Thanks Long!

    in reply to: Prevent Metabox form creating a new post #34332
    Nicholas CoxNicholas Cox
    Participant

    Also if I wanted to prevent the form from creating a new post, can i just force the form to not validate? that way I can send the email and then then return the success message as a error validation?

    no ideal but wondered if there was a better way. I do realise the metabox forms are not for this purpose.

    Nicholas CoxNicholas Cox
    Participant

    Hi

    That would be great thanks! I am at a loss on what the issue is.

    I have sent an email just now via the contact form with admin access and ftp details.

    Thanks

    Nick

    in reply to: Front End Delete and WordPress database error #34307
    Nicholas CoxNicholas Cox
    Participant

    also as a note I have added a check in the following filter for is_admin() which has fixed the bulk delete error message issue for now.

    add_filter( 'pre_delete_post', function( $null, $post, $force_delete ) {
        if( $force_delete == false ) {
            if ( ! is_admin() ) {
                return wp_trash_post( $post->ID );
            }
        }
        return $null;
    }, 10, 3 );
    in reply to: Front End Delete and WordPress database error #34306
    Nicholas CoxNicholas Cox
    Participant

    Hi Long,

    Ok I have added the ('save_field' => false) and the error does not display in the logs anymore. Thanks

    I have made a note to add this in to all forms and a linkback to this thread.

    It would be great if the custom post type trash option would work in the core of Metabox plugin

    Nicholas CoxNicholas Cox
    Participant

    Hi Long,

    ok I have setup a staging website as I do not have a test environment.

    So I have cloned my local setup (no website design yet as I'm just developing)
    https://samsskip.co.uk/stg_155a6/

    with the following shortcode on the homepage
    [mb_frontend_form id="dc-product" confirmation="Your post has been successful" ajax="true"]

    then if you enter the word 'test' into the input field and then retry, the form fails.

    screen recording
    https://drive.google.com/file/d/1iOypa0dYmMin2YMCgyOqSMJI9qfFeKiE/view?usp=sharing

    if you need access to files/login then let me know so I can send you this privately.

    in reply to: Front End Delete and WordPress database error #34274
    Nicholas CoxNicholas Cox
    Participant

    also what i have also found another issue in relation to the following filter.

    add_filter( 'pre_delete_post', function( $null, $post, $force_delete ) {
        if( $force_delete == false ) {
            return wp_trash_post( $post->ID ); 
        }
        return $null;
    }, 10, 3 );

    When you go to bulk delete the custom post type in wp admin area there is an error which displays. The error is 'error in deleting item'. But you can delete them one by one.
    video here...
    https://drive.google.com/file/d/1AXFUcDvjz-5cGE84USvEWHCCVEu77thI/view?usp=sharing

    if I disable the filter above and then the bulk delete feature works.

    in reply to: Front End Delete and WordPress database error #34273
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Ok i have removed the post_title field and can confirm that there is no error upon deletion.

    So I have to create a duplicate database column to fix this issue? I just assumed that the post_title was automatically being populated in the post table.

    Nicholas CoxNicholas Cox
    Participant

    I have done some screen recordings for you

    If the form fails validation and then you resubmit the form, the invalid error message displays.

    https://drive.google.com/file/d/1L6QiqZkXKsl70IdC_ajPM4TOk3mDXHxR/view?usp=sharing

    If there are no validation errors the first time, the same form submits successfully.

    https://drive.google.com/file/d/1moTAPLOdVy0X81NnXiqaOdgoIGr5Xjxe/view?usp=sharing

    also to note, this does not happen when ajax is not enabled; as I assume the page refresh has something to do with it.

    Nicholas CoxNicholas Cox
    Participant

    Ok I have checked the form and can confirm that I can see the mbfs_key.

    mbfs-key

    The form does process successfully if there are no validation errors. The error message only displays if you try to re-sumbit the same form after a first unsuccessful validation (with ajax).

    Hope this helps

    in reply to: Front End Delete and WordPress database error #34241
    Nicholas CoxNicholas Cox
    Participant

    Hi Long,

    sure, here is my code. Do you need anything else?

    
    add_filter( 'rwmb_meta_boxes', 'dc_product_register_meta_boxes' );
    
    function dc_product_register_meta_boxes( $meta_boxes ) {
        
        global $wpdb;
    
        $meta_boxes[] = [
            'title'   => 'Products',
            'post_types' => 'product',
            'storage_type' => 'custom_table', 
            'table'        => $wpdb->prefix . 'dc_products', 
            'id'      => 'dc-product',
            'context' => 'normal',
            'fields'  => [
                [
                    'type'  => 'select',
                    'name'  => 'Type',
                    'id'    => 'type',
                    'options' => array(
                        'Gift' => 'Gift',
                        'Ask' => 'Ask',
                    ),
                    'multiple' => false,
                    'placeholder' => "",
                    'select_all_none' => false,
                    'required' => true,
                ],
                [
                    'type'  => 'text',
                    'name'  => 'Title', 
                    'id'    => 'post_title',
                    'class' => 'dc-post-title',
                    'limit' => 50, 
                    'required' => true,
                ],
                [
                    'type'  => 'textarea',
                    'name'  => 'Description',
                    'id'    => 'description', 
                    'required' => true,
                ],
                [
                    'type'      => 'dc_flatpickr_calendar',
                    'name'      => 'End Date (optional)', 
                    'id'        => 'end_date', 
                    'attributes' => [ //my custom attributes
                        'altInput'    => true,
                        'altFormat'   => 'd-m-Y H:i',
                        'inline'          => false,
                        'allowInput'  => false,
                        'disableMobile' => false,
                        'minDate'         => 'today',
                        'enableTime'  => true,
                        'time_24hr'   => false,
                        'enableSeconds' => false,
                        'defaultHour'     => 0,
                    ],
                ],
                [
                    'type'  => 'select',
                    'name'  => 'Condition',
                    'id'    => 'condition', 
                    'options' => array(
                        'used' => 'Used',
                        'like new' => 'Like New',
                        'new' => 'New',
                    ),
                    'multiple' => false,
                    'placeholder' => "",
                    'select_all_none' => false,
                    'required' => true,
                ],
                [
                    'type'  => 'select',
                    'name'  => 'Location',
                    'id'    => 'location', 
                    'options' => array(
                        'Hucknall' => 'Hucknall',
                    ),
                    'multiple' => false,
                    'placeholder' => "",
                    'select_all_none' => false,
                    'required' => true,
                ],
                [
                    'type'    => 'dc_image_to_base64', 
                    'name'    => 'Images', 
                    'id'      => 'images', 
                    'attributes' => [ 
                        'max'  => 6, //max of 10 files
                        'buttonlabel'  => 'upload',
                        'maxWidth'  => 300, //px
                        'maxHeight' => 300, //px
                        'description' => '(drag to reorder)', 
                        //'maxFileSize'  => 8000000', //default wp upload size
                    ],
                    'saveToCustomFolder' => [ 
                        'enabled'  => true, //enable folder save (default false)
                        'folder'  => 'products', //foldername no slashes
                        'deleteOnUpdate'  => true, //force deletetion
                    ],
                    'required' => true,
                ],
            ],
        ];
    
        return $meta_boxes;
    }
    
Viewing 15 posts - 136 through 150 (of 221 total)