PluginProbe
bbPress / 2.6.19
bbPress v2.6.19
2.6.19 2.6.18 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 All 74 releases
← All changes | includes/core/update.php +41 -51 trunk → 2.6.19 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 (r3765)
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,12 +147,12 @@
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 - * @since 2.6.19 bbPress (r7644) Moved to "bbp_current_screen" hook
154 + * @since 2.6.19 bbPress (r7645) Moved to "bbp_current_screen" hook
163 155 *
164 156 * @param WP_Screen|null $current_screen Current admin screen.
165 157 */
166 158 function bbp_setup_updater( $current_screen = null ) {
@@ -189,13 +181,11 @@
189 181 }
190 182
191 183 /**
192 184 * Runs when a new site is created in a multisite network, and bbPress is active
193 - * on that site (hooked to `bbp_new_site`).
185 + * on that site (hooked to `bbp_new_site`)
194 186 *
195 187 * @since 2.6.0 bbPress (r6780)
196 - *
197 - * @param int $site_id Side id.
198 188 */
199 189 function bbp_setup_new_site( $site_id = 0 ) {
200 190
201 191 // Look for initial content
@@ -214,13 +204,13 @@
214 204 }
215 205 }
216 206
217 207 /**
218 - * Create a default forum, topic, and reply.
208 + * Create a default forum, topic, and reply
219 209 *
220 210 * @since 2.1.0 bbPress (r3768)
221 211 *
222 - * @param array $args Array of arguments to override default values.
212 + * @param array $args Array of arguments to override default values
223 213 */
224 214 function bbp_create_initial_content( $args = array() ) {
225 215
226 216 // Cannot use bbp_get_current_user_id() during activation process
@@ -275,9 +265,9 @@
275 265 'post_content' => $r['topic_content'],
276 266 'post_date' => $topic_time,
277 267 ),
278 268 array(
279 - 'forum_id' => $forum_id
269 + 'forum_id' => $forum_id
280 270 )
281 271 );
282 272
283 273 // Create the initial reply
@@ -288,10 +278,10 @@
288 278 'post_content' => $r['reply_content'],
289 279 'post_date' => $reply_time
290 280 ),
291 281 array(
292 - 'forum_id' => $forum_id,
293 - 'topic_id' => $topic_id
282 + 'forum_id' => $forum_id,
283 + 'topic_id' => $topic_id
294 284 )
295 285 );
296 286
297 287 return array(
@@ -450,15 +440,15 @@
450 440 bbp_delete_rewrite_rules();
451 441 }
452 442
453 443 /**
454 - * Redirect user to the "What's New" page on activation.
444 + * Redirect user to the "What's New" page on activation
455 445 *
456 446 * @since 2.2.0 bbPress (r4390)
457 447 *
458 - * @internal Used internally to redirect bbPress to the about page on activation.
448 + * @internal Used internally to redirect bbPress to the about page on activation
459 449 *
460 - * @return If network admin or bulk activation.
450 + * @return If network admin or bulk activation
461 451 */
462 452 function bbp_add_activation_redirect() {
463 453
464 454 // Bail if activating from network, or bulk
@@ -470,15 +460,15 @@
470 460 update_user_option( get_current_user_id(), '_bbp_activation_redirect', true );
471 461 }
472 462
473 463 /**
474 - * Redirect user to "What's New" page on activation.
464 + * Redirect user to "What's New" page on activation
475 465 *
476 466 * @since 2.2.0 bbPress (r4390)
477 467 *
478 - * @internal Used internally to redirect bbPress to the about page on activation.
468 + * @internal Used internally to redirect bbPress to the about page on activation
479 469 *
480 - * @return If no transient, or in network admin, or is bulk activation.
470 + * @return If no transient, or in network admin, or is bulk activation
481 471 */
482 472 function bbp_do_activation_redirect() {
483 473
484 474 // Bail if no redirect trigger
@@ -504,16 +494,16 @@
504 494 }
505 495
506 496 /**
507 497 * Hooked to the 'bbp_activate' action, this helper function automatically makes
508 - * the current user a Keymaster in the forums if they just activated bbPress,
498 + * the current user a Key Master in the forums if they just activated bbPress,
509 499 * regardless of the bbp_allow_global_access() setting.
510 500 *
511 501 * @since 2.4.0 bbPress (r4910)
512 502 *
513 - * @internal Used to internally make the current user a keymaster on activation.
503 + * @internal Used to internally make the current user a keymaster on activation
514 504 *
515 - * @return If user can't activate plugins or is already a keymaster.
505 + * @return If user can't activate plugins or is already a keymaster
516 506 */
517 507 function bbp_make_current_user_keymaster() {
518 508
519 509 // Catch all, to prevent premature user initialization
@@ -557,13 +547,13 @@
557 547
558 548 /** Pending Upgrades **********************************************************/
559 549
560 550 /**
561 - * Return the number of pending upgrades.
551 + * Return the number of pending upgrades
562 552 *
563 553 * @since 2.6.0 bbPress (r6896)
564 554 *
565 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
555 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
566 556 *
567 557 * @return int
568 558 */
569 559 function bbp_get_pending_upgrade_count( $type = '' ) {
@@ -570,13 +560,13 @@
570 560 return count( (array) bbp_get_pending_upgrades( $type ) );
571 561 }
572 562
573 563 /**
574 - * Return an array of pending upgrades.
564 + * Return an array of pending upgrades
575 565 *
576 566 * @since 2.6.0 bbPress (r6896)
577 567 *
578 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
568 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
579 569 *
580 570 * @return array
581 571 */
582 572 function bbp_get_pending_upgrades( $type = '' ) {
@@ -594,9 +584,9 @@
594 584 return (array) $retval;
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 (r6896)
601 591 *
602 592 * @param string $upgrade_id
@@ -615,9 +605,9 @@
615 605 return update_option( '_bbp_db_pending_upgrades', $pending );
616 606 }
617 607
618 608 /**
619 - * Add an upgrade ID to pending upgrades array.
609 + * Add an upgrade ID to pending upgrades array
620 610 *
621 611 * @since 2.6.0 bbPress (r6896)
622 612 *
623 613 * @param string $upgrade_id
@@ -639,9 +629,9 @@
639 629 return update_option( '_bbp_db_pending_upgrades', $pending );
640 630 }
641 631
642 632 /**
643 - * Delete all pending upgrades.
633 + * Delete all pending upgrades
644 634 *
645 635 * @since 2.6.0 bbPress (r6896)
646 636 */
647 637 function bbp_clear_pending_upgrades() {
@@ -648,18 +638,18 @@
648 638 return delete_option( '_bbp_db_pending_upgrades' );
649 639 }
650 640
651 641 /**
652 - * Maybe append an upgrade count to a string.
642 + * Maybe append an upgrade count to a string
653 643 *
654 644 * @since 2.6.0 bbPress (r6897)
655 645 *
656 - * @param string $text Text to append count to.
657 - * @param string $type Type of pending upgrades (upgrade|repair|empty).
646 + * @param string $string Text to append count to
647 + * @param string $type Type of pending upgrades (upgrade|repair|empty)
658 648 *
659 649 * @return string
660 650 */
661 -function bbp_maybe_append_pending_upgrade_count( $text = '', $type = '' ) {
651 +function bbp_maybe_append_pending_upgrade_count( $string = '', $type = '' ) {
662 652
663 653 // Look for an upgrade count
664 654 $count = bbp_get_pending_upgrade_count( $type );
665 655
@@ -665,10 +655,10 @@
665 655
666 656 // Append the count to the string
667 657 if ( ! empty( $count ) ) {
668 658 $suffix = ' <span class="awaiting-mod count-' . absint( $count ) . '"><span class="pending-count">' . bbp_number_format( $count ) . '</span></span>';
669 - $text = "{$text}{$suffix}";
659 + $string = "{$string}{$suffix}";
670 660 }
671 661
672 - // Return the text, maybe with a count
673 - return $text;
662 + // Return the string, maybe with a count
663 + return $string;
674 664 }