Skip to content

Commit 5681be4

Browse files
committed
Merge branch 'main' into add/donation-widget-license-pages-main
2 parents c42749a + e85f0c7 commit 5681be4

25 files changed

Lines changed: 570 additions & 277 deletions

.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: 53 additions & 1 deletion
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.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array(), 'version' => '1a77530059955fb6eaa5');
1+
<?php return array('dependencies' => array(), 'version' => '48775f60a0024fbe4d0a');

themes/osi/assets/js/build/theme.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
document.addEventListener('DOMContentLoaded', function () {
2+
// Select the discource div with the class 'wpdc-join-discussion'
3+
const discussionDiv = document.querySelector('.wpdc-join-discussion');
4+
5+
// Check if the element exists
6+
if (discussionDiv) {
7+
const heading = document.createElement('h3');
8+
heading.classList.add('wp-block-heading');
9+
heading.textContent = 'Join the discussion on Discourse!';
10+
discussionDiv.insertBefore(heading, discussionDiv.firstChild);
11+
}
12+
});

themes/osi/assets/js/src/theme/theme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ import './sidebar-nav.js';
99
import './skip-link-focus-fix.js';
1010
import './search-toggle.js';
1111
import './license-header-wrap.js';
12+
import './discourse.js';

themes/osi/assets/scss/_6_components.comments.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,23 @@
111111
width: calc(100% - 5rem);
112112
}
113113
}
114+
115+
/* Discourse comments link */
116+
.wpdc-join-discussion {
117+
max-width: 730px;
118+
background-color: #f2f3f2;
119+
border: 1px solid #3ea638;
120+
padding: 24px;
121+
margin-left: 32px;
122+
margin-right: 32px;
123+
}
124+
125+
@media only screen and (min-width: 782px) {
126+
.wpdc-join-discussion {
127+
margin-left: 48px;
128+
}
129+
}
130+
131+
.wpdc-join-discussion h3 {
132+
font-weight: 700;
133+
}

0 commit comments

Comments
 (0)