Skip to content

Commit 7b55d2f

Browse files
authored
Merge pull request #82 from OpenSourceOrg/add/39-event-manager-updates
Event manager updates
2 parents 9690d86 + 4fb9491 commit 7b55d2f

7 files changed

Lines changed: 230 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mu-plugins/*
2020
!mu-plugins/osi-event-list
2121
!mu-plugins/osi-sponsors-list
2222
!websub-compat.php
23+
!mu-plugins/osi-events-manager-tweaks
2324

2425
themes/*
2526
!themes/osi
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* Plugin Name: OSI Events Manager Tweaks
4+
* Description: Customizations for the Events Manager plugin.
5+
* Version: 1.0.0
6+
* Author: WordPress.com Special Projects
7+
* Author URI: https://wpspecialprojects.wordpress.com/
8+
*/
9+
10+
/**
11+
* Remove the event time zone if the event is all day.
12+
*
13+
* @param string $replace The string to replace.
14+
* @param EM_Event $EM_Event The event object.
15+
* @param string $full_result The full result.
16+
* @param string $target The target.
17+
* @param array $placeholder_atts The placeholder attributes.
18+
*
19+
* @return string
20+
*/
21+
function osi_em_event_output_placeholder( $replace, $EM_Event, $full_result, $target, $placeholder_atts ) {
22+
if ( '#_EVENTTIMEZONE' === $full_result ) {
23+
$event_times = $EM_Event->output('#_EVENTTIMES');
24+
if ( 'All Day' === $event_times ) {
25+
$replace = '';
26+
}
27+
}
28+
return $replace;
29+
}
30+
add_filter('em_event_output_placeholder', 'osi_em_event_output_placeholder', 10, 5);
31+
32+
/**
33+
* Display "Free" for events with a price of 0.00.
34+
*
35+
* @param string $formatted_price The formatted price.
36+
* @param string $price The price.
37+
* @param string $currency The currency.
38+
* @param string $format The format.
39+
* @return void
40+
*/
41+
function osi_format_event_manager_price( $formatted_price, $price, $currency, $format ) {
42+
if( 0.00 === (float)$price ) {
43+
$formatted_price = 'Free';
44+
}
45+
46+
return $formatted_price;
47+
}
48+
add_filter('em_get_currency_formatted', 'osi_format_event_manager_price', 10, 4 );

themes/osi/assets/css/editor-style.css

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/css/editor-style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/scss/_7_vendor.plugins.scss

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,67 @@ form.wp-block-jetpack-contact-form {
5353
.wp-block-coblocks-posts__item {
5454
margin-bottom: 2.5em;
5555
}
56+
57+
/*
58+
* Events Manager
59+
* - Booking's Submit Button
60+
* -- Feels very nasty, but I had to add !important, as the plugin's CSS is also using !important!
61+
* - Mobile Styling
62+
*/
63+
64+
.em-booking-form-section-confirm .em-booking-form-buttons input[type=submit].em-form-submit {
65+
color: var(--wp--custom--button--color--text) !important;
66+
background-color: var(--wp--custom--button--color--background) !important;
67+
border: var(--wp--custom--button--border--width) var(--wp--custom--button--border--style) var(--wp--custom--button--border--color) !important;
68+
border-radius: var(--wp--custom--button--border--radius) !important;
69+
display: inline-block !important;
70+
font-family: var(--wp--custom--button--typography--font-family) !important;
71+
font-size: var(--wp--custom--button--typography--font-size) !important;
72+
-webkit-font-smoothing: auto !important;
73+
font-weight: var(--wp--custom--button--typography--font-weight) !important;
74+
height: auto !important;
75+
padding: var(--wp--custom--button--spacing--padding--top) var(--wp--custom--button--spacing--padding--right) var(--wp--custom--button--spacing--padding--bottom) var(--wp--custom--button--spacing--padding--left) !important;
76+
text-decoration: none !important;
77+
transition: all 0.3s !important;
78+
width: auto !important;
79+
80+
&:hover, &:focus {
81+
background-color: var(--wp--custom--button--hover--color--background) !important;
82+
border-color: var(--wp--custom--button--hover--border--color) !important;
83+
border-width: var(--wp--custom--button--border--width) !important;
84+
color: var(--wp--custom--button--hover--color--text) !important;
85+
text-decoration: none !important;
86+
transition: all 0.3s !important;
87+
}
88+
}
89+
90+
/* Specific styling for mobile devices */
91+
@media only screen and (max-width: 768px) {
92+
93+
.header-main-small {
94+
display: block !important;
95+
}
96+
97+
/* Adjust featured image size on mobile devices */
98+
.single-event .wp-block-cover__image-background {
99+
width: 100%;
100+
height: auto;
101+
object-fit: cover;
102+
}
103+
104+
/* Ensure the cover container does not add extra padding or margins */
105+
.single-event .entry-header .wp-block-cover.alignfull {
106+
padding: 0;
107+
}
108+
}
109+
110+
/* Ensures the small header is hidden on larger screens */
111+
.header-main-small {
112+
display: none;
113+
}
114+
115+
/* Adjust the aspect ratio of the cover image */
116+
.single-event .entry-header .wp-block-cover {
117+
aspect-ratio: 16 / 9;
118+
min-height: auto;
119+
}

themes/osi/style.css

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)