From 2eecf751373695349312f042f21667a6f4c581da Mon Sep 17 00:00:00 2001 From: Dustin Horton Date: Wed, 20 Jun 2018 23:57:29 -0500 Subject: [PATCH 1/2] add syntax highlighting to php code blocks --- packages/gatsby-source-wordpress/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/gatsby-source-wordpress/README.md b/packages/gatsby-source-wordpress/README.md index e3324070b264a..f1e281feadea3 100644 --- a/packages/gatsby-source-wordpress/README.md +++ b/packages/gatsby-source-wordpress/README.md @@ -685,7 +685,7 @@ To solve this, you can use the [acf/format_value filter](https://www.advancedcus Using the following function, you can check for an empty field and if it's empty return `null`. -``` +```php if (!function_exists('acf_nullify_empty')) { /** * Return `null` if an empty value is returned from ACF. @@ -707,13 +707,13 @@ if (!function_exists('acf_nullify_empty')) { You can then apply this function to all ACF fields using the following code snippet: -``` +```php add_filter('acf/format_value', 'acf_nullify_empty', 100, 3); ``` Or if you would prefer to target specific fields, you can use the `acf/format_value/type={$field_type}` filter. Here are some examples: -``` +```php add_filter('acf/format_value/type=image', 'acf_nullify_empty', 100, 3); add_filter('acf/format_value/type=gallery', 'acf_nullify_empty', 100, 3); add_filter('acf/format_value/type=repeater', 'acf_nullify_empty', 100, 3); From 19f68d6397ad6dcb2beb57babb79e505e6fea360 Mon Sep 17 00:00:00 2001 From: Dustin Horton Date: Thu, 21 Jun 2018 00:09:11 -0500 Subject: [PATCH 2/2] add node self-signed cert workaround --- packages/gatsby-source-wordpress/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/gatsby-source-wordpress/README.md b/packages/gatsby-source-wordpress/README.md index f1e281feadea3..5921d0171dda8 100644 --- a/packages/gatsby-source-wordpress/README.md +++ b/packages/gatsby-source-wordpress/README.md @@ -720,3 +720,13 @@ add_filter('acf/format_value/type=repeater', 'acf_nullify_empty', 100, 3); ``` This code should be added as a plugin (recommended), or within the `functions.php` of a theme. + +### Self-signed certificates + +When running locally, or in other situations that may involve self-signed certificates, you may run into the error: `The request failed with error code "DEPTH_ZERO_SELF_SIGNED_CERT"`. + +To solve this, you can disable Node.js' rejection of unauthorized certificates by adding the following to `gatsby-node.js`: + +```javascript +process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' +```