Skip to content

Commit

Permalink
Merge pull request #573 from davidpagepsycle/feature/revert-get-pages…
Browse files Browse the repository at this point in the history
…-569

Remove `get_pages()` from uncached functions in …
  • Loading branch information
JDGrimes authored Jul 11, 2016
2 parents 6f255e6 + 0c8c34b commit 97c27b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
8 changes: 0 additions & 8 deletions WordPress/Sniffs/VIP/RestrictedFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,7 @@ public function getGroups() {
'functions' => array(
'get_posts',
'wp_get_recent_posts',
),
),

'get_pages' => array(
'type' => 'error',
'message' => '%s is highly discouraged in favor of creating a new WP_Query() so that Advanced Post Cache will cache the query.',
'functions' => array(
'get_children',
'get_pages',
),
),

Expand Down
4 changes: 2 additions & 2 deletions WordPress/Tests/VIP/RestrictedFunctionsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ url_to_post_id(); // error
attachment_url_to_postid(); // error
get_posts(); // warning
wp_get_recent_posts(); // warning
get_pages(); // error
get_children(); // error

get_children(); // warning
wp_get_post_terms(); // error
wp_get_post_categories(); // error
wp_get_post_tags(); // error
Expand Down
3 changes: 1 addition & 2 deletions WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public function getErrorList()
55 => 1,
56 => 1,
57 => 1,
60 => 1,
61 => 1,
62 => 1,
63 => 1,
64 => 1,
Expand Down Expand Up @@ -80,6 +78,7 @@ public function getWarningList()
19 => 1,
58 => 1,
59 => 1,
61 => 1,
72 => 1,
);

Expand Down

0 comments on commit 97c27b7

Please sign in to comment.