-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from jabranr/wp-5-5-compatibility
WP 5.5 compatibility
- Loading branch information
Showing
5 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM wordpress:5.5 | ||
|
||
COPY ./entrypoint.sh /usr/local/bin/apache2-custom.sh | ||
RUN chmod 755 /usr/local/bin/apache2-custom.sh | ||
RUN chmod +x /usr/local/bin/apache2-custom.sh | ||
|
||
CMD [ "apache2-custom.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd /var/www/html | ||
|
||
WPPATH=/var/www/html | ||
|
||
echo "- Fix permissions"; | ||
echo "====================================="; | ||
chown -R www-data:www-data $WPPATH | ||
|
||
echo "- Install WP CLI"; | ||
echo "====================================="; | ||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
php $WPPATH/wp-cli.phar --info | ||
chmod +x wp-cli.phar | ||
mv $WPPATH/wp-cli.phar /usr/local/bin/wp | ||
|
||
echo "- Install and activate required plugins"; | ||
echo "====================================="; | ||
wp plugin install advanced-custom-fields --activate --path=$WPPATH --allow-root | ||
wp plugin install acf-to-rest-api --activate --path=$WPPATH --allow-root | ||
wp plugin activate nullify-empty-fields-for-acf --path=$WPPATH --allow-root | ||
|
||
echo "- Add a development user"; | ||
echo "====================================="; | ||
wp user create dev [email protected] --role=administrator --user_pass=password --path=$WPPATH --allow-root | ||
|
||
echo "- Start apache"; | ||
echo "====================================="; | ||
exec "apache2-foreground" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Plugin URI: https://github.com/jabranr/nullify-empty-fields-for-acf | ||
* Description: Set Advanced Custom Fields (ACF) empty field value as <code>null</code> instead of <code>false</code> to avoid GraphQL error in GatsbyJS. | ||
* Author: Jabran Rafique <[email protected]> | ||
* Version: 1.1.0 | ||
* Version: 1.2.0 | ||
* Author URI: https://jabran.me?utm_source=nullify-empty-fields-for-acf | ||
* License: MIT License | ||
* | ||
|
@@ -85,9 +85,9 @@ function nullify_empty_fields_for_acf_toggle($remove = false) { | |
|
||
foreach($nullifyTypes as $nullifyType) { | ||
if ($remove) { | ||
remove_filter('acf/format_value/type=' . $nullifyType, 'nullify_empty_fields_for_acf_empty', 100, 3); | ||
remove_filter('acf/format_value/type=' . trim($nullifyType), 'nullify_empty_fields_for_acf_empty', 100, 3); | ||
} else { | ||
add_filter('acf/format_value/type=' . $nullifyType, 'nullify_empty_fields_for_acf_empty', 100, 3); | ||
add_filter('acf/format_value/type=' . trim($nullifyType), 'nullify_empty_fields_for_acf_empty', 100, 3); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters