| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Forum Admin Class. | |
| 4 | + * bbPress Forum Admin Class | |
| 5 | 5 | * |
| 6 | 6 | * @package bbPress |
| 7 | 7 | * @subpackage Administration |
| 8 | 8 | */ |
| @@ -11,9 +11,9 @@ | ||
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | if ( ! class_exists( 'BBP_Forums_Admin' ) ) : |
| 14 | 14 | /** |
| 15 | - * Loads bbPress forums admin area. | |
| 15 | + * Loads bbPress forums admin area | |
| 16 | 16 | * |
| 17 | 17 | * @package bbPress |
| 18 | 18 | * @subpackage Administration |
| 19 | 19 | * @since 2.0.0 bbPress (r2464) |
| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | |
| 23 | 23 | /** Variables *************************************************************/ |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @var string The post type of this admin component. | |
| 26 | + * @var string The post type of this admin component | |
| 27 | 27 | */ |
| 28 | 28 | private $post_type = ''; |
| 29 | 29 | |
| 30 | 30 | /** Functions *************************************************************/ |
| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | |
| 30 | 30 | /** Functions *************************************************************/ |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * The main bbPress forums admin loader. | |
| 33 | + * The main bbPress forums admin loader | |
| 34 | 34 | * |
| 35 | 35 | * @since 2.0.0 bbPress (r2515) |
| 36 | 36 | */ |
| 37 | 37 | public function __construct() { |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | $this->setup_actions(); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Setup the admin hooks, actions and filters. | |
| 43 | + * Setup the admin hooks, actions and filters | |
| 44 | 44 | * |
| 45 | 45 | * @since 2.0.0 bbPress (r2646) |
| 46 | 46 | * |
| 47 | 47 | * @access private |
| @@ -72,17 +72,12 @@ | ||
| 72 | 72 | // Contextual Help |
| 73 | 73 | add_action( 'load-edit.php', array( $this, 'edit_help' ) ); |
| 74 | 74 | add_action( 'load-post.php', array( $this, 'new_help' ) ); |
| 75 | 75 | add_action( 'load-post-new.php', array( $this, 'new_help' ) ); |
| 76 | - | |
| 77 | - /** Dependencies ******************************************************/ | |
| 78 | - | |
| 79 | - // Allow plugins to modify these actions | |
| 80 | - do_action_ref_array( 'bbp_admin_forums_loaded', array( &$this ) ); | |
| 81 | 76 | } |
| 82 | 77 | |
| 83 | 78 | /** |
| 84 | - * Admin globals. | |
| 79 | + * Admin globals | |
| 85 | 80 | * |
| 86 | 81 | * @since 2.0.0 bbPress (r2646) |
| 87 | 82 | * |
| 88 | 83 | * @access private |
| @@ -93,9 +88,9 @@ | ||
| 93 | 88 | |
| 94 | 89 | /** Contextual Help *******************************************************/ |
| 95 | 90 | |
| 96 | 91 | /** |
| 97 | - * Contextual help for bbPress forum edit page. | |
| 92 | + * Contextual help for bbPress forum edit page | |
| 98 | 93 | * |
| 99 | 94 | * @since 2.0.0 bbPress (r3119) |
| 100 | 95 | */ |
| 101 | 96 | public function edit_help() { |
| @@ -160,9 +155,9 @@ | ||
| 160 | 155 | ); |
| 161 | 156 | } |
| 162 | 157 | |
| 163 | 158 | /** |
| 164 | - * Contextual help for bbPress forum edit page. | |
| 159 | + * Contextual help for bbPress forum edit page | |
| 165 | 160 | * |
| 166 | 161 | * @since 2.0.0 bbPress (r3119) |
| 167 | 162 | */ |
| 168 | 163 | public function new_help() { |
| @@ -224,9 +219,9 @@ | ||
| 224 | 219 | ); |
| 225 | 220 | } |
| 226 | 221 | |
| 227 | 222 | /** |
| 228 | - * Add the forum attributes meta-box. | |
| 223 | + * Add the forum attributes meta-box | |
| 229 | 224 | * |
| 230 | 225 | * @since 2.0.0 bbPress (r2746) |
| 231 | 226 | */ |
| 232 | 227 | public function attributes_metabox() { |
| @@ -237,9 +232,9 @@ | ||
| 237 | 232 | } |
| 238 | 233 | |
| 239 | 234 | add_meta_box( |
| 240 | 235 | 'bbp_forum_attributes', |
| 241 | - esc_html__( 'Attributes', 'bbpress' ), | |
| 236 | + esc_html__( 'Forum Attributes', 'bbpress' ), | |
| 242 | 237 | 'bbp_forum_metabox', |
| 243 | 238 | $this->post_type, |
| 244 | 239 | 'side', |
| 245 | 240 | 'high' |
| @@ -246,9 +241,9 @@ | ||
| 246 | 241 | ); |
| 247 | 242 | } |
| 248 | 243 | |
| 249 | 244 | /** |
| 250 | - * Add the forum moderators meta-box. | |
| 245 | + * Add the forum moderators meta-box | |
| 251 | 246 | * |
| 252 | 247 | * @since 2.6.0 bbPress |
| 253 | 248 | */ |
| 254 | 249 | public function moderators_metabox() { |
| @@ -260,9 +255,9 @@ | ||
| 260 | 255 | |
| 261 | 256 | // Moderators |
| 262 | 257 | add_meta_box( |
| 263 | 258 | 'bbp_moderator_assignment_metabox', |
| 264 | - esc_html__( 'Moderators', 'bbpress' ), | |
| 259 | + esc_html__( 'Forum Moderators', 'bbpress' ), | |
| 265 | 260 | 'bbp_moderator_assignment_metabox', |
| 266 | 261 | $this->post_type, |
| 267 | 262 | 'side', |
| 268 | 263 | 'high' |
| @@ -269,9 +264,9 @@ | ||
| 269 | 264 | ); |
| 270 | 265 | } |
| 271 | 266 | |
| 272 | 267 | /** |
| 273 | - * Add the subscriptions meta-box. | |
| 268 | + * Add the subscriptions meta-box | |
| 274 | 269 | * |
| 275 | 270 | * Allows viewing of users who have subscribed to a forum. |
| 276 | 271 | * |
| 277 | 272 | * @since 2.6.0 bbPress (r6197) |
| @@ -299,9 +294,9 @@ | ||
| 299 | 294 | ); |
| 300 | 295 | } |
| 301 | 296 | |
| 302 | 297 | /** |
| 303 | - * Remove comments & discussion meta-boxes if comments are not supported. | |
| 298 | + * Remove comments & discussion meta-boxes if comments are not supported | |
| 304 | 299 | * |
| 305 | 300 | * @since 2.6.0 bbPress (r6186) |
| 306 | 301 | */ |
| 307 | 302 | public function comments_metabox() { |
| @@ -311,14 +306,14 @@ | ||
| 311 | 306 | } |
| 312 | 307 | } |
| 313 | 308 | |
| 314 | 309 | /** |
| 315 | - * Pass the forum attributes for processing. | |
| 310 | + * Pass the forum attributes for processing | |
| 316 | 311 | * |
| 317 | 312 | * @since 2.0.0 bbPress (r2746) |
| 318 | 313 | * |
| 319 | - * @param int $forum_id Forum id. | |
| 320 | - * @return int Forum id. | |
| 314 | + * @param int $forum_id Forum id | |
| 315 | + * @return int Forum id | |
| 321 | 316 | */ |
| 322 | 317 | public function save_meta_boxes( $forum_id ) { |
| 323 | 318 | |
| 324 | 319 | // Bail if doing an autosave |
| @@ -369,11 +364,11 @@ | ||
| 369 | 364 | return $forum_id; |
| 370 | 365 | } |
| 371 | 366 | |
| 372 | 367 | /** |
| 373 | - * Toggle forum. | |
| 368 | + * Toggle forum | |
| 374 | 369 | * |
| 375 | - * Handles the admin-side opening/closing of forums. | |
| 370 | + * Handles the admin-side opening/closing of forums | |
| 376 | 371 | * |
| 377 | 372 | * @since 2.6.0 bbPress (r5254) |
| 378 | 373 | */ |
| 379 | 374 | public function toggle_forum() { |
| @@ -442,9 +437,9 @@ | ||
| 442 | 437 | bbp_redirect( $redirect ); |
| 443 | 438 | } |
| 444 | 439 | |
| 445 | 440 | /** |
| 446 | - * Toggle forum notices. | |
| 441 | + * Toggle forum notices | |
| 447 | 442 | * |
| 448 | 443 | * Display the success/error notices from |
| 449 | 444 | * {@link BBP_Admin::toggle_forum()} |
| 450 | 445 | * |
| @@ -507,9 +502,9 @@ | ||
| 507 | 502 | bbp_admin()->add_notice( $message, $class, true ); |
| 508 | 503 | } |
| 509 | 504 | |
| 510 | 505 | /** |
| 511 | - * Returns an array of keys used to sort row actions. | |
| 506 | + * Returns an array of keys used to sort row actions | |
| 512 | 507 | * |
| 513 | 508 | * @since 2.6.0 bbPress (r6771) |
| 514 | 509 | * |
| 515 | 510 | * @return array |
| @@ -536,9 +531,9 @@ | ||
| 536 | 531 | ); |
| 537 | 532 | } |
| 538 | 533 | |
| 539 | 534 | /** |
| 540 | - * Returns an array of notice toggles. | |
| 535 | + * Returns an array of notice toggles | |
| 541 | 536 | * |
| 542 | 537 | * @since 2.6.0 bbPress (r6396) |
| 543 | 538 | * |
| 544 | 539 | * @return array |
| @@ -544,16 +539,10 @@ | ||
| 544 | 539 | * @return array |
| 545 | 540 | */ |
| 546 | 541 | private function get_allowed_notice_toggles() { |
| 547 | 542 | |
| 548 | - /** | |
| 549 | - * Filters the allowed notice toggles. | |
| 550 | - * | |
| 551 | - * @since 2.6.0 bbPress (r6396) | |
| 552 | - * | |
| 553 | - * @param array $toggles The default notice toggles. | |
| 554 | - */ | |
| 555 | - return (array) apply_filters( | |
| 543 | + // Filter & return | |
| 544 | + return apply_filters( | |
| 556 | 545 | 'bbp_admin_forums_allowed_notice_toggles', |
| 557 | 546 | array( |
| 558 | 547 | 'opened', |
| 559 | 548 | 'closed' |
| @@ -561,9 +550,9 @@ | ||
| 561 | 550 | ); |
| 562 | 551 | } |
| 563 | 552 | |
| 564 | 553 | /** |
| 565 | - * Returns an array of notice toggles. | |
| 554 | + * Returns an array of notice toggles | |
| 566 | 555 | * |
| 567 | 556 | * @since 2.6.0 bbPress (r6396) |
| 568 | 557 | * |
| 569 | 558 | * @return array |
| @@ -585,15 +574,15 @@ | ||
| 585 | 574 | ); |
| 586 | 575 | } |
| 587 | 576 | |
| 588 | 577 | /** |
| 589 | - * Manage the column headers for the forums page. | |
| 578 | + * Manage the column headers for the forums page | |
| 590 | 579 | * |
| 591 | 580 | * @since 2.0.0 bbPress (r2485) |
| 592 | 581 | * |
| 593 | - * @param array $columns The columns. | |
| 582 | + * @param array $columns The columns | |
| 594 | 583 | * |
| 595 | - * @return array $columns bbPress forum columns. | |
| 584 | + * @return array $columns bbPress forum columns | |
| 596 | 585 | */ |
| 597 | 586 | public function column_headers( $columns ) { |
| 598 | 587 | |
| 599 | 588 | // Set list table column headers |
| @@ -612,25 +601,19 @@ | ||
| 612 | 601 | if ( ! bbp_allow_forum_mods() ) { |
| 613 | 602 | unset( $columns['bbp_forum_mods'] ); |
| 614 | 603 | } |
| 615 | 604 | |
| 616 | - /** | |
| 617 | - * Filters the column headers for the forums page. | |
| 618 | - * | |
| 619 | - * @since 2.0.0 bbPress (r2485) | |
| 620 | - * | |
| 621 | - * @param array $columns The column headers. | |
| 622 | - */ | |
| 623 | - return (array) apply_filters( 'bbp_admin_forums_column_headers', $columns ); | |
| 605 | + // Filter & return | |
| 606 | + return apply_filters( 'bbp_admin_forums_column_headers', $columns ); | |
| 624 | 607 | } |
| 625 | 608 | |
| 626 | 609 | /** |
| 627 | - * Print extra columns for the forums page. | |
| 610 | + * Print extra columns for the forums page | |
| 628 | 611 | * |
| 629 | 612 | * @since 2.0.0 bbPress (r2485) |
| 630 | 613 | * |
| 631 | - * @param string $column Column. | |
| 632 | - * @param int $forum_id Forum id. | |
| 614 | + * @param string $column Column | |
| 615 | + * @param int $forum_id Forum id | |
| 633 | 616 | */ |
| 634 | 617 | public function column_data( $column, $forum_id ) { |
| 635 | 618 | |
| 636 | 619 | switch ( $column ) { |
| @@ -678,19 +661,19 @@ | ||
| 678 | 661 | } |
| 679 | 662 | } |
| 680 | 663 | |
| 681 | 664 | /** |
| 682 | - * Forum Row actions. | |
| 665 | + * Forum Row actions | |
| 683 | 666 | * |
| 684 | 667 | * Remove the quick-edit action link and display the description under |
| 685 | - * the forum title and add the open/close links. | |
| 668 | + * the forum title and add the open/close links | |
| 686 | 669 | * |
| 687 | 670 | * @since 2.0.0 bbPress (r2577) |
| 688 | 671 | * |
| 689 | - * @param array $actions Actions. | |
| 690 | - * @param object $forum Forum object. | |
| 672 | + * @param array $actions Actions | |
| 673 | + * @param object $forum Forum object | |
| 691 | 674 | * |
| 692 | - * @return array $actions Actions. | |
| 675 | + * @return array $actions Actions | |
| 693 | 676 | */ |
| 694 | 677 | public function row_actions( $actions = array(), $forum = false ) { |
| 695 | 678 | |
| 696 | 679 | // Disable quick edit (too much to do here) |
| @@ -730,13 +713,13 @@ | ||
| 730 | 713 | return $this->sort_row_actions( $actions ); |
| 731 | 714 | } |
| 732 | 715 | |
| 733 | 716 | /** |
| 734 | - * Sort row actions by key. | |
| 717 | + * Sort row actions by key | |
| 735 | 718 | * |
| 736 | 719 | * @since 2.6.0 |
| 737 | 720 | * |
| 738 | - * @param array $actions. | |
| 721 | + * @param array $actions | |
| 739 | 722 | * |
| 740 | 723 | * @return array |
| 741 | 724 | */ |
| 742 | 725 | private function sort_row_actions( $actions = array() ) { |
| @@ -759,9 +742,9 @@ | ||
| 759 | 742 | return $retval + $actions; |
| 760 | 743 | } |
| 761 | 744 | |
| 762 | 745 | /** |
| 763 | - * Custom user feedback messages for forum post type. | |
| 746 | + * Custom user feedback messages for forum post type | |
| 764 | 747 | * |
| 765 | 748 | * @since 2.0.0 bbPress (r3080) |
| 766 | 749 | * |
| 767 | 750 | * @global int $post_ID |
| @@ -852,9 +835,9 @@ | ||
| 852 | 835 | } |
| 853 | 836 | endif; // class_exists check |
| 854 | 837 | |
| 855 | 838 | /** |
| 856 | - * Setup bbPress Forums Admin. | |
| 839 | + * Setup bbPress Forums Admin | |
| 857 | 840 | * |
| 858 | 841 | * This is currently here to make hooking and unhooking of the admin UI easy. |
| 859 | 842 | * It could use dependency injection in the future, but for now this is easier. |
| 860 | 843 | * |
| @@ -859,9 +842,9 @@ | ||
| 859 | 842 | * It could use dependency injection in the future, but for now this is easier. |
| 860 | 843 | * |
| 861 | 844 | * @since 2.0.0 bbPress (r2596) |
| 862 | 845 | * |
| 863 | - * @param WP_Screen $current_screen Current screen object. | |
| 846 | + * @param WP_Screen $current_screen Current screen object | |
| 864 | 847 | */ |
| 865 | 848 | function bbp_admin_forums( $current_screen ) { |
| 866 | 849 | |
| 867 | 850 | // Bail if not a forum screen |