Editing default value of dropdown menu in PHP

enter image description here

I am currently trying to edit a view in the backend of a wordpress install I have. I am using a plugin called Bookly, it presents a drop down box with a list of values to select from. It gets this information from the DB.

Here is image for you to see what it looks like at the moment.

I want to change the default value from Employee to Reliever, but continue pulling from the Employee DB.

This is what the code looks like for this drop down mean.

<div class="form-group">
    <select class="form-control bookly-js-chosen-select" id="bookly-filter-staff" data-placeholder="<?php echo esc_attr( BooklyLibUtilsCommon::getTranslatedOption( 'bookly_l10n_label_employee' ) ) ?>">
        <option value="-1"></option>
             <?php foreach ( $staff_members as $staff ) : ?>
                    <option value="<?php echo $staff['id'] ?>"><?php esc_html_e( $staff['full_name'] ) ?></option>
             <?php endforeach ?>

I under stand the for loop however I am not sure how to change so that it shows “Reliever” instead of “Employee”.

Any help would be greatly appreciated.

Read more here: Editing default value of dropdown menu in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *