Skip to content

Commit 243eb33

Browse files
committed
update to support composer
1 parent 29f15a4 commit 243eb33

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
/vendor/

composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "firstandthird/wordpress-unique-query",
3+
"description": "unique-wp-query is a Wordpress plugin that can be used to ensure no post is loaded more than once per screen",
4+
"type": "wordpress-plugin",
5+
"license": "proprietary",
6+
"authors": [
7+
{
8+
"name": "First and Third",
9+
"email": "code@firstandthird.com"
10+
}
11+
],
12+
"require": {}
13+
}

index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ public static function process_posts(&$posts, &$post_count, $original_posts_per_
136136
function unique_wp_query_pre_get_posts(&$query) {
137137
if (true === $query->get('unique_wp_query')) {
138138
$posts_per_page = $query->get('posts_per_page');
139-
// Increase posts_per_page by the amount of used post_ids
140-
$query->set('original_posts_per_page', min($posts_per_page, 200));
141-
$query->set('posts_per_page', min($posts_per_page + Unique_WP_Query_Manager::$used_post_count, 200));
139+
// Increase posts_per_page by the amount of used post_ids
140+
$query->set('original_posts_per_page', min($posts_per_page, 200));
141+
$query->set('posts_per_page', min($posts_per_page + Unique_WP_Query_Manager::$used_post_count, 200));
142142
}
143143
}
144144

0 commit comments

Comments
 (0)