diff --git a/.docker/wp-config.php b/.docker/wp-config.php index ab7f6a2756..a780e826a1 100644 --- a/.docker/wp-config.php +++ b/.docker/wp-config.php @@ -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; diff --git a/.gitignore b/.gitignore index f9a00b8c3a..0ec43bad88 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/composer.json b/composer.json index f7cfa949bf..29448a61cf 100644 --- a/composer.json +++ b/composer.json @@ -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": "git@github.com:WordPress/wporg-parent-2021.git" + } + ], "require": { "adhocore/jwt": "^1.0" }, @@ -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", diff --git a/composer.lock b/composer.lock index 84a7884c19..5c787347e7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5e74877ee7a58f8aee0c79a2a2afe33f", + "content-hash": "a5015aea9e9c14085f9efc84446b689b", "packages": [ { "name": "adhocore/jwt", @@ -277,6 +277,151 @@ ], "time": "2020-11-06T11:48:09+00:00" }, + { + "name": "composer/installers", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", + "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^5.3", + "symfony/process": "^5" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "2.x-dev" + }, + "plugin-modifies-install-path": true + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "matomo", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "tastyigniter", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-08-20T06:45:11+00:00" + }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v1.0.0", @@ -3969,6 +4114,27 @@ }, "time": "2023-08-21T14:28:38+00:00" }, + { + "name": "wporg/wporg-parent-2021", + "version": "dev-build", + "source": { + "type": "git", + "url": "https://github.com/WordPress/wporg-parent-2021.git", + "reference": "d5311dafbe40fdc6d16ca2119b17a39ac19800a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/wporg-parent-2021/zipball/d5311dafbe40fdc6d16ca2119b17a39ac19800a1", + "reference": "d5311dafbe40fdc6d16ca2119b17a39ac19800a1", + "shasum": "" + }, + "type": "wordpress-theme", + "support": { + "source": "https://github.com/WordPress/wporg-parent-2021/tree/build", + "issues": "https://github.com/WordPress/wporg-parent-2021/issues" + }, + "time": "2023-08-22T15:22:31+00:00" + }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", @@ -4089,7 +4255,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "wporg/wporg-parent-2021": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/public_html/wp-content/mu-plugins/events/redirects.php b/public_html/wp-content/mu-plugins/events/redirects.php index 5571732e2b..b5e23cb194 100644 --- a/public_html/wp-content/mu-plugins/events/redirects.php +++ b/public_html/wp-content/mu-plugins/events/redirects.php @@ -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; } } diff --git a/public_html/wp-content/mu-plugins/load-other-mu-plugins.php b/public_html/wp-content/mu-plugins/load-other-mu-plugins.php index d9a6274721..20123523f2 100644 --- a/public_html/wp-content/mu-plugins/load-other-mu-plugins.php +++ b/public_html/wp-content/mu-plugins/load-other-mu-plugins.php @@ -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'; } diff --git a/public_html/wp-content/themes/wporg-events-2023/functions.php b/public_html/wp-content/themes/wporg-events-2023/functions.php new file mode 100644 index 0000000000..9e8b1716eb --- /dev/null +++ b/public_html/wp-content/themes/wporg-events-2023/functions.php @@ -0,0 +1,21 @@ +