State/province

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16542

    Is there any way to change the state/province placeholder to region/county?

    Many thanks

    Alex Steer
    #16551

    Hi Alex,

    Yes, as of 1.10.0 you can do the following:

    add_action( 'eventorganiser_get_event_booking_form', 'my_set_address_labels', 10, 2 );
    function my_set_address_labels( $form, $event_id ){
    
        $labels = array(
            'street-address' => __( 'Street Address', 'eventorganiserp' ),
            '2nd-line'       => __( 'Address Line 2', 'eventorganiserp' ),
            'city'           => __( 'City', 'eventorganiserp' ),
            'state'          => __( 'Region/County', 'eventorganiserp' ),
            'postcode'       => __( 'Postcode', 'eventorganiserp' ),
            'country'        => __( 'Country', 'eventorganiserp' ),
        );
    
        $elements = $form->flatten_elements();
    
        foreach( $elements as $element ){
            if( 'address' == $element->type ){
                $element->set( 'subfield_labels', $labels );
            }
        }
    }
    

    to change the labels. To change the placeholder you’d need to edit the template (eo-booking-form-address.php in event-organiser-pro/templates/booking-form/)

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.