Changeset 6178
- Timestamp:
- 12/18/2016 04:13:15 PM (4 years ago)
- Location:
- trunk/src/includes/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/forums.php
r6141 r6178 24 24 25 25 /** 26 * @var The post type of this admin component26 * @var string The post type of this admin component 27 27 */ 28 28 private $post_type = ''; 29 30 /** 31 * @var WP_Screen The current screen object 32 */ 33 private $screen; 29 34 30 35 /** Functions *************************************************************/ … … 95 100 */ 96 101 private function bail() { 97 if ( $this->post_type != get_current_screen()->post_type ) { 102 103 // Not for a post type 104 if ( empty( $this->screen->post_type ) ) { 105 return true; 106 } 107 108 // Not this post type 109 if ( $this->post_type != $this->screen->post_type ) { 98 110 return true; 99 111 } … … 111 123 private function setup_globals() { 112 124 $this->post_type = bbp_get_forum_post_type(); 125 $this->screen = get_current_screen(); 113 126 } 114 127 … … 129 142 130 143 // Overview 131 get_current_screen()->add_help_tab( array(144 $this->screen->add_help_tab( array( 132 145 'id' => 'overview', 133 146 'title' => __( 'Overview', 'bbpress' ), … … 137 150 138 151 // Screen Content 139 get_current_screen()->add_help_tab( array(152 $this->screen->add_help_tab( array( 140 153 'id' => 'screen-content', 141 154 'title' => __( 'Screen Content', 'bbpress' ), … … 150 163 151 164 // Available Actions 152 get_current_screen()->add_help_tab( array(165 $this->screen->add_help_tab( array( 153 166 'id' => 'action-links', 154 167 'title' => __( 'Available Actions', 'bbpress' ), … … 163 176 164 177 // Bulk Actions 165 get_current_screen()->add_help_tab( array(178 $this->screen->add_help_tab( array( 166 179 'id' => 'bulk-actions', 167 180 'title' => __( 'Bulk Actions', 'bbpress' ), … … 172 185 173 186 // Help Sidebar 174 get_current_screen()->set_help_sidebar(187 $this->screen->set_help_sidebar( 175 188 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 176 189 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . … … 184 197 * @since 2.0.0 bbPress (r3119) 185 198 * 186 * @uses get_current_screen()199 * @uses $this->screen 187 200 */ 188 201 public function new_help() { … … 194 207 $customize_display = '<p>' . __( 'The title field and the big forum 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>'; 195 208 196 get_current_screen()->add_help_tab( array(209 $this->screen->add_help_tab( array( 197 210 'id' => 'customize-display', 198 211 'title' => __( 'Customizing This Display', 'bbpress' ), … … 200 213 ) ); 201 214 202 get_current_screen()->add_help_tab( array(215 $this->screen->add_help_tab( array( 203 216 'id' => 'title-forum-editor', 204 217 'title' => __( 'Title and Forum Editor', 'bbpress' ), … … 214 227 } 215 228 216 get_current_screen()->add_help_tab( array(229 $this->screen->add_help_tab( array( 217 230 'id' => 'forum-attributes', 218 231 'title' => __( 'Forum Attributes', 'bbpress' ), … … 228 241 ) ); 229 242 230 get_current_screen()->add_help_tab( array(243 $this->screen->add_help_tab( array( 231 244 'id' => 'publish-box', 232 245 'title' => __( 'Publish Box', 'bbpress' ), … … 234 247 ) ); 235 248 236 get_current_screen()->set_help_sidebar(249 $this->screen->set_help_sidebar( 237 250 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 238 251 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . -
trunk/src/includes/admin/replies.php
r6141 r6178 28 28 private $post_type = ''; 29 29 30 /** 31 * @var WP_Screen The current screen object 32 */ 33 private $screen; 34 30 35 /** Functions *************************************************************/ 31 36 … … 107 112 */ 108 113 private function bail() { 109 if ( $this->post_type !== get_current_screen()->post_type ) { 114 115 // Not for a post type 116 if ( empty( $this->screen->post_type ) ) { 110 117 return true; 111 118 } 112 119 120 // Not this post type 121 if ( $this->post_type != $this->screen->post_type ) { 122 return true; 123 } 124 113 125 return false; 114 126 } … … 122 134 */ 123 135 private function setup_globals() { 124 $this->post_type = bbp_get_reply_post_type(); 136 $this->post_type = bbp_get_forum_post_type(); 137 $this->screen = $this->screen; 125 138 } 126 139 … … 141 154 142 155 // Overview 143 get_current_screen()->add_help_tab( array(156 $this->screen->add_help_tab( array( 144 157 'id' => 'overview', 145 158 'title' => __( 'Overview', 'bbpress' ), … … 149 162 150 163 // Screen Content 151 get_current_screen()->add_help_tab( array(164 $this->screen->add_help_tab( array( 152 165 'id' => 'screen-content', 153 166 'title' => __( 'Screen Content', 'bbpress' ), … … 163 176 164 177 // Available Actions 165 get_current_screen()->add_help_tab( array(178 $this->screen->add_help_tab( array( 166 179 'id' => 'action-links', 167 180 'title' => __( 'Available Actions', 'bbpress' ), … … 179 192 180 193 // Bulk Actions 181 get_current_screen()->add_help_tab( array(194 $this->screen->add_help_tab( array( 182 195 'id' => 'bulk-actions', 183 196 'title' => __( 'Bulk Actions', 'bbpress' ), … … 188 201 189 202 // Help Sidebar 190 get_current_screen()->set_help_sidebar(203 $this->screen->set_help_sidebar( 191 204 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 192 205 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . … … 200 213 * @since 2.0.0 bbPress (r3119) 201 214 * 202 * @uses get_current_screen()215 * @uses $this->screen 203 216 */ 204 217 public function new_help() { … … 210 223 $customize_display = '<p>' . __( 'The title field and the big reply 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>'; 211 224 212 get_current_screen()->add_help_tab( array(225 $this->screen->add_help_tab( array( 213 226 'id' => 'customize-display', 214 227 'title' => __( 'Customizing This Display', 'bbpress' ), … … 216 229 ) ); 217 230 218 get_current_screen()->add_help_tab( array(231 $this->screen->add_help_tab( array( 219 232 'id' => 'title-reply-editor', 220 233 'title' => __( 'Title and Reply Editor', 'bbpress' ), … … 230 243 } 231 244 232 get_current_screen()->add_help_tab( array(245 $this->screen->add_help_tab( array( 233 246 'id' => 'reply-attributes', 234 247 'title' => __( 'Reply Attributes', 'bbpress' ), … … 242 255 ) ); 243 256 244 get_current_screen()->add_help_tab( array(257 $this->screen->add_help_tab( array( 245 258 'id' => 'publish-box', 246 259 'title' => __( 'Publish Box', 'bbpress' ), … … 248 261 ) ); 249 262 250 get_current_screen()->set_help_sidebar(263 $this->screen->set_help_sidebar( 251 264 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 252 265 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . -
trunk/src/includes/admin/topics.php
r6141 r6178 28 28 private $post_type = ''; 29 29 30 /** 31 * @var WP_Screen The current screen object 32 */ 33 private $screen; 34 30 35 /** Functions *************************************************************/ 31 36 … … 108 113 */ 109 114 private function bail() { 110 if ( $this->post_type !== get_current_screen()->post_type ) { 115 116 // Not for a post type 117 if ( empty( $this->screen->post_type ) ) { 111 118 return true; 112 119 } 113 120 121 // Not this post type 122 if ( $this->post_type != $this->screen->post_type ) { 123 return true; 124 } 125 114 126 return false; 115 127 } … … 123 135 */ 124 136 private function setup_globals() { 125 $this->post_type = bbp_get_topic_post_type(); 137 $this->post_type = bbp_get_forum_post_type(); 138 $this->screen = get_current_screen(); 126 139 } 127 140 … … 142 155 143 156 // Overview 144 get_current_screen()->add_help_tab( array(157 $this->screen->add_help_tab( array( 145 158 'id' => 'overview', 146 159 'title' => __( 'Overview', 'bbpress' ), … … 150 163 151 164 // Screen Content 152 get_current_screen()->add_help_tab( array(165 $this->screen->add_help_tab( array( 153 166 'id' => 'screen-content', 154 167 'title' => __( 'Screen Content', 'bbpress' ), … … 164 177 165 178 // Available Actions 166 get_current_screen()->add_help_tab( array(179 $this->screen->add_help_tab( array( 167 180 'id' => 'action-links', 168 181 'title' => __( 'Available Actions', 'bbpress' ), … … 182 195 183 196 // Bulk Actions 184 get_current_screen()->add_help_tab( array(197 $this->screen->add_help_tab( array( 185 198 'id' => 'bulk-actions', 186 199 'title' => __( 'Bulk Actions', 'bbpress' ), … … 191 204 192 205 // Help Sidebar 193 get_current_screen()->set_help_sidebar(206 $this->screen->set_help_sidebar( 194 207 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 195 208 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . … … 203 216 * @since 2.0.0 bbPress (r3119) 204 217 * 205 * @uses get_current_screen()218 * @uses $this->screen 206 219 */ 207 220 public function new_help() { … … 213 226 $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>'; 214 227 215 get_current_screen()->add_help_tab( array(228 $this->screen->add_help_tab( array( 216 229 'id' => 'customize-display', 217 230 'title' => __( 'Customizing This Display', 'bbpress' ), … … 219 232 ) ); 220 233 221 get_current_screen()->add_help_tab( array(234 $this->screen->add_help_tab( array( 222 235 'id' => 'title-topic-editor', 223 236 'title' => __( 'Title and Topic Editor', 'bbpress' ), … … 233 246 } 234 247 235 get_current_screen()->add_help_tab( array(248 $this->screen->add_help_tab( array( 236 249 'id' => 'topic-attributes', 237 250 'title' => __( 'Topic Attributes', 'bbpress' ), … … 244 257 ) ); 245 258 246 get_current_screen()->add_help_tab( array(259 $this->screen->add_help_tab( array( 247 260 'id' => 'publish-box', 248 261 'title' => __( 'Publish Box', 'bbpress' ), … … 250 263 ) ); 251 264 252 get_current_screen()->set_help_sidebar(265 $this->screen->set_help_sidebar( 253 266 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 254 267 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
Note: See TracChangeset
for help on using the changeset viewer.