Changeset 4258 for trunk/bbp-includes/topics/functions.php
- Timestamp:
- 10/19/2012 07:42:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbp-includes/topics/functions.php
r4255 r4258 3049 3049 * @since bbPress (r3540) 3050 3050 * 3051 * @param int $default Default replies per page (15) 3051 3052 * @uses get_option() To get the setting 3052 3053 * @uses apply_filters() To allow the return value to be manipulated 3053 3054 * @return int 3054 3055 */ 3055 function bbp_get_topics_per_page() { 3056 3057 // The default per setting 3058 $default = 15; 3056 function bbp_get_topics_per_page( $default = 15 ) { 3059 3057 3060 3058 // Get database option and cast as integer 3061 $ per = $retval = (int)get_option( '_bbp_topics_per_page', $default );3059 $retval = get_option( '_bbp_topics_per_page', $default ); 3062 3060 3063 3061 // If return val is empty, set it to default … … 3066 3064 3067 3065 // Filter and return 3068 return (int) apply_filters( 'bbp_get_topics_per_page', $retval, $per);3066 return absint( apply_filters( 'bbp_get_topics_per_page', $retval, $default ) ); 3069 3067 } 3070 3068 … … 3074 3072 * @since bbPress (r3540) 3075 3073 * 3074 * @param int $default Default replies per page (25) 3076 3075 * @uses get_option() To get the setting 3077 3076 * @uses apply_filters() To allow the return value to be manipulated 3078 3077 * @return int 3079 3078 */ 3080 function bbp_get_topics_per_rss_page() { 3081 3082 // The default per setting 3083 $default = 25; 3079 function bbp_get_topics_per_rss_page( $default = 25 ) { 3084 3080 3085 3081 // Get database option and cast as integer 3086 $ per = $retval = (int)get_option( '_bbp_topics_per_rss_page', $default );3082 $retval = get_option( '_bbp_topics_per_rss_page', $default ); 3087 3083 3088 3084 // If return val is empty, set it to default … … 3091 3087 3092 3088 // Filter and return 3093 return (int) apply_filters( 'bbp_get_topics_per_rss_page', $retval, $per);3089 return absint( apply_filters( 'bbp_get_topics_per_rss_page', $retval, $default ) ); 3094 3090 } 3095 3091
Note: See TracChangeset
for help on using the changeset viewer.