Error wordpress plugin, ie blank field in array

Asked

Viewed 36 times

0

good night! I’m developing a website for a restaurant and in it I installed a desktop reservation systems plugin, called (https://br.wordpress.org/plugins/restaurant-reservations/)

The following happens, when I raise the site by hosting the time field, 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 have touched 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',
                ),
            ),
        ),
    );

removed, but when I try to make the request the system asked to add the time, how do I fix this ? Image with error: http://prntscr.com/jtgc83

This link, it informs exactly my problem, but I can’t do it, see

2 answers

1


Hello! I contacted the plugin developer and he himself helped solve the problem. He 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): https://gist.github.com/NateWr/9068c5d12ef458eb40ca 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.

He says that to hide the schedule, you need to lower the .php and add it in the /wp-content/plugins directory/ and thus activate it.

Thanks for your help Felipe! Problem solved!

  • Success! was this same link I had seen hahaha

0

From what I understand you want to remove the schedule. 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 believe you have to install the plugin again and add this to your functions.php that you should solve.

  • Hello, I will test and if it works I return...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.