Changeset 4258 for trunk/bbp-includes/replies/functions.php
- Timestamp:
- 10/19/2012 07:42:49 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bbp-includes/replies/functions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbp-includes/replies/functions.php
r4255 r4258 262 262 'post_type' => bbp_get_reply_post_type(), 263 263 'comment_status' => 'closed', 264 'menu_order' => (int) ( bbp_get_topic_reply_count( $topic_id ) + 1 )264 'menu_order' => bbp_get_topic_reply_count( $topic_id, false ) + 1 265 265 ) ); 266 266 … … 1342 1342 * @since bbPress (r3540) 1343 1343 * 1344 * @param int $default Default replies per page (15) 1344 1345 * @uses get_option() To get the setting 1345 1346 * @uses apply_filters() To allow the return value to be manipulated 1346 1347 * @return int 1347 1348 */ 1348 function bbp_get_replies_per_page() { 1349 1350 // The default per setting 1351 $default = 15; 1349 function bbp_get_replies_per_page( $default = 15 ) { 1352 1350 1353 1351 // Get database option and cast as integer 1354 $ per = $retval = (int)get_option( '_bbp_replies_per_page', $default );1352 $retval = get_option( '_bbp_replies_per_page', $default ); 1355 1353 1356 1354 // If return val is empty, set it to default … … 1359 1357 1360 1358 // Filter and return 1361 return (int) apply_filters( 'bbp_get_replies_per_page', $retval, $per);1359 return absint( apply_filters( 'bbp_get_replies_per_page', $retval, $default ) ); 1362 1360 } 1363 1361 … … 1367 1365 * @since bbPress (r3540) 1368 1366 * 1367 * @param int $default Default replies per page (25) 1369 1368 * @uses get_option() To get the setting 1370 1369 * @uses apply_filters() To allow the return value to be manipulated 1371 1370 * @return int 1372 1371 */ 1373 function bbp_get_replies_per_rss_page() { 1374 1375 // The default per setting 1376 $default = 25; 1372 function bbp_get_replies_per_rss_page( $default = 25 ) { 1377 1373 1378 1374 // Get database option and cast as integer 1379 $ per = $retval = (int)get_option( '_bbp_replies_per_rss_page', $default );1375 $retval = get_option( '_bbp_replies_per_rss_page', $default ); 1380 1376 1381 1377 // If return val is empty, set it to default … … 1384 1380 1385 1381 // Filter and return 1386 return (int) apply_filters( 'bbp_get_replies_per_rss_page', $retval, $per);1382 return absint( apply_filters( 'bbp_get_replies_per_rss_page', $retval, $default ) ); 1387 1383 } 1388 1384 … … 1670 1666 1671 1667 // Make sure the topic has replies before running another query 1672 $reply_count = bbp_get_topic_reply_count( $topic_id );1668 $reply_count = bbp_get_topic_reply_count( $topic_id, false ); 1673 1669 if ( !empty( $reply_count ) ) { 1674 1670
Note: See TracChangeset
for help on using the changeset viewer.