Skip to content

Commit c5f54d7

Browse files
authored
Update wp-post.sh
1 parent 15b9084 commit c5f54d7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

wordpress/wp-post.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ for var in \
6565
NPP_GID \
6666
NPP_DEV_ENABLED \
6767
NPP_HTTP_HOST \
68+
NPP_HACK_HOST \
6869
NPP_DEV_PLUGIN_NAME \
6970
NPP_DEV_PLUGIN_DIR \
7071
NPP_DEV_TMP_CLONE_DIR \
@@ -126,11 +127,11 @@ resolve_host() {
126127
}
127128

128129
# To enable NPP Plugin Nginx Cache Preload action:
129-
# ############################################################################################################
130-
# The NPP WordPress plugin uses "wget" with "WP_SITEURL" from inside the WordPress container to Preload cache.
130+
# ##################################################################################################################
131+
# The NPP WordPress plugin uses "wget" with "WP_SITEURL" from inside the WordPress container to Preload Nginx Cache.
131132
# This means that if "WP_SITEURL" is set to "localhost", wget will attempt to fetch URLs from
132133
# the containers own loopback interface rather than reaching the Nginx server that handles
133-
# cache preload requests.
134+
# Cache Preload requests.
134135
#
135136
# To handle that;
136137
#
@@ -158,8 +159,8 @@ resolve_host() {
158159
# 3. Recommended docker way, edit wordpress service in docker-compose.yml,
159160
# extra_hosts:
160161
# - "example.com:Nginx_LAN_IP"
161-
###############################################################################################################
162-
if [[ "${NPP_DEV_ENABLED}" -eq 1 ]]; then
162+
###################################################################################################################
163+
if [[ "${NPP_HACK_HOST}" -eq 1 ]]; then
163164
# Create array
164165
mapfile -t ip_array < <(resolve_host host.docker.internal)
165166

@@ -179,7 +180,7 @@ if [[ "${NPP_DEV_ENABLED}" -eq 1 ]]; then
179180
echo -e "${COLOR_GREEN}${COLOR_BOLD}NPP-WP:${COLOR_RESET} ${COLOR_RED}Hacked!${COLOR_RESET} Mapped ${COLOR_LIGHT_CYAN}${NPP_HTTP_HOST}${COLOR_RESET} to host.docker.internal ${COLOR_LIGHT_CYAN}${ip_array[@]}${COLOR_RESET} in ${COLOR_LIGHT_CYAN}${HOSTS}${COLOR_RESET}."
180181
fi
181182
fi
182-
################################################################################################################
183+
####################################################################################################################
183184

184185
# Check ownership of webroot for consistency
185186
check_ownership() {

0 commit comments

Comments
 (0)