Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support forums holiday mode #461

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ public function topic_pre_extras( $forum_id ) {
return;
}

if ( defined( 'WPORG_HOLIDAY_MODE' ) && WPORG_HOLIDAY_MODE ) {
bbp_add_error( 'bbp_wporg_holiday_mode', sprintf(
__( '<strong>Error</strong>: Reviews are unavailable. Please check back after the <a href="%s">holiday break</a>.', 'wporg-forums' ),
'https://wordpress.org/news/2024/12/holiday-break/'
) );
return;
}

$topic_content = false;
if ( ! empty( $_POST['bbp_topic_content'] ) ) {
// Apply the new-topic pre-content filters. This allows for various forum hooks to remove links.
Expand All @@ -337,7 +345,7 @@ public function topic_pre_extras( $forum_id ) {
false !== stripos( $topic_content, 'http://' )
)
) {
// Send this review to pending after it gets published.
// Send this review to pending after it gets published.
setcookie( 'wporg_review_to_pending', 'links_blocked', time() + HOUR_IN_SECONDS, '/support/', 'wordpress.org', true, true );

bbp_add_error(
Expand Down Expand Up @@ -495,6 +503,16 @@ public function add_topic_form_stars() {
return;
}

if ( defined( 'WPORG_HOLIDAY_MODE' ) && WPORG_HOLIDAY_MODE ) {
echo '<div class="bbp-template-notice error">';
printf(
__( 'Reviews are unavailable. Please check back after the <a href="%s">holiday break</a>.', 'wporg-forums' ),
'https://wordpress.org/news/2024/12/holiday-break/'
);
echo '</div>';
return;
}

printf(
'<label for="rating">%s</label>',
__( 'Your Rating:', 'wporg-forums' )
Expand Down Expand Up @@ -527,7 +545,7 @@ public function feed_prepend_rating( $content, $topic_id ) {
$content = sprintf(
"<p>%s</p>\n%s",
sprintf(
__( 'Rating: %s', 'wporg-forums' ),
__( 'Rating: %s', 'wporg-forums' ),
sprintf(
_n( '%s star', '%s stars', $rating, 'wporg-forums' ),
$rating
Expand Down