Skip to content

Commit f2a6b2e

Browse files
authored
Merge pull request #812 from Automattic/fix/remove-term-exists-error
End restricting usage of term_exists()
2 parents b8a8877 + cd82f3e commit f2a6b2e

File tree

7 files changed

+4
-14
lines changed

7 files changed

+4
-14
lines changed

Diff for: WordPress-VIP-Go/ruleset-test.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ wpcom_vip_irc(); // Error.
358358
flush_rewrite_rules(); // Error.
359359
$wp_rewrite->flush_rules(); // Error.
360360
\add_role(); // Error.
361-
term_exists(); // Error.
361+
362362
count_user_posts(); // Error.
363363
get_intermediate_image_sizes(); // Error.
364364
wp_is_mobile(); // Error.

Diff for: WordPress-VIP-Go/ruleset-test.php

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
358 => 1,
4848
359 => 1,
4949
360 => 1,
50-
361 => 1,
5150
362 => 1,
5251
363 => 1,
5352
364 => 1,

Diff for: WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php

-7
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ public function getGroups() {
102102
'add_role',
103103
],
104104
],
105-
'term_exists' => [
106-
'type' => 'error',
107-
'message' => '%s() is highly discouraged due to not being cached; please use wpcom_vip_term_exists() instead.',
108-
'functions' => [
109-
'term_exists',
110-
],
111-
],
112105
'count_user_posts' => [
113106
'type' => 'error',
114107
'message' => '%s() is highly discouraged due to not being cached; please use wpcom_vip_count_user_posts() instead.',

Diff for: WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ add_role( 'test' ); // Error.
8484

8585

8686

87-
wpcom_vip_term_exists(); // Ok - VIP recommended version of term_exists().
88-
term_exists(); // Error.
87+
88+
8989

9090
wpcom_vip_count_user_posts(); // Ok - VIP recommended version of count_user_posts().
9191
count_user_posts(); // Error.

Diff for: WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function getErrorList() {
3939
62 => 1,
4040
75 => 1,
4141
76 => 1,
42-
88 => 1,
4342
91 => 1,
4443
94 => 1,
4544
97 => 1,

Diff for: WordPressVIPMinimum/ruleset-test.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ url_to_postid( $url ); // Error.
329329

330330

331331

332-
term_exists(); // Error.
332+
333333
count_user_posts(); // Error.
334334
wp_old_slug_redirect(); // Error.
335335
get_adjacent_post(); // Error.

Diff for: WordPressVIPMinimum/ruleset-test.php

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
325 => 1,
9696
326 => 1,
9797
327 => 1,
98-
332 => 1,
9998
333 => 1,
10099
334 => 1,
101100
335 => 1,

0 commit comments

Comments
 (0)