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

Disable bloganuary #97136

Merged
merged 2 commits into from
Dec 6, 2024
Merged
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
7 changes: 7 additions & 0 deletions client/data/blogging-prompt/is-bloganuary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ import moment from 'moment';
* @returns true if bloganuary mode is active
*/
export default function isBloganuary() {
// Disable for January 2025 and beyond (see https://wp.me/p5uIfZ-gxX).
// Intentionally redundant to make it easier to spot the disable condition,
// and avoid removing code we may re-enable in the future.
const BLOGANUARY_ENABLED = false;
if ( ! BLOGANUARY_ENABLED ) {
return false;
}
Comment on lines +10 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use return false here? ..... alternatively we can use moment and if the year is 2025 then return false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could return false, but then I'd need to rip out most of the code here (which the issue asked that we not do). I wanted to make it clearer that this was intentional and preserve the current return logic.

We could check for 2025, but I'm worried we'll forget to disable it for 2026. 😂

return moment().format( 'MM' ) === '01' || isEnabled( 'bloganuary' );
}
Loading