Wordpress plugin error, ie blank field in array

0

Good evening! I'm developing a website for a restaurant, and I've installed a table-top booking plugin, called ( link )

The following happens, when I upload the site by hosting the time field, it does not work, it goes blank; even reinstalling the plugin it goes blank, I read in the developer's github that other plugins can affect the time and I would like to remove the time

The problem of removing is that I moved the part of the array

* See /includes/template-functions.php
     */
    $fields = array(

        // Reservation details fieldset
        'reservation'   => array(
            'legend'    => __( 'Preencha todos os campos', 'restaurant-reservations' ),
            'fields'    => array(
                'date'      => array(
                    'title'         => __( 'Data da reserva', 'restaurant-reservations' ),
                    'request_input' => empty( $request->request_date ) ? '' : $request->request_date,
                    'callback'      => 'rtb_print_form_text_field',
                    'required'      => true,
                ),
                'time'      => array(
                    'title'         => __( 'Horário da reserva', 'restaurant-reservations' ),
                    'request_input' => empty( $request->request_time ) ? '' : $request->request_time,
                    'callback'      => 'rtb_print_form_text_field',
                    'required'      => true,
                ),
                'party'     => array(
                    'title'         => __( 'Pessoas', 'restaurant-reservations' ),
                    'request_input' => empty( $request->party ) ? '' : $request->party,
                    'callback'      => 'rtb_print_form_select_field',
                    'callback_args' => array(
                        'options'   => $this->get_form_party_options(),
                    ),
                    'required'      => true,
                ),
            ),
        ),

        // Contact details fieldset
        'contact'   => array(
            'legend'    => __( 'Detalhes de Contato', 'restaurant-reservations' ),
            'fields'    => array(
                'name'      => array(
                    'title'         => __( 'Nome Completo', 'restaurant-reservations' ),
                    'request_input' => empty( $request->name ) ? '' : $request->name,
                    'callback'      => 'rtb_print_form_text_field',
                    'required'      => true,
                ),
                'email'     => array(
                    'title'         => __( 'Email Válido', 'restaurant-reservations' ),
                    'request_input' => empty( $request->email ) ? '' : $request->email,
                    'callback'      => 'rtb_print_form_text_field',
                    'callback_args' => array(
                        'input_type'    => 'email',
                    ),
                    'required'      => true,
                ),
                'phone'     => array(
                    'title'         => __( 'Telefone', 'restaurant-reservations' ),
                    'request_input' => empty( $request->phone ) ? '' : $request->phone,
                    'callback'      => 'rtb_print_form_text_field',
                    'callback_args' => array(
                        'input_type'    => 'tel',
                    ),
                ),
                'add-message'   => array(
                    'title'     => __( 'Adicionar Mensagem', 'restaurant-reservations' ),
                    'request_input' => '',
                    'callback'  => 'rtb_print_form_message_link',
                ),
                'message'       => array(
                    'title'         => __( 'Mensagem', 'restaurant-reservations' ),
                    'request_input' => empty( $request->message ) ? '' : $request->message,
                    'callback'      => 'rtb_print_form_textarea_field',
                ),
            ),
        ),
    );

I removed it, but when I try to make the request the system asked me to add the time, how do I fix it ? Image with error: link

This link, it informs exactly my problem, but I can not do this, see

    
asked by anonymous 11.06.2018 / 03:24

2 answers

1

Hello! I contacted the plugin developer and he even helped to solve the problem. It says:

  

Hi Demetrius,   The following is a tiny little plugin that will hide the time field in the booking form (all bookings will be set for 12pm):    link   To use it, click the Download button at the top, unpack the .zip file, and upload the .php file to your / wp-content / plugins / directory. You can then activate it from the Plugins screen in your WordPress admin area.

It says that to hide the time, you need to download .php and add it to the / wp-content / plugins / directory and activate it.

Thanks for the help Felipe! Problem solved!

    
12.06.2018 / 20:34
0

From what I understand you want to remove the time. I found here in his documentation the following:

// Adicionar no seu functions.php
add_filter( 'rtb_booking_form_fields', 'rtbht_hide_time', 10, 2 );
function rtbht_hide_time( $fields, $request ) {
    $fields['reservation']['fields']['time']['callback'] = function() {
        echo '<input type="hidden" name="rtb-time" value="12:00 PM">';
    };
    return $fields;
}

I think you have to install the plugin again and add it to your functions.php that you should solve.

    
12.06.2018 / 01:01