Skip to content

Commit

Permalink
add comments for sticky options
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Oct 26, 2020
1 parent 12bafbd commit 96d2107
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/query-loop/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export default function QueryLoopEdit( {
if ( exclude?.length ) {
query.exclude = exclude;
}
// If sticky is not set, it will return all posts in the results.
// If sticky is set to `only`, it will limit the results to sticky posts only.
// If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.
if ( sticky ) {
query.sticky = sticky === 'only';
}
Expand Down

0 comments on commit 96d2107

Please sign in to comment.