Skip to content

Commit 6df1155

Browse files
committed
Fix display bug
Previously, using the `posts_per_page` param didn't actually restrict the number of FAQ's returned. This fixes #20 by removing the `nopaging` param
1 parent d6dcf6a commit 6df1155

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

includes/class-arconix-faq-admin.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function __construct() {
3535
* @version 1.4.0
3636
*/
3737
function constants() {
38-
define( 'ACFAQ_VERSION', '1.4.2' );
38+
define( 'ACFAQ_VERSION', '1.4.3' );
3939
define( 'ACFAQ_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
4040
define( 'ACFAQ_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
4141
}
@@ -136,7 +136,6 @@ function defaults() {
136136
'order' => 'ASC',
137137
'orderby' => 'title',
138138
'posts_per_page' => -1,
139-
'nopaging' => true,
140139
'group' => '',
141140
)
142141
);
@@ -209,7 +208,6 @@ function faq_shortcode( $atts, $content = null ) {
209208
if( isset( $atts['showposts'] ) ) {
210209
if( $atts['showposts'] != "all" and $atts['showposts'] > 0 ) {
211210
$atts['posts_per_page'] = $atts['showposts'];
212-
$atts['nopaging'] = false;
213211
}
214212
}
215213

includes/class-arconix-faq.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ function __construct() { }
1616
* @param boolean $echo Echo or Return the data
1717
* @return mixed FAQ information for display
1818
* @since 1.2.0
19-
* @version 1.4.2
19+
* @version 1.4.3
2020
*/
2121
function loop( $args, $echo = false ) {
2222

2323
$defaults = array(
2424
'order' => 'ASC',
2525
'orderby' => 'title',
2626
'posts_per_page' => -1,
27-
'nopaging' => true,
2827
'group' => '',
2928
);
3029

@@ -52,7 +51,6 @@ function loop( $args, $echo = false ) {
5251
'order' => $args['order'],
5352
'orderby' => $args['orderby'],
5453
'posts_per_page' => $args['posts_per_page'],
55-
'nopaging' => $args['nopaging'],
5654
'tax_query' => array(
5755
array(
5856
'taxonomy' => 'group',
@@ -118,8 +116,7 @@ function loop( $args, $echo = false ) {
118116
'post_type' => 'faq',
119117
'order' => $args['order'],
120118
'orderby' => $args['orderby'],
121-
'posts_per_page' => $args['posts_per_page'],
122-
'nopaging' => $args['nopaging'],
119+
'posts_per_page' => $args['posts_per_page']
123120
) );
124121

125122

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: http://arcnx.co/acfdonation
44
Tags: arconix, faq, toggle
55
Requires at least: 3.8
66
Tested up to: 3.9
7-
Stable tag: 1.4.2
7+
Stable tag: 1.4.3
88

99
Arconix FAQ provides an easy way to add FAQ items to your website.
1010

@@ -61,6 +61,9 @@ That's fantastic! Feel free to submit a pull request over at [Github](http://arc
6161
3. Grouping and Toggling display
6262

6363
== Changelog ==
64+
= 1.4.3 =
65+
Fixes a parameter bug that prevented users from restricting the number of FAQ's returned for display
66+
6467
= 1.4.2 =
6568
Fix undefined variable bug that would show up when no FAQ groups were used
6669

0 commit comments

Comments
 (0)