Changeset 6353 for trunk/src/includes/core/functions.php
- Timestamp:
- 03/03/2017 03:47:24 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/functions.php
r6337 r6353 79 79 80 80 /** 81 * Update a posts' forum meta ID81 * Update the forum meta ID of a post 82 82 * 83 83 * @since 2.0.0 bbPress (r3181) … … 86 86 * @param int $forum_id The forum 87 87 */ 88 function bbp_update_forum_id( $post_id , $forum_id) {88 function bbp_update_forum_id( $post_id = 0, $forum_id = 0 ) { 89 89 90 90 // Allow the forum ID to be updated 'just in time' before save … … 98 98 99 99 /** 100 * Update a posts' topic meta ID100 * Update the topic meta ID of a post 101 101 * 102 102 * @since 2.0.0 bbPress (r3181) … … 105 105 * @param int $topic_id The topic 106 106 */ 107 function bbp_update_topic_id( $post_id , $topic_id) {107 function bbp_update_topic_id( $post_id = 0, $topic_id = 0 ) { 108 108 109 109 // Allow the topic ID to be updated 'just in time' before save … … 117 117 118 118 /** 119 * Update a posts' reply meta ID119 * Update the reply meta ID of a post 120 120 * 121 121 * @since 2.0.0 bbPress (r3181) … … 124 124 * @param int $reply_id The reply 125 125 */ 126 function bbp_update_reply_id( $post_id , $reply_id) {126 function bbp_update_reply_id( $post_id = 0, $reply_id = 0 ) { 127 127 128 128 // Allow the reply ID to be updated 'just in time' before save … … 136 136 137 137 /** 138 * Update a posts' reply-to meta ID138 * Update the reply-to meta ID of a post 139 139 * 140 140 * @since 2.6.0 bbPress (r5735) … … 143 143 * @param int $reply_id The reply ID 144 144 */ 145 function bbp_update_reply_to_id( $post_id , $reply_id) {145 function bbp_update_reply_to_id( $post_id = 0, $reply_id = 0 ) { 146 146 147 147 // Allow the reply ID to be updated 'just in time' before save … … 238 238 239 239 /** 240 * Run the view's query240 * Run the query of a topic-view 241 241 * 242 242 * @since 2.0.0 bbPress (r2789) … … 252 252 function bbp_view_query( $view = '', $new_args = '' ) { 253 253 254 // Get view, or bail 254 255 $view = bbp_get_view_id( $view ); 255 256 if ( empty( $view ) ) { … … 268 269 269 270 /** 270 * Return the view's query arguments271 * Return the query arguments of a topic-view 271 272 * 272 273 * @since 2.0.0 bbPress (r2789) … … 276 277 * @return array Query arguments 277 278 */ 278 function bbp_get_view_query_args( $view ) { 279 function bbp_get_view_query_args( $view = '' ) { 280 $bbp = bbpress(); 279 281 $view = bbp_get_view_id( $view ); 280 $retval = ! empty( $view ) 281 ? bbpress()->views[ $view ]['query']282 $retval = ! empty( $view ) && ! empty( $bbp->views[ $view ] ) 283 ? $bbp->views[ $view ]['query'] 282 284 : false; 283 285 … … 314 316 */ 315 317 function bbp_has_errors() { 316 $has_errors = bbpress()->errors->get_error_codes() ? true : false; 317 318 return apply_filters( 'bbp_has_errors', $has_errors, bbpress()->errors ); 318 $has_errors = bbpress()->errors->get_error_codes() 319 ? true 320 : false; 321 322 return (bool) apply_filters( 'bbp_has_errors', $has_errors, bbpress()->errors ); 319 323 } 320 324
Note: See TracChangeset
for help on using the changeset viewer.