From 200f133f33227f5f08f50b08c05a919f7d488c71 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Thu, 21 Apr 2022 23:54:02 +0530 Subject: [PATCH 1/6] add caveat to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f1b0b4c6..0f7c5a06 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,9 @@ Note that you need to add `data-sophi-feature=` to the wrapper div ``` +#### Caveats +While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. + ### Post content type By default, Sophi for WordPress uses post format as the content type. This plugin uses `content_type` internally to distinguish between WordPress post type and Sophi type. From 36b1dc4f7fd3b9e27aebb62be1afdfe1823c9a67 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 21 Apr 2022 13:32:46 -0500 Subject: [PATCH 2/6] tweak query integration caveat in README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f7c5a06..bcd5fd6b 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,8 @@ Note that you need to add `data-sophi-feature=` to the wrapper div ``` #### Caveats -While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. + +While the above query integration works just fine, it has been observed on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead. ### Post content type From a1a738773da97c17f659d02b1a402a5bf624ca22 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Mon, 25 Apr 2022 09:28:55 +0530 Subject: [PATCH 3/6] update README --- README.md | 5 ++++- readme.txt | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f7c5a06..3db87d11 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,10 @@ Note that you need to add `data-sophi-feature=` to the wrapper div ``` #### Caveats -While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. +While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: +`phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts` + +In addition to using `get_posts`, it would be good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. ### Post content type diff --git a/readme.txt b/readme.txt index e1dc5592..c4b48e96 100644 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,12 @@ Note that you need to add `data-sophi-feature=` to the wrapper div ` +== Caveats == +While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: +`phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts` + +In addition to using `get_posts`, it would be good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. + = Post content type = By default, Sophi for WordPress uses post format as the content type. This plugin uses `content_type` internally to distinguish between WordPress post type and Sophi type. From df74009261ad0181f464702100f3fc1d08512844 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Mon, 25 Apr 2022 13:48:44 -0500 Subject: [PATCH 4/6] tweak copy of caveat in README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06cefaf7..4496313f 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,10 @@ Note that you need to add `data-sophi-feature=` to the wrapper div ``` #### Caveats -While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: -`phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts` +While the above query integration works just fine, it has been observed on on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: -In addition to using `get_posts`, it would be good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. +`phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts` ### Post content type From 18caaf8784b0b29dc267982dd9371c640330e0fd Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Mon, 25 Apr 2022 13:52:10 -0500 Subject: [PATCH 5/6] tweak copy of caveat in readme.txt --- readme.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 35a1f4ac..e17896fb 100644 --- a/readme.txt +++ b/readme.txt @@ -95,12 +95,10 @@ Note that you need to add `data-sophi-feature=` to the wrapper div == Caveats == -While the above query integration works just fine, it has been observed that on VIP infrastructures, `WP_Query` returns latest posts instead of the posts curated by Sophi. A workaround for this is to use [get_posts](https://developer.wordpress.org/reference/functions/get_posts/) instead. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: +While the above query integration works just fine, it has been observed on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: `phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts` -In addition to using `get_posts`, it would be good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. - = Post content type = By default, Sophi for WordPress uses post format as the content type. This plugin uses `content_type` internally to distinguish between WordPress post type and Sophi type. From c79e2ff39daa992b65ffc261293fb10f0a73d9b5 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Mon, 25 Apr 2022 13:52:49 -0500 Subject: [PATCH 6/6] fix poor grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4496313f..05b99060 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Note that you need to add `data-sophi-feature=` to the wrapper div #### Caveats -While the above query integration works just fine, it has been observed on on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: +While the above query integration works just fine, it has been observed on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning: `phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts`