Changeset 3540
- Timestamp:
- 10/10/2011 05:01:21 AM (13 years ago)
- Location:
- branches/2.0/bbp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/bbp-includes/bbp-common-functions.php
r3516 r3540 1374 1374 'post_parent' => 'any', 1375 1375 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ), 1376 'posts_per_page' => get_option( '_bbp_replies_per_rss_page', 25),1376 'posts_per_page' => bbp_get_replies_per_rss_page(), 1377 1377 'order' => 'DESC', 1378 1378 'meta_query' => $meta_query … … 1391 1391 'post_parent' => 'any', 1392 1392 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ), 1393 'posts_per_page' => get_option( '_bbp_topics_per_rss_page', 25),1393 'posts_per_page' => bbp_get_topics_per_rss_page(), 1394 1394 'order' => 'DESC', 1395 1395 'meta_query' => $meta_query … … 1408 1408 'post_parent' => 'any', 1409 1409 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ), 1410 'posts_per_page' => get_option( '_bbp_replies_per_rss_page', 25),1410 'posts_per_page' => bbp_get_replies_per_rss_page(), 1411 1411 'order' => 'DESC', 1412 1412 'meta_query' => $meta_query … … 1441 1441 'author' => 0, 1442 1442 'post_parent' => 'any', 1443 'posts_per_page' => get_option( '_bbp_topics_per_rss_page', 25),1443 'posts_per_page' => bbp_get_topics_per_rss_page(), 1444 1444 'show_stickies' => false, 1445 1445 ); … … 1456 1456 // The query 1457 1457 $the_query = array( 1458 'posts_per_page' => get_option( '_bbp_replies_per_rss_page', 25),1458 'posts_per_page' => bbp_get_replies_per_rss_page(), 1459 1459 'meta_query' => array( array( ) ) 1460 1460 ); -
branches/2.0/bbp-includes/bbp-core-compatibility.php
r3516 r3540 1672 1672 // Topic tag page 1673 1673 } elseif ( bbp_is_topic_tag() ) { 1674 $posts_query->set( 'bbp_topic_tag', get_query_var( 'term' ) 1675 $posts_query->set( 'post_type', bbp_get_topic_post_type() 1676 $posts_query->set( 'posts_per_page', get_option( '_bbp_topics_per_page', 15) );1674 $posts_query->set( 'bbp_topic_tag', get_query_var( 'term' ) ); 1675 $posts_query->set( 'post_type', bbp_get_topic_post_type() ); 1676 $posts_query->set( 'posts_per_page', bbp_get_topics_per_page() ); 1677 1677 } 1678 1678 } -
branches/2.0/bbp-includes/bbp-reply-functions.php
r3505 r3540 1253 1253 } 1254 1254 1255 /** Settings ******************************************************************/ 1256 1257 /** 1258 * Return the replies per page setting 1259 * 1260 * @since bbPress (r3540) 1261 * 1262 * @uses get_option() To get the setting 1263 * @uses apply_filters() To allow the return value to be manipulated 1264 * @return int 1265 */ 1266 function bbp_get_replies_per_page() { 1267 1268 // The default per setting 1269 $default = 15; 1270 1271 // Get database option and cast as integer 1272 $per = $retval = (int) get_option( '_bbp_replies_per_page', $default ); 1273 1274 // If return val is empty, set it to default 1275 if ( empty( $retval ) ) 1276 $retval = $default; 1277 1278 // Filter and return 1279 return (int) apply_filters( 'bbp_get_replies_per_page', $retval, $per ); 1280 } 1281 1282 /** 1283 * Return the replies per RSS page setting 1284 * 1285 * @since bbPress (r3540) 1286 * 1287 * @uses get_option() To get the setting 1288 * @uses apply_filters() To allow the return value to be manipulated 1289 * @return int 1290 */ 1291 function bbp_get_replies_per_rss_page() { 1292 1293 // The default per setting 1294 $default = 25; 1295 1296 // Get database option and cast as integer 1297 $per = $retval = (int) get_option( '_bbp_replies_per_rss_page', $default ); 1298 1299 // If return val is empty, set it to default 1300 if ( empty( $retval ) ) 1301 $retval = $default; 1302 1303 // Filter and return 1304 return (int) apply_filters( 'bbp_get_replies_per_rss_page', $retval, $per ); 1305 } 1306 1255 1307 /** Feeds *********************************************************************/ 1256 1308 -
branches/2.0/bbp-includes/bbp-reply-template.php
r3506 r3540 101 101 102 102 // Max number 103 'posts_per_page' => get_option( '_bbp_replies_per_page', 15),103 'posts_per_page' => bbp_get_replies_per_page(), 104 104 105 105 // Page Number … … 378 378 379 379 // Check if in query with pagination 380 $reply_page = ceil( $reply_position / get_option( '_bbp_replies_per_page', 15) );380 $reply_page = ceil( (int) $reply_position / (int) bbp_get_replies_per_page() ); 381 381 382 382 // Hash to add to end of URL -
branches/2.0/bbp-includes/bbp-topic-functions.php
r3506 r3540 2878 2878 } 2879 2879 2880 /** Settings ******************************************************************/ 2881 2882 /** 2883 * Return the topics per page setting 2884 * 2885 * @since bbPress (r3540) 2886 * 2887 * @uses get_option() To get the setting 2888 * @uses apply_filters() To allow the return value to be manipulated 2889 * @return int 2890 */ 2891 function bbp_get_topics_per_page() { 2892 2893 // The default per setting 2894 $default = 15; 2895 2896 // Get database option and cast as integer 2897 $per = $retval = (int) get_option( '_bbp_topics_per_page', $default ); 2898 2899 // If return val is empty, set it to default 2900 if ( empty( $retval ) ) 2901 $retval = $default; 2902 2903 // Filter and return 2904 return (int) apply_filters( 'bbp_get_topics_per_page', $retval, $per ); 2905 } 2906 2907 /** 2908 * Return the topics per RSS page setting 2909 * 2910 * @since bbPress (r3540) 2911 * 2912 * @uses get_option() To get the setting 2913 * @uses apply_filters() To allow the return value to be manipulated 2914 * @return int 2915 */ 2916 function bbp_get_topics_per_rss_page() { 2917 2918 // The default per setting 2919 $default = 25; 2920 2921 // Get database option and cast as integer 2922 $per = $retval = (int) get_option( '_bbp_topics_per_rss_page', $default ); 2923 2924 // If return val is empty, set it to default 2925 if ( empty( $retval ) ) 2926 $retval = $default; 2927 2928 // Filter and return 2929 return (int) apply_filters( 'bbp_get_topics_per_rss_page', $retval, $per ); 2930 } 2931 2880 2932 /** Feeds *********************************************************************/ 2881 2933 -
branches/2.0/bbp-includes/bbp-topic-template.php
r3505 r3540 94 94 95 95 // Topics per page 96 'posts_per_page' => get_option( '_bbp_topics_per_page', 15),96 'posts_per_page' => bbp_get_topics_per_page(), 97 97 98 98 // Page Number … … 679 679 'base' => $base, 680 680 'format' => '', 681 'total' => ceil( (int) $total / (int) get_option( '_bbp_replies_per_page', 15) ),681 'total' => ceil( (int) $total / (int) bbp_get_replies_per_page() ), 682 682 'current' => 0, 683 683 'prev_next' => false,
Note: See TracChangeset
for help on using the changeset viewer.