PluginProbe
bbPress / 2.6.17
bbPress v2.6.17
2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 72 releases
← All changes | includes/core/update.php +40 -50 trunk2.6.17 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 3 /**
4 - * bbPress Updater.
4 + * bbPress Updater
5 5 *
6 6 * @package bbPress
7 7 * @subpackage Core
8 8 */
@@ -10,13 +10,13 @@
10 10 // Exit if accessed directly
11 11 defined( 'ABSPATH' ) || exit;
12 12
13 13 /**
14 - * If there is no raw DB version, this is the first installation.
14 + * If there is no raw DB version, this is the first installation
15 15 *
16 16 * @since 2.1.0 bbPress (r3764)
17 17 *
18 - * @return bool True if update, False if not.
18 + * @return bool True if update, False if not
19 19 */
20 20 function bbp_is_install() {
21 21 return ! bbp_get_db_version_raw();
22 22 }
@@ -21,13 +21,13 @@
21 21 return ! bbp_get_db_version_raw();
22 22 }
23 23
24 24 /**
25 - * Compare the bbPress version to the DB version to determine if updating.
25 + * Compare the bbPress version to the DB version to determine if updating
26 26 *
27 27 * @since 2.0.0 bbPress (r3421)
28 28 *
29 - * @return bool True if update, False if not.
29 + * @return bool True if update, False if not
30 30 */
31 31 function bbp_is_update() {
32 32 $raw = (int) bbp_get_db_version_raw();
33 33 $cur = (int) bbp_get_db_version();
@@ -35,9 +35,9 @@
35 35 return $retval;
36 36 }
37 37
38 38 /**
39 - * Determine if bbPress is being activated.
39 + * Determine if bbPress is being activated
40 40 *
41 41 * Note that this function currently is not used in bbPress core and is here
42 42 * for third party plugins to use to check for bbPress activation.
43 43 *
@@ -42,13 +42,9 @@
42 42 * for third party plugins to use to check for bbPress activation.
43 43 *
44 44 * @since 2.0.0 bbPress (r3421)
45 45 *
46 - * @global string $pagenow The filename of the current screen.
47 - *
48 - * @param string $basename Plugin base name.
49 - *
50 - * @return bool True if activating bbPress, false if not.
46 + * @return bool True if activating bbPress, false if not
51 47 */
52 48 function bbp_is_activation( $basename = '' ) {
53 49 global $pagenow;
54 50
@@ -92,17 +88,13 @@
92 88 return in_array( $basename, $plugins, true );
93 89 }
94 90
95 91 /**
96 - * Determine if bbPress is being deactivated.
92 + * Determine if bbPress is being deactivated
97 93 *
98 94 * @since 2.0.0 bbPress (r3421)
99 95 *
100 - * @global string $pagenow The filename of the current screen.
101 - *
102 - * @param string $basename Plugin base name.
103 - *
104 - * @return bool True if deactivating bbPress, false if not.
96 + * @return bool True if deactivating bbPress, false if not
105 97 */
106 98 function bbp_is_deactivation( $basename = '' ) {
107 99 global $pagenow;
108 100
@@ -146,9 +138,9 @@
146 138 return in_array( $basename, $plugins, true );
147 139 }
148 140
149 141 /**
150 - * Update the DB to the latest version.
142 + * Update the DB to the latest version
151 143 *
152 144 * @since 2.0.0 bbPress (r3421)
153 145 */
154 146 function bbp_version_bump() {
@@ -155,9 +147,9 @@
155 147 update_option( '_bbp_db_version', bbp_get_db_version() );
156 148 }
157 149
158 150 /**
159 - * Setup the bbPress updater.
151 + * Setup the bbPress updater
160 152 *
161 153 * @since 2.0.0 bbPress (r3419)
162 154 */
163 155 function bbp_setup_updater() {
@@ -172,13 +164,11 @@
172 164 }
173 165
174 166 /**
175 167 * Runs when a new site is created in a multisite network, and bbPress is active
176 - * on that site (hooked to `bbp_new_site`).
168 + * on that site (hooked to `bbp_new_site`)
177 169 *
178 170 * @since 2.6.0 bbPress (r6779)
179 - *
180 - * @param int $site_id Side id.
181 171 */
182 172 function bbp_setup_new_site( $site_id = 0 ) {
183 173
184 174 // Look for initial content
@@ -197,13 +187,13 @@
197 187 }
198 188 }
199 189
200 190 /**
201 - * Create a default forum, topic, and reply.
191 + * Create a default forum, topic, and reply
202 192 *
203 193 * @since 2.1.0 bbPress (r3767)
204 194 *
205 - * @param array $args Array of arguments to override default values.
195 + * @param array $args Array of arguments to override default values
206 196 */
207 197 function bbp_create_initial_content( $args = array() ) {
208 198
209 199 // Cannot use bbp_get_current_user_id() during activation process
@@ -258,9 +248,9 @@
258 248 'post_content' => $r['topic_content'],
259 249 'post_date' => $topic_time,
260 250 ),
261 251 array(
262 - 'forum_id' => $forum_id
252 + 'forum_id' => $forum_id
263 253 )
264 254 );
265 255
266 256 // Create the initial reply
@@ -271,10 +261,10 @@
271 261 'post_content' => $r['reply_content'],
272 262 'post_date' => $reply_time
273 263 ),
274 264 array(
275 - 'forum_id' => $forum_id,
276 - 'topic_id' => $topic_id
265 + 'forum_id' => $forum_id,
266 + 'topic_id' => $topic_id
277 267 )
278 268 );
279 269
280 270 return array(
@@ -429,15 +419,15 @@
429 419 bbp_delete_rewrite_rules();
430 420 }
431 421
432 422 /**
433 - * Redirect user to the "What's New" page on activation.
423 + * Redirect user to the "What's New" page on activation
434 424 *
435 425 * @since 2.2.0 bbPress (r4389)
436 426 *
437 - * @internal Used internally to redirect bbPress to the about page on activation.
427 + * @internal Used internally to redirect bbPress to the about page on activation
438 428 *
439 - * @return If network admin or bulk activation.
429 + * @return If network admin or bulk activation
440 430 */
441 431 function bbp_add_activation_redirect() {
442 432
443 433 // Bail if activating from network, or bulk
@@ -449,15 +439,15 @@
449 439 update_user_option( get_current_user_id(), '_bbp_activation_redirect', true );
450 440 }
451 441
452 442 /**
453 - * Redirect user to "What's New" page on activation.
443 + * Redirect user to "What's New" page on activation
454 444 *
455 445 * @since 2.2.0 bbPress (r4389)
456 446 *
457 - * @internal Used internally to redirect bbPress to the about page on activation.
447 + * @internal Used internally to redirect bbPress to the about page on activation
458 448 *
459 - * @return If no transient, or in network admin, or is bulk activation.
449 + * @return If no transient, or in network admin, or is bulk activation
460 450 */
461 451 function bbp_do_activation_redirect() {
462 452
463 453 // Bail if no redirect trigger
@@ -483,16 +473,16 @@
483 473 }
484 474
485 475 /**
486 476 * Hooked to the 'bbp_activate' action, this helper function automatically makes
487 - * the current user a Keymaster in the forums if they just activated bbPress,
477 + * the current user a Key Master in the forums if they just activated bbPress,
488 478 * regardless of the bbp_allow_global_access() setting.
489 479 *
490 480 * @since 2.4.0 bbPress (r4910)
491 481 *
492 - * @internal Used to internally make the current user a keymaster on activation.
482 + * @internal Used to internally make the current user a keymaster on activation
493 483 *
494 - * @return If user can't activate plugins or is already a keymaster.
484 + * @return If user can't activate plugins or is already a keymaster
495 485 */
496 486 function bbp_make_current_user_keymaster() {
497 487
498 488 // Catch all, to prevent premature user initialization
@@ -536,13 +526,13 @@
536 526
537 527 /** Pending Upgrades **********************************************************/
538 528
539 529 /**
540 - * Return the number of pending upgrades.
530 + * Return the number of pending upgrades
541 531 *
542 532 * @since 2.6.0 bbPress (r6895)
543 533 *
544 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
534 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
545 535 *
546 536 * @return int
547 537 */
548 538 function bbp_get_pending_upgrade_count( $type = '' ) {
@@ -549,13 +539,13 @@
549 539 return count( (array) bbp_get_pending_upgrades( $type ) );
550 540 }
551 541
552 542 /**
553 - * Return an array of pending upgrades.
543 + * Return an array of pending upgrades
554 544 *
555 545 * @since 2.6.0 bbPress (r6895)
556 546 *
557 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
547 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
558 548 *
559 549 * @return array
560 550 */
561 551 function bbp_get_pending_upgrades( $type = '' ) {
@@ -573,9 +563,9 @@
573 563 return (array) $retval;
574 564 }
575 565
576 566 /**
577 - * Add an upgrade ID to pending upgrades array.
567 + * Add an upgrade ID to pending upgrades array
578 568 *
579 569 * @since 2.6.0 bbPress (r6895)
580 570 *
581 571 * @param string $upgrade_id
@@ -594,9 +584,9 @@
594 584 return update_option( '_bbp_db_pending_upgrades', $pending );
595 585 }
596 586
597 587 /**
598 - * Add an upgrade ID to pending upgrades array.
588 + * Add an upgrade ID to pending upgrades array
599 589 *
600 590 * @since 2.6.0 bbPress (r6895)
601 591 *
602 592 * @param string $upgrade_id
@@ -618,9 +608,9 @@
618 608 return update_option( '_bbp_db_pending_upgrades', $pending );
619 609 }
620 610
621 611 /**
622 - * Delete all pending upgrades.
612 + * Delete all pending upgrades
623 613 *
624 614 * @since 2.6.0 bbPress (r6895)
625 615 */
626 616 function bbp_clear_pending_upgrades() {
@@ -627,18 +617,18 @@
627 617 return delete_option( '_bbp_db_pending_upgrades' );
628 618 }
629 619
630 620 /**
631 - * Maybe append an upgrade count to a string.
621 + * Maybe append an upgrade count to a string
632 622 *
633 623 * @since 2.6.0 bbPress (r6896)
634 624 *
635 - * @param string $text Text to append count to.
636 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
625 + * @param string $string Text to append count to
626 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
637 627 *
638 628 * @return string
639 629 */
640 -function bbp_maybe_append_pending_upgrade_count( $text = '', $type = '' ) {
630 +function bbp_maybe_append_pending_upgrade_count( $string = '', $type = '' ) {
641 631
642 632 // Look for an upgrade count
643 633 $count = bbp_get_pending_upgrade_count( $type );
644 634
@@ -644,10 +634,10 @@
644 634
645 635 // Append the count to the string
646 636 if ( ! empty( $count ) ) {
647 637 $suffix = ' <span class="awaiting-mod count-' . absint( $count ) . '"><span class="pending-count">' . bbp_number_format( $count ) . '</span></span>';
648 - $text = "{$text}{$suffix}";
638 + $string = "{$string}{$suffix}";
649 639 }
650 640
651 - // Return the text, maybe with a count
652 - return $text;
641 + // Return the string, maybe with a count
642 + return $string;
653 643 }