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

Install wporg-parent-2021 and Events child theme #1013

Merged
merged 5 commits into from
Aug 22, 2023
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
2 changes: 1 addition & 1 deletion .docker/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
define( 'BLOG_ID_CURRENT_SITE', EVENTS_ROOT_BLOG_ID );
define( 'DOMAIN_CURRENT_SITE', 'events.wordpress.test' );
define( 'SUBDOMAIN_INSTALL', false );
define( 'NOBLOGREDIRECT', 'https://events.wordpress.test' );
// NOBLOGREDIRECT is intentionally omitted so that the 404 template works.
define( 'CLI_HOSTNAME_OVERRIDE', 'events.wordpress.test' );
break;

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ public_html/wp-content/themes/twentytwenty
public_html/wp-content/themes/twentytwentyone
public_html/wp-content/themes/twentytwentytwo
public_html/wp-content/themes/twentytwentythree
public_html/wp-content/themes/wporg-parent-2021
18 changes: 16 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,21 @@
"_comment": "Work around `test:watch` timeout, see https://github.com/spatie/phpunit-watcher/issues/63#issuecomment-545633709",
"process-timeout": 0,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
}
},
"extra": {
"installer-paths": {
"public_html/wp-content/themes/{$name}": ["wporg/wporg-parent-2021"]
}
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:WordPress/wporg-parent-2021.git"
}
],
"require": {
"adhocore/jwt": "^1.0"
},
Expand All @@ -27,7 +39,9 @@
"phpunit/phpunit": "^9",
"sirbrillig/phpcs-changed": "2.10.0",
"spatie/phpunit-watcher": "^1.23",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"wporg/wporg-parent-2021": "dev-build",
"composer/installers": "^2.2"
},
"scripts": {
"format": "phpcbf -p",
Expand Down
172 changes: 170 additions & 2 deletions composer.lock

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

16 changes: 9 additions & 7 deletions public_html/wp-content/mu-plugins/events/redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
* Redirects the root URL of the "events.wordpress.org" to "https://make.wordpress.org/community/events".
*/
function redirect_to_make_community() {
if ( wp_using_themes() && ! defined( 'REST_REQUEST' ) ) {
$request_uri = $_SERVER['REQUEST_URI'];
if ( ! wp_using_themes() || defined( 'REST_REQUEST' ) || current_user_can( 'switch_themes' ) ) {
return;
}

$request_uri = $_SERVER['REQUEST_URI'];

if ( '/' === $request_uri ) {
$new_url = 'https://make.wordpress.org/community/events/';
wp_redirect( $new_url );
exit;
}
if ( '/' === $request_uri ) {
$new_url = 'https://make.wordpress.org/community/events/';
wp_redirect( $new_url );
exit;
}
}
3 changes: 3 additions & 0 deletions public_html/wp-content/mu-plugins/load-other-mu-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ function wcorg_include_common_plugins() {
function wcorg_include_network_only_plugins() {
if ( EVENTS_NETWORK_ID === SITE_ID_CURRENT_SITE ) {
$network_folder = 'events';

require_once dirname( __DIR__ ) . '/mu-plugins-private/wporg-mu-plugins/pub-sync/loader.php';

} else {
$network_folder = 'wordcamp';
}
Expand Down
21 changes: 21 additions & 0 deletions public_html/wp-content/themes/wporg-events-2023/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace WordPressdotorg\Events_2023;

defined( 'WPINC' ) || die();


add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );


/**
* Enqueue scripts and styles.
*/
function enqueue_assets() {
wp_enqueue_style(
'wporg-events-2023-style',
get_stylesheet_uri(),
array( 'wporg-parent-2021-style', 'wporg-global-fonts' ),
filemtime( __DIR__ . '/style.css' )
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public_html/wp-content/themes/wporg-events-2023/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Theme Name: Events.WordPress.org 2023
* Description: Includes templates for the homepage, event archives, etc.
* License: GNU General Public License v2 or later
* Text Domain: wporg
* Template: wporg-parent-2021
*/
5 changes: 5 additions & 0 deletions public_html/wp-content/themes/wporg-events-2023/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {}
}