Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions themes/osi/assets/css/editor-style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/osi/assets/css/editor-style.css.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions themes/osi/assets/scss/_7_vendor.plugins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ form.wp-block-jetpack-contact-form {
.single-event .entry-header .wp-block-cover {
aspect-ratio: 16 / 9;
min-height: auto;
}

/* Hide Events Manager Honeypot phone field */
p.input-group.input-text.em-input-text.input-field-phone_hp {
display: none!important;
}
22 changes: 22 additions & 0 deletions themes/osi/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,25 @@ function osi_ssp_register_post_type_args( array $args ): array {
return $args;
}
add_filter( 'ssp_register_post_type_args', 'osi_ssp_register_post_type_args', 10, 1 );


/**
* Block booking if honeypot phone field is filled.
* Phone field is hidden using CSS.
* Field must have the slug 'phone_hp', and must be a text input.
*
* @param boolean $result The result.
* @param EM_Booking $em_booking The booking object.
*
* @return boolean The result.
*/
function osi_block_booking_if_phone_filled( $result, $em_booking ) {
if ( ! empty( $em_booking->event ) ) {
if ( isset( $_POST['phone_hp'] ) && trim( $_POST['phone_hp'] ) !== '' ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
$em_booking->add_error( 'There was a problem with your booking. Please do not include a phone number.' );
return false;
}
}
return $result;
}
add_filter( 'em_booking_validate', 'osi_block_booking_if_phone_filled', 10, 2 );
5 changes: 5 additions & 0 deletions themes/osi/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/osi/style.css.map

Large diffs are not rendered by default.

Loading