Changeset 4070 for branches/plugin/bbp-admin/bbp-topics.php
- Timestamp:
- 07/08/2012 08:55:34 AM (14 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-admin/bbp-topics.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-topics.php
r4053 r4070 39 39 * @uses BBP_Topics_Admin::setup_help() Setup the help text 40 40 */ 41 function __construct() {41 public function __construct() { 42 42 $this->setup_globals(); 43 43 $this->setup_actions(); … … 56 56 * @uses bbp_get_reply_post_type() To get the reply post type 57 57 */ 58 function setup_actions() {58 private function setup_actions() { 59 59 60 60 // Add some general styling to the admin area … … 93 93 94 94 /** 95 * Should we bail out of this method? 96 * 97 * @since bbPress (r4067) 98 * @return boolean 99 */ 100 private function bail() { 101 if ( $this->post_type != get_current_screen()->post_type ) 102 return true; 103 104 return false; 105 } 106 107 /** 95 108 * Admin globals 96 109 * … … 98 111 * @access private 99 112 */ 100 function setup_globals() { 101 102 // Setup the post type for this admin component 113 private function setup_globals() { 103 114 $this->post_type = bbp_get_topic_post_type(); 104 115 } … … 113 124 */ 114 125 public function edit_help() { 126 127 if ( $this->bail() ) return; 115 128 116 129 // Overview … … 176 189 public function new_help() { 177 190 191 if ( $this->bail() ) return; 192 178 193 $customize_display = '<p>' . __( 'The title field and the big topic editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>'; 179 194 … … 243 258 * @uses do_action() Calls 'bbp_topic_attributes_metabox' 244 259 */ 245 function attributes_metabox() { 260 public function attributes_metabox() { 261 262 if ( $this->bail() ) return; 263 246 264 add_meta_box ( 247 265 'bbp_topic_attributes', … … 268 286 * @return int Parent id 269 287 */ 270 function attributes_metabox_save( $topic_id ) {288 public function attributes_metabox_save( $topic_id ) { 271 289 290 if ( $this->bail() ) return $topic_id; 291 272 292 // Bail if doing an autosave 273 293 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) … … 335 355 * id 336 356 */ 337 function author_metabox() { 357 public function author_metabox() { 358 359 if ( $this->bail() ) return; 338 360 339 361 // Bail if post_type is not a topic … … 370 392 * @return int Topic or reply id 371 393 */ 372 function author_metabox_save( $post_id ) { 394 public function author_metabox_save( $post_id ) { 395 396 if ( $this->bail() ) return $post_id; 373 397 374 398 // Bail if no post_id … … 410 434 * @uses do_action() Calls 'bbp_admin_head' 411 435 */ 412 function admin_head() { 436 public function admin_head() { 437 438 if ( $this->bail() ) return; 439 413 440 ?> 414 441 … … 489 516 * @uses wp_safe_redirect() Redirect the page to custom url 490 517 */ 491 function toggle_topic() { 518 public function toggle_topic() { 519 520 if ( $this->bail() ) return; 492 521 493 522 // Only proceed if GET is a topic toggle action … … 568 597 * message, topic id, notice and is it a failure 569 598 */ 570 function toggle_topic_notice() { 599 public function toggle_topic_notice() { 600 601 if ( $this->bail() ) return; 571 602 572 603 // Only proceed if GET is a topic toggle action … … 640 671 * @return array $columns bbPress topic columns 641 672 */ 642 function topics_column_headers( $columns ) { 673 public function topics_column_headers( $columns ) { 674 675 if ( $this->bail() ) return $columns; 676 643 677 $columns = array( 644 678 'cb' => '<input type="checkbox" />', … … 682 716 function topics_column_data( $column, $topic_id ) { 683 717 718 if ( $this->bail() ) return; 719 684 720 // Get topic forum ID 685 721 $forum_id = bbp_get_topic_forum_id( $topic_id ); … … 778 814 * @return array $actions Actions 779 815 */ 780 function topics_row_actions( $actions, $topic ) { 816 public function topics_row_actions( $actions, $topic ) { 817 818 if ( $this->bail() ) return $actions; 781 819 782 820 unset( $actions['inline hide-if-no-js'] ); … … 850 888 * @return bool False. If post type is not topic or reply 851 889 */ 852 function filter_dropdown() { 890 public function filter_dropdown() { 891 892 if ( $this->bail() ) return; 853 893 854 894 // Add Empty Spam button … … 882 922 function filter_post_rows( $query_vars ) { 883 923 924 if ( $this->bail() ) return $query_vars; 925 884 926 // Add post_parent query_var if one is present 885 927 if ( !empty( $_GET['bbp_forum_id'] ) ) { … … 907 949 * @return array 908 950 */ 909 function updated_messages( $messages ) {951 public function updated_messages( $messages ) { 910 952 global $post_ID; 953 954 if ( $this->bail() ) return $messages; 911 955 912 956 // URL for the current topic … … 974 1018 */ 975 1019 function bbp_admin_topics() { 976 global $typenow;977 978 if ( bbp_get_topic_post_type() != $typenow )979 return;980 981 1020 bbpress()->admin->topics = new BBP_Topics_Admin(); 982 1021 }
Note: See TracChangeset
for help on using the changeset viewer.