From 8841c8e3348d299091f5c71f42929068f28ddd1f Mon Sep 17 00:00:00 2001 From: Maya Baya Date: Thu, 23 Jun 2022 22:01:08 +0200 Subject: [PATCH] feat: Add support for env variable WORDPRESS_DB_TABLE_PREFIX --- Dockerfile | 3 ++- wp-config-sample.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29e3f75..2ace088 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,8 @@ ENV AUTO_UPDATE_CRON="0 5 * * TUE" \ WP_SITE_ADMIN_PASSWORD=riotkit \ WP_SITE_ADMIN_EMAIL=example@example.org \ ACCESS_LOG=/dev/stdout \ - ERROR_LOG=/dev/stderr + ERROR_LOG=/dev/stderr \ + WORDPRESS_DB_TABLE_PREFIX=wp_ # p2 (jinja2) RUN wget https://github.com/wrouesnel/p2cli/releases/download/r13/p2-linux-x86_64 -O /usr/bin/p2 && chmod +x /usr/bin/p2 diff --git a/wp-config-sample.php b/wp-config-sample.php index e3e3249..35e79cb 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -58,7 +58,7 @@ * You can have multiple installations in one database if you give each * a unique prefix. Only numbers, letters, and underscores please! */ -$table_prefix = 'wp_'; +$table_prefix = isset($_SERVER['WORDPRESS_DB_TABLE_PREFIX']) ? $_SERVER['WORDPRESS_DB_TABLE_PREFIX'] : 'wp_'; /** * For developers: WordPress debugging mode.