Changeset 6419
- Timestamp:
- 05/19/2017 04:52:16 PM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/admin.php
r6395 r6419 181 181 add_filter( 'bbp_map_meta_caps', array( $this, 'map_settings_meta_caps' ), 10, 4 ); 182 182 183 // Hide the theme compat package selection184 add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );185 186 183 // Allow keymasters to save forums settings 187 184 add_filter( 'option_page_capability_bbpress', array( $this, 'option_page_capability_bbpress' ) ); … … 247 244 248 245 // Are settings enabled? 249 if ( !bbp_settings_integration() ) {246 if ( 'basic' === bbp_settings_integration() ) { 250 247 add_options_page( 251 248 __( 'Forums', 'bbpress' ), … … 369 366 370 367 // Toggle the section if core integration is on 371 if ( ( true=== $settings_integration ) && ! empty( $section['page'] ) ) {368 if ( ( 'deep' === $settings_integration ) && ! empty( $section['page'] ) ) { 372 369 $page = $section['page']; 373 370 } else { … … 668 665 array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' ) 669 666 ); 670 }671 672 /**673 * Hide theme compat package selection if only 1 package is registered674 *675 * @since 2.2.0 bbPress (r4315)676 *677 * @param array $sections Forums settings sections678 * @return array679 */680 public function hide_theme_compat_packages( $sections = array() ) {681 if ( count( bbpress()->theme_compat->packages ) <= 1 ) {682 unset( $sections['bbp_settings_theme_compat'] );683 }684 685 return $sections;686 667 } 687 668 -
trunk/src/includes/admin/settings.php
r6321 r6419 23 23 return (array) apply_filters( 'bbp_admin_get_settings_sections', array( 24 24 'bbp_settings_users' => array( 25 'title' => __( 'Forum User Settings', 'bbpress' ),25 'title' => esc_html__( 'Forum User Settings', 'bbpress' ), 26 26 'callback' => 'bbp_admin_setting_callback_user_section', 27 27 'page' => 'discussion' 28 28 ), 29 29 'bbp_settings_features' => array( 30 'title' => __( 'Forum Features', 'bbpress' ),30 'title' => esc_html__( 'Forum Features', 'bbpress' ), 31 31 'callback' => 'bbp_admin_setting_callback_features_section', 32 32 'page' => 'discussion' 33 33 ), 34 34 'bbp_settings_theme_compat' => array( 35 'title' => __( 'Forum Theme Packages', 'bbpress' ),35 'title' => esc_html__( 'Forum Theme Packages', 'bbpress' ), 36 36 'callback' => 'bbp_admin_setting_callback_subtheme_section', 37 37 'page' => 'general' 38 38 ), 39 39 'bbp_settings_per_page' => array( 40 'title' => __( 'Topics and Replies Per Page', 'bbpress' ),40 'title' => esc_html__( 'Topics and Replies Per Page', 'bbpress' ), 41 41 'callback' => 'bbp_admin_setting_callback_per_page_section', 42 42 'page' => 'reading' 43 43 ), 44 44 'bbp_settings_per_rss_page' => array( 45 'title' => __( 'Topics and Replies Per RSS Page', 'bbpress' ),45 'title' => esc_html__( 'Topics and Replies Per RSS Page', 'bbpress' ), 46 46 'callback' => 'bbp_admin_setting_callback_per_rss_page_section', 47 47 'page' => 'reading', 48 48 ), 49 49 'bbp_settings_root_slugs' => array( 50 'title' => __( 'Forum Root Slug', 'bbpress' ),50 'title' => esc_html__( 'Forum Root Slug', 'bbpress' ), 51 51 'callback' => 'bbp_admin_setting_callback_root_slug_section', 52 52 'page' => 'permalink' 53 53 ), 54 54 'bbp_settings_single_slugs' => array( 55 'title' => __( 'Single Forum Slugs', 'bbpress' ),55 'title' => esc_html__( 'Single Forum Slugs', 'bbpress' ), 56 56 'callback' => 'bbp_admin_setting_callback_single_slug_section', 57 57 'page' => 'permalink', 58 58 ), 59 59 'bbp_settings_user_slugs' => array( 60 'title' => __( 'Forum User Slugs', 'bbpress' ),60 'title' => esc_html__( 'Forum User Slugs', 'bbpress' ), 61 61 'callback' => 'bbp_admin_setting_callback_user_slug_section', 62 62 'page' => 'permalink', 63 63 ), 64 64 'bbp_settings_buddypress' => array( 65 'title' => __( 'BuddyPress Integration', 'bbpress' ),65 'title' => esc_html__( 'BuddyPress Integration', 'bbpress' ), 66 66 'callback' => 'bbp_admin_setting_callback_buddypress_section', 67 67 'page' => 'buddypress', 68 68 ), 69 69 'bbp_settings_akismet' => array( 70 'title' => __( 'Akismet Integration', 'bbpress' ),70 'title' => esc_html__( 'Akismet Integration', 'bbpress' ), 71 71 'callback' => 'bbp_admin_setting_callback_akismet_section', 72 72 'page' => 'discussion' … … 91 91 // Edit lock setting 92 92 '_bbp_edit_lock' => array( 93 'title' => __( 'Disallow editing after', 'bbpress' ),93 'title' => esc_html__( 'Disallow editing after', 'bbpress' ), 94 94 'callback' => 'bbp_admin_setting_callback_editlock', 95 95 'sanitize_callback' => 'intval', … … 99 99 // Throttle setting 100 100 '_bbp_throttle_time' => array( 101 'title' => __( 'Throttle posting every', 'bbpress' ),101 'title' => esc_html__( 'Throttle posting every', 'bbpress' ), 102 102 'callback' => 'bbp_admin_setting_callback_throttle', 103 103 'sanitize_callback' => 'intval', … … 107 107 // Allow anonymous posting setting 108 108 '_bbp_allow_anonymous' => array( 109 'title' => __( 'Anonymous posting', 'bbpress' ),109 'title' => esc_html__( 'Anonymous posting', 'bbpress' ), 110 110 'callback' => 'bbp_admin_setting_callback_anonymous', 111 111 'sanitize_callback' => 'intval', … … 115 115 // Allow global access (on multisite) 116 116 '_bbp_allow_global_access' => array( 117 'title' => __( 'Auto role', 'bbpress' ),117 'title' => esc_html__( 'Auto role', 'bbpress' ), 118 118 'callback' => 'bbp_admin_setting_callback_global_access', 119 119 'sanitize_callback' => 'intval', … … 134 134 // Allow topic and reply revisions 135 135 '_bbp_allow_revisions' => array( 136 'title' => __( 'Revisions', 'bbpress' ),136 'title' => esc_html__( 'Revisions', 'bbpress' ), 137 137 'callback' => 'bbp_admin_setting_callback_revisions', 138 138 'sanitize_callback' => 'intval', … … 142 142 // Allow favorites setting 143 143 '_bbp_enable_favorites' => array( 144 'title' => __( 'Favorites', 'bbpress' ),144 'title' => esc_html__( 'Favorites', 'bbpress' ), 145 145 'callback' => 'bbp_admin_setting_callback_favorites', 146 146 'sanitize_callback' => 'intval', … … 150 150 // Allow subscriptions setting 151 151 '_bbp_enable_subscriptions' => array( 152 'title' => __( 'Subscriptions', 'bbpress' ),152 'title' => esc_html__( 'Subscriptions', 'bbpress' ), 153 153 'callback' => 'bbp_admin_setting_callback_subscriptions', 154 154 'sanitize_callback' => 'intval', … … 158 158 // Allow engagements setting 159 159 '_bbp_enable_engagements' => array( 160 'title' => __( 'Engagements', 'bbpress' ),160 'title' => esc_html__( 'Engagements', 'bbpress' ), 161 161 'callback' => 'bbp_admin_setting_callback_engagements', 162 162 'sanitize_callback' => 'intval', … … 166 166 // Allow topic tags 167 167 '_bbp_allow_topic_tags' => array( 168 'title' => __( 'Topic tags', 'bbpress' ),168 'title' => esc_html__( 'Topic tags', 'bbpress' ), 169 169 'callback' => 'bbp_admin_setting_callback_topic_tags', 170 170 'sanitize_callback' => 'intval', … … 174 174 // Allow per-forum moderators 175 175 '_bbp_allow_forum_mods' => array( 176 'title' => __( 'Forum Moderators', 'bbpress' ),176 'title' => esc_html__( 'Forum Moderators', 'bbpress' ), 177 177 'callback' => 'bbp_admin_setting_callback_forum_mods', 178 178 'sanitize_callback' => 'intval', … … 182 182 // Allow topic tags 183 183 '_bbp_allow_search' => array( 184 'title' => __( 'Search', 'bbpress' ),184 'title' => esc_html__( 'Search', 'bbpress' ), 185 185 'callback' => 'bbp_admin_setting_callback_search', 186 186 'sanitize_callback' => 'intval', … … 190 190 // Allow fancy editor setting 191 191 '_bbp_use_wp_editor' => array( 192 'title' => __( 'Post Formatting', 'bbpress' ),192 'title' => esc_html__( 'Post Formatting', 'bbpress' ), 193 193 'callback' => 'bbp_admin_setting_callback_use_wp_editor', 194 194 'args' => array(), … … 198 198 // Allow auto embedding setting 199 199 '_bbp_use_autoembed' => array( 200 'title' => __( 'Auto-embed links', 'bbpress' ),200 'title' => esc_html__( 'Auto-embed links', 'bbpress' ), 201 201 'callback' => 'bbp_admin_setting_callback_use_autoembed', 202 202 'sanitize_callback' => 'intval', … … 206 206 // Set reply threading level 207 207 '_bbp_thread_replies_depth' => array( 208 'title' => __( 'Reply Threading', 'bbpress' ),208 'title' => esc_html__( 'Reply Threading', 'bbpress' ), 209 209 'callback' => 'bbp_admin_setting_callback_thread_replies_depth', 210 210 'sanitize_callback' => 'intval', … … 225 225 // Theme package setting 226 226 '_bbp_theme_package_id' => array( 227 'title' => __( 'Current Package', 'bbpress' ),227 'title' => esc_html__( 'Current Package', 'bbpress' ), 228 228 'callback' => 'bbp_admin_setting_callback_subtheme_id', 229 229 'sanitize_callback' => 'esc_sql', … … 238 238 // Replies per page setting 239 239 '_bbp_topics_per_page' => array( 240 'title' => __( 'Topics', 'bbpress' ),240 'title' => esc_html__( 'Topics', 'bbpress' ), 241 241 'callback' => 'bbp_admin_setting_callback_topics_per_page', 242 242 'sanitize_callback' => 'intval', … … 246 246 // Replies per page setting 247 247 '_bbp_replies_per_page' => array( 248 'title' => __( 'Replies', 'bbpress' ),248 'title' => esc_html__( 'Replies', 'bbpress' ), 249 249 'callback' => 'bbp_admin_setting_callback_replies_per_page', 250 250 'sanitize_callback' => 'intval', … … 259 259 // Replies per page setting 260 260 '_bbp_topics_per_rss_page' => array( 261 'title' => __( 'Topics', 'bbpress' ),261 'title' => esc_html__( 'Topics', 'bbpress' ), 262 262 'callback' => 'bbp_admin_setting_callback_topics_per_rss_page', 263 263 'sanitize_callback' => 'intval', … … 267 267 // Replies per page setting 268 268 '_bbp_replies_per_rss_page' => array( 269 'title' => __( 'Replies', 'bbpress' ),269 'title' => esc_html__( 'Replies', 'bbpress' ), 270 270 'callback' => 'bbp_admin_setting_callback_replies_per_rss_page', 271 271 'sanitize_callback' => 'intval', … … 280 280 // Root slug setting 281 281 '_bbp_root_slug' => array( 282 'title' => __( 'Forum Root', 'bbpress' ),282 'title' => esc_html__( 'Forum Root', 'bbpress' ), 283 283 'callback' => 'bbp_admin_setting_callback_root_slug', 284 284 'sanitize_callback' => 'bbp_sanitize_slug', … … 288 288 // Include root setting 289 289 '_bbp_include_root' => array( 290 'title' => __( 'Forum Prefix', 'bbpress' ),290 'title' => esc_html__( 'Forum Prefix', 'bbpress' ), 291 291 'callback' => 'bbp_admin_setting_callback_include_root', 292 292 'sanitize_callback' => 'intval', … … 296 296 // What to show on Forum Root 297 297 '_bbp_show_on_root' => array( 298 'title' => __( 'Forum root should show', 'bbpress' ),298 'title' => esc_html__( 'Forum root should show', 'bbpress' ), 299 299 'callback' => 'bbp_admin_setting_callback_show_on_root', 300 300 'sanitize_callback' => 'sanitize_text_field', … … 309 309 // Forum slug setting 310 310 '_bbp_forum_slug' => array( 311 'title' => __( 'Forum', 'bbpress' ),311 'title' => esc_html__( 'Forum', 'bbpress' ), 312 312 'callback' => 'bbp_admin_setting_callback_forum_slug', 313 313 'sanitize_callback' => 'bbp_sanitize_slug', … … 317 317 // Topic slug setting 318 318 '_bbp_topic_slug' => array( 319 'title' => __( 'Topic', 'bbpress' ),319 'title' => esc_html__( 'Topic', 'bbpress' ), 320 320 'callback' => 'bbp_admin_setting_callback_topic_slug', 321 321 'sanitize_callback' => 'bbp_sanitize_slug', … … 325 325 // Topic tag slug setting 326 326 '_bbp_topic_tag_slug' => array( 327 'title' => __( 'Topic Tag', 'bbpress' ),327 'title' => esc_html__( 'Topic Tag', 'bbpress' ), 328 328 'callback' => 'bbp_admin_setting_callback_topic_tag_slug', 329 329 'sanitize_callback' => 'bbp_sanitize_slug', … … 333 333 // View slug setting 334 334 '_bbp_view_slug' => array( 335 'title' => __( 'Topic View', 'bbpress' ),335 'title' => esc_html__( 'Topic View', 'bbpress' ), 336 336 'callback' => 'bbp_admin_setting_callback_view_slug', 337 337 'sanitize_callback' => 'bbp_sanitize_slug', … … 349 349 // Search slug setting 350 350 '_bbp_search_slug' => array( 351 'title' => __( 'Search', 'bbpress' ),351 'title' => esc_html__( 'Search', 'bbpress' ), 352 352 'callback' => 'bbp_admin_setting_callback_search_slug', 353 353 'sanitize_callback' => 'bbp_sanitize_slug', … … 362 362 // User slug setting 363 363 '_bbp_user_slug' => array( 364 'title' => __( 'User Base', 'bbpress' ),364 'title' => esc_html__( 'User Base', 'bbpress' ), 365 365 'callback' => 'bbp_admin_setting_callback_user_slug', 366 366 'sanitize_callback' => 'bbp_sanitize_slug', … … 370 370 // Topics slug setting 371 371 '_bbp_topic_archive_slug' => array( 372 'title' => __( 'Topics Started', 'bbpress' ),372 'title' => esc_html__( 'Topics Started', 'bbpress' ), 373 373 'callback' => 'bbp_admin_setting_callback_topic_archive_slug', 374 374 'sanitize_callback' => 'bbp_sanitize_slug', … … 378 378 // Replies slug setting 379 379 '_bbp_reply_archive_slug' => array( 380 'title' => __( 'Replies Created', 'bbpress' ),380 'title' => esc_html__( 'Replies Created', 'bbpress' ), 381 381 'callback' => 'bbp_admin_setting_callback_reply_archive_slug', 382 382 'sanitize_callback' => 'bbp_sanitize_slug', … … 386 386 // Favorites slug setting 387 387 '_bbp_user_favs_slug' => array( 388 'title' => __( 'Favorite Topics', 'bbpress' ),388 'title' => esc_html__( 'Favorite Topics', 'bbpress' ), 389 389 'callback' => 'bbp_admin_setting_callback_user_favs_slug', 390 390 'sanitize_callback' => 'bbp_sanitize_slug', … … 394 394 // Subscriptions slug setting 395 395 '_bbp_user_subs_slug' => array( 396 'title' => __( 'Subscriptions', 'bbpress' ),396 'title' => esc_html__( 'Subscriptions', 'bbpress' ), 397 397 'callback' => 'bbp_admin_setting_callback_user_subs_slug', 398 398 'sanitize_callback' => 'bbp_sanitize_slug', … … 402 402 // Engagements slug setting 403 403 '_bbp_user_engagements_slug' => array( 404 'title' => __( 'Engagements', 'bbpress' ),404 'title' => esc_html__( 'Engagements', 'bbpress' ), 405 405 'callback' => 'bbp_admin_setting_callback_user_engagements_slug', 406 406 'sanitize_callback' => 'bbp_sanitize_slug', … … 415 415 // Are group forums enabled? 416 416 '_bbp_enable_group_forums' => array( 417 'title' => __( 'Enable Group Forums', 'bbpress' ),417 'title' => esc_html__( 'Enable Group Forums', 'bbpress' ), 418 418 'callback' => 'bbp_admin_setting_callback_group_forums', 419 419 'sanitize_callback' => 'intval', … … 423 423 // Group forums parent forum ID 424 424 '_bbp_group_forums_root_id' => array( 425 'title' => __( 'Group Forums Parent', 'bbpress' ),425 'title' => esc_html__( 'Group Forums Parent', 'bbpress' ), 426 426 'callback' => 'bbp_admin_setting_callback_group_forums_root_id', 427 427 'sanitize_callback' => 'intval', … … 436 436 // Should we use Akismet 437 437 '_bbp_enable_akismet' => array( 438 'title' => __( 'Use Akismet', 'bbpress' ),438 'title' => esc_html__( 'Use Akismet', 'bbpress' ), 439 439 'callback' => 'bbp_admin_setting_callback_akismet', 440 440 'sanitize_callback' => 'intval', … … 450 450 * @since 2.1.0 bbPress (r4001) 451 451 * 452 * @param string $section_id 452 * @param string $section_id ID of the section to get fields for 453 * @staticvar array $fields All of the available fields 453 454 * @return mixed False if section is invalid, array of fields otherwise. 454 455 */ 455 456 function bbp_admin_get_settings_fields_for_section( $section_id = '' ) { 457 static $fields = array(); 458 459 // Default return value 460 $retval = array(); 456 461 457 462 // Bail if section is empty … … 460 465 } 461 466 462 $fields = bbp_admin_get_settings_fields(); 463 $retval = isset( $fields[ $section_id ] ) 464 ? $fields[ $section_id ] 465 : false; 466 467 // Get all of the fields (so we can snag one section of them) 468 if ( empty( $fields ) ) { 469 $fields = bbp_admin_get_settings_fields(); 470 } 471 472 // Get the field by section 473 if ( isset( $fields[ $section_id ] ) ) { 474 $retval = $fields[ $section_id ]; 475 } 476 477 // Filter & return 467 478 return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id ); 468 479 } … … 974 985 $root_options = array( 975 986 'forums' => array( 976 'name' => __( 'Forum Index', 'bbpress' )987 'name' => esc_attr__( 'Forum Index', 'bbpress' ) 977 988 ), 978 989 'topics' => array( 979 'name' => __( 'Topics by Last Post', 'bbpress' )990 'name' => esc_attr__( 'Topics by Last Post', 'bbpress' ) 980 991 ) 981 992 ); ?> … … 1272 1283 bbp_dropdown( array( 1273 1284 'selected' => bbp_get_group_forums_root_id(), 1274 'show_none' => __( '— Forum root —', 'bbpress' ),1285 'show_none' => esc_attr__( '— Forum root —', 'bbpress' ), 1275 1286 'orderby' => 'title', 1276 1287 'order' => 'ASC', … … 1624 1635 $current_screen->add_help_tab( array( 1625 1636 'id' => 'overview', 1626 'title' => __( 'Overview', 'bbpress' ),1627 'content' => '<p>' . __( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' .1628 '<p>' . __( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>'1637 'title' => esc_html__( 'Overview', 'bbpress' ), 1638 'content' => '<p>' . esc_html__( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' . 1639 '<p>' . esc_html__( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>' 1629 1640 ) ); 1630 1641 … … 1632 1643 $current_screen->add_help_tab( array( 1633 1644 'id' => 'main_settings', 1634 'title' => __( 'Main Settings', 'bbpress' ),1635 'content' => '<p>' . __( 'In the Main Settings you have a number of options:', 'bbpress' ) . '</p>' .1645 'title' => esc_html__( 'Main Settings', 'bbpress' ), 1646 'content' => '<p>' . esc_html__( 'In the Main Settings you have a number of options:', 'bbpress' ) . '</p>' . 1636 1647 '<p>' . 1637 1648 '<ul>' . 1638 '<li>' . __( 'You can choose to lock a post after a certain number of minutes. "Locking post editing" will prevent the author from editing some amount of time after saving a post.', 'bbpress' ) . '</li>' .1639 '<li>' . __( '"Throttle time" is the amount of time required between posts from a single author. The higher the throttle time, the longer a user will need to wait between posting to the forum.', 'bbpress' ) . '</li>' .1640 '<li>' . __( 'Favorites are a way for users to save and later return to topics they favor. This is enabled by default.', 'bbpress' ) . '</li>' .1641 '<li>' . __( 'Subscriptions allow users to subscribe for notifications to topics that interest them. This is enabled by default.', 'bbpress' ) . '</li>' .1642 '<li>' . __( 'Topic-Tags allow users to filter topics between forums. This is enabled by default.', 'bbpress' ) . '</li>' .1643 '<li>' . __( '"Anonymous Posting" allows guest users who do not have accounts on your site to both create topics as well as replies.', 'bbpress' ) . '</li>' .1644 '<li>' . __( 'The Fancy Editor brings the luxury of the Visual editor and HTML editor from the traditional WordPress dashboard into your theme.', 'bbpress' ) . '</li>' .1645 '<li>' . __( 'Auto-embed will embed the media content from a URL directly into the replies. For example: links to Flickr and YouTube.', 'bbpress' ) . '</li>' .1649 '<li>' . esc_html__( 'You can choose to lock a post after a certain number of minutes. "Locking post editing" will prevent the author from editing some amount of time after saving a post.', 'bbpress' ) . '</li>' . 1650 '<li>' . esc_html__( '"Throttle time" is the amount of time required between posts from a single author. The higher the throttle time, the longer a user will need to wait between posting to the forum.', 'bbpress' ) . '</li>' . 1651 '<li>' . esc_html__( 'Favorites are a way for users to save and later return to topics they favor. This is enabled by default.', 'bbpress' ) . '</li>' . 1652 '<li>' . esc_html__( 'Subscriptions allow users to subscribe for notifications to topics that interest them. This is enabled by default.', 'bbpress' ) . '</li>' . 1653 '<li>' . esc_html__( 'Topic-Tags allow users to filter topics between forums. This is enabled by default.', 'bbpress' ) . '</li>' . 1654 '<li>' . esc_html__( '"Anonymous Posting" allows guest users who do not have accounts on your site to both create topics as well as replies.', 'bbpress' ) . '</li>' . 1655 '<li>' . esc_html__( 'The Fancy Editor brings the luxury of the Visual editor and HTML editor from the traditional WordPress dashboard into your theme.', 'bbpress' ) . '</li>' . 1656 '<li>' . esc_html__( 'Auto-embed will embed the media content from a URL directly into the replies. For example: links to Flickr and YouTube.', 'bbpress' ) . '</li>' . 1646 1657 '</ul>' . 1647 1658 '</p>' . 1648 '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'bbpress' ) . '</p>'1659 '<p>' . esc_html__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'bbpress' ) . '</p>' 1649 1660 ) ); 1650 1661 … … 1652 1663 $current_screen->add_help_tab( array( 1653 1664 'id' => 'per_page', 1654 'title' => __( 'Per Page', 'bbpress' ),1655 'content' => '<p>' . __( 'Per Page settings allow you to control the number of topics and replies appear on each page.', 'bbpress' ) . '</p>' .1656 '<p>' . __( 'This is comparable to the WordPress "Reading Settings" page, where you can set the number of posts that should show on blog pages and in feeds.', 'bbpress' ) . '</p>' .1657 '<p>' . __( 'These are broken up into two separate groups: one for what appears in your theme, another for RSS feeds.', 'bbpress' ) . '</p>'1665 'title' => esc_html__( 'Per Page', 'bbpress' ), 1666 'content' => '<p>' . esc_html__( 'Per Page settings allow you to control the number of topics and replies appear on each page.', 'bbpress' ) . '</p>' . 1667 '<p>' . esc_html__( 'This is comparable to the WordPress "Reading Settings" page, where you can set the number of posts that should show on blog pages and in feeds.', 'bbpress' ) . '</p>' . 1668 '<p>' . esc_html__( 'These are broken up into two separate groups: one for what appears in your theme, another for RSS feeds.', 'bbpress' ) . '</p>' 1658 1669 ) ); 1659 1670 … … 1661 1672 $current_screen->add_help_tab( array( 1662 1673 'id' => 'slus', 1663 'title' => __( 'Slugs', 'bbpress' ),1664 'content' => '<p>' . __( 'The Slugs section allows you to control the permalink structure for your forums.', 'bbpress' ) . '</p>' .1665 '<p>' . __( '"Archive Slugs" are used as the "root" for your forums and topics. If you combine these values with existing page slugs, bbPress will attempt to output the most correct title and content.', 'bbpress' ) . '</p>' .1666 '<p>' . __( '"Single Slugs" are used as a prefix when viewing an individual forum, topic, reply, user, or view.', 'bbpress' ) . '</p>' .1667 '<p>' . __( 'In the event of a slug collision with WordPress or BuddyPress, a warning will appear next to the problem slug(s).', 'bbpress' ) . '</p>'1674 'title' => esc_html__( 'Slugs', 'bbpress' ), 1675 'content' => '<p>' . esc_html__( 'The Slugs section allows you to control the permalink structure for your forums.', 'bbpress' ) . '</p>' . 1676 '<p>' . esc_html__( '"Archive Slugs" are used as the "root" for your forums and topics. If you combine these values with existing page slugs, bbPress will attempt to output the most correct title and content.', 'bbpress' ) . '</p>' . 1677 '<p>' . esc_html__( '"Single Slugs" are used as a prefix when viewing an individual forum, topic, reply, user, or view.', 'bbpress' ) . '</p>' . 1678 '<p>' . esc_html__( 'In the event of a slug collision with WordPress or BuddyPress, a warning will appear next to the problem slug(s).', 'bbpress' ) . '</p>' 1668 1679 ) ); 1669 1680 1670 1681 // Help Sidebar 1671 1682 $current_screen->set_help_sidebar( 1672 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .1683 '<p><strong>' . esc_html__( 'For more information:', 'bbpress' ) . '</strong></p>' . 1673 1684 '<p>' . __( '<a href="https://codex.bbpress.org" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . 1674 1685 '<p>' . __( '<a href="https://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>' … … 1764 1775 1765 1776 // Core Post Types 1766 'post_base' => array( 'name' => __( 'Posts', 'bbpress' ), 'default' => 'post', 'context' => 'WordPress' ),1767 'page_base' => array( 'name' => __( 'Pages', 'bbpress' ), 'default' => 'page', 'context' => 'WordPress' ),1768 'revision_base' => array( 'name' => __( 'Revisions', 'bbpress' ), 'default' => 'revision', 'context' => 'WordPress' ),1769 'attachment_base' => array( 'name' => __( 'Attachments', 'bbpress' ), 'default' => 'attachment', 'context' => 'WordPress' ),1770 'nav_menu_base' => array( 'name' => __( 'Menus', 'bbpress' ), 'default' => 'nav_menu_item', 'context' => 'WordPress' ),1777 'post_base' => array( 'name' => esc_html__( 'Posts', 'bbpress' ), 'default' => 'post', 'context' => 'WordPress' ), 1778 'page_base' => array( 'name' => esc_html__( 'Pages', 'bbpress' ), 'default' => 'page', 'context' => 'WordPress' ), 1779 'revision_base' => array( 'name' => esc_html__( 'Revisions', 'bbpress' ), 'default' => 'revision', 'context' => 'WordPress' ), 1780 'attachment_base' => array( 'name' => esc_html__( 'Attachments', 'bbpress' ), 'default' => 'attachment', 'context' => 'WordPress' ), 1781 'nav_menu_base' => array( 'name' => esc_html__( 'Menus', 'bbpress' ), 'default' => 'nav_menu_item', 'context' => 'WordPress' ), 1771 1782 1772 1783 // Post Tags 1773 'tag_base' => array( 'name' => __( 'Tag base', 'bbpress' ), 'default' => 'tag', 'context' => 'WordPress' ),1784 'tag_base' => array( 'name' => esc_html__( 'Tag base', 'bbpress' ), 'default' => 'tag', 'context' => 'WordPress' ), 1774 1785 1775 1786 // Post Categories 1776 'category_base' => array( 'name' => __( 'Category base', 'bbpress' ), 'default' => 'category', 'context' => 'WordPress' ),1787 'category_base' => array( 'name' => esc_html__( 'Category base', 'bbpress' ), 'default' => 'category', 'context' => 'WordPress' ), 1777 1788 1778 1789 /** bbPress Core ******************************************************/ 1779 1790 1780 1791 // Forum archive slug 1781 '_bbp_root_slug' => array( 'name' => __( 'Forums base', 'bbpress' ), 'default' => 'forums', 'context' => 'bbPress' ),1792 '_bbp_root_slug' => array( 'name' => esc_html__( 'Forums base', 'bbpress' ), 'default' => 'forums', 'context' => 'bbPress' ), 1782 1793 1783 1794 // Topic archive slug 1784 '_bbp_topic_archive_slug' => array( 'name' => __( 'Topics base', 'bbpress' ), 'default' => 'topics', 'context' => 'bbPress' ),1795 '_bbp_topic_archive_slug' => array( 'name' => esc_html__( 'Topics base', 'bbpress' ), 'default' => 'topics', 'context' => 'bbPress' ), 1785 1796 1786 1797 // Forum slug 1787 '_bbp_forum_slug' => array( 'name' => __( 'Forum slug', 'bbpress' ), 'default' => 'forum', 'context' => 'bbPress' ),1798 '_bbp_forum_slug' => array( 'name' => esc_html__( 'Forum slug', 'bbpress' ), 'default' => 'forum', 'context' => 'bbPress' ), 1788 1799 1789 1800 // Topic slug 1790 '_bbp_topic_slug' => array( 'name' => __( 'Topic slug', 'bbpress' ), 'default' => 'topic', 'context' => 'bbPress' ),1801 '_bbp_topic_slug' => array( 'name' => esc_html__( 'Topic slug', 'bbpress' ), 'default' => 'topic', 'context' => 'bbPress' ), 1791 1802 1792 1803 // Reply slug 1793 '_bbp_reply_slug' => array( 'name' => __( 'Reply slug', 'bbpress' ), 'default' => 'reply', 'context' => 'bbPress' ),1804 '_bbp_reply_slug' => array( 'name' => esc_html__( 'Reply slug', 'bbpress' ), 'default' => 'reply', 'context' => 'bbPress' ), 1794 1805 1795 1806 // User profile slug 1796 '_bbp_user_slug' => array( 'name' => __( 'User base', 'bbpress' ), 'default' => 'users', 'context' => 'bbPress' ),1807 '_bbp_user_slug' => array( 'name' => esc_html__( 'User base', 'bbpress' ), 'default' => 'users', 'context' => 'bbPress' ), 1797 1808 1798 1809 // View slug 1799 '_bbp_view_slug' => array( 'name' => __( 'View base', 'bbpress' ), 'default' => 'view', 'context' => 'bbPress' ),1810 '_bbp_view_slug' => array( 'name' => esc_html__( 'View base', 'bbpress' ), 'default' => 'view', 'context' => 'bbPress' ), 1800 1811 1801 1812 // Topic tag slug 1802 '_bbp_topic_tag_slug' => array( 'name' => __( 'Topic tag slug', 'bbpress' ), 'default' => 'topic-tag', 'context' => 'bbPress' ),1813 '_bbp_topic_tag_slug' => array( 'name' => esc_html__( 'Topic tag slug', 'bbpress' ), 'default' => 'topic-tag', 'context' => 'bbPress' ), 1803 1814 ) ); 1804 1815 … … 1812 1823 foreach ( $bp->pages as $page => $page_data ) { 1813 1824 $page_base = $page . '_base'; 1814 $page_title = sprintf( __( '%s page', 'bbpress' ), $page_data->title );1825 $page_title = sprintf( esc_html__( '%s page', 'bbpress' ), $page_data->title ); 1815 1826 $core_slugs[ $page_base ] = array( 1816 1827 'name' => $page_title, -
trunk/src/includes/core/options.php
r6323 r6419 48 48 '_bbp_theme_package_id' => 'default', // The ID for the current theme package 49 49 '_bbp_default_role' => bbp_get_participant_role(), // Default forums role 50 '_bbp_settings_integration' => 0, // Put settings into existing admin pages50 '_bbp_settings_integration' => 'basic', // How to integrate into wp-admin 51 51 52 52 /** Per Page **********************************************************/ … … 479 479 * Integrate settings into existing WordPress pages 480 480 * 481 * There are 3 possible modes: 482 * - 'basic' Traditional admin integration 483 * - 'compact' One "bbPress" top-level admin menu 484 * - 'deep' Deeply integrate with the WordPress admin interface 485 * 481 486 * @since 2.4.0 bbPress (r4932) 482 487 * … … 485 490 * @return bool To deeply integrate settings, or not 486 491 */ 487 function bbp_settings_integration( $default = 0 ) { 488 return (bool) apply_filters( 'bbp_settings_integration', (bool) get_option( '_bbp_settings_integration', $default ) ); 492 function bbp_settings_integration( $default = 'basic' ) { 493 494 // Get the option value 495 $integration = get_option( '_bbp_settings_integration', $default ); 496 497 // Back-compat for deep/basic (pre-2.6) 498 if ( is_numeric( $integration ) ) { 499 $integration = ( 1 === (int) $integration ) 500 ? 'deep' 501 : 'basic'; 502 } 503 504 // Fallback to 'none' if invalid 505 if ( ! in_array( $integration, array( 'basic', 'deep', 'compact' ), true ) ) { 506 $integration = 'basic'; 507 } 508 509 // Filter & return 510 return apply_filters( 'bbp_settings_integration', $integration, $default ); 489 511 } 490 512
Note: See TracChangeset
for help on using the changeset viewer.