| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Admin Settings. | |
| 4 | + * bbPress Admin Settings | |
| 5 | 5 | * |
| 6 | 6 | * @package bbPress |
| 7 | 7 | * @subpackage Administration |
| 8 | 8 | */ |
| @@ -21,79 +21,76 @@ | ||
| 21 | 21 | */ |
| 22 | 22 | function bbp_admin_get_settings_sections() { |
| 23 | 23 | |
| 24 | 24 | // Filter & return |
| 25 | - return (array) apply_filters( | |
| 26 | - 'bbp_admin_get_settings_sections', | |
| 27 | - array( | |
| 25 | + return (array) apply_filters( 'bbp_admin_get_settings_sections', array( | |
| 28 | 26 | |
| 29 | - // Settings | |
| 30 | - 'bbp_settings_users' => array( | |
| 31 | - 'title' => esc_html__( 'Forum User Settings', 'bbpress' ), | |
| 32 | - 'callback' => 'bbp_admin_setting_callback_user_section', | |
| 33 | - 'page' => 'discussion' | |
| 34 | - ), | |
| 35 | - 'bbp_settings_features' => array( | |
| 36 | - 'title' => esc_html__( 'Forum Features', 'bbpress' ), | |
| 37 | - 'callback' => 'bbp_admin_setting_callback_features_section', | |
| 38 | - 'page' => 'discussion' | |
| 39 | - ), | |
| 40 | - 'bbp_settings_theme_compat' => array( | |
| 41 | - 'title' => esc_html__( 'Forum Theme Packages', 'bbpress' ), | |
| 42 | - 'callback' => 'bbp_admin_setting_callback_subtheme_section', | |
| 43 | - 'page' => 'general' | |
| 44 | - ), | |
| 45 | - 'bbp_settings_per_page' => array( | |
| 46 | - 'title' => esc_html__( 'Topics and Replies Per Page', 'bbpress' ), | |
| 47 | - 'callback' => 'bbp_admin_setting_callback_per_page_section', | |
| 48 | - 'page' => 'reading' | |
| 49 | - ), | |
| 50 | - 'bbp_settings_per_rss_page' => array( | |
| 51 | - 'title' => esc_html__( 'Topics and Replies Per RSS Page', 'bbpress' ), | |
| 52 | - 'callback' => 'bbp_admin_setting_callback_per_rss_page_section', | |
| 53 | - 'page' => 'reading', | |
| 54 | - ), | |
| 55 | - 'bbp_settings_root_slugs' => array( | |
| 56 | - 'title' => esc_html__( 'Forum Root Slug', 'bbpress' ), | |
| 57 | - 'callback' => 'bbp_admin_setting_callback_root_slug_section', | |
| 58 | - 'page' => 'permalink' | |
| 59 | - ), | |
| 60 | - 'bbp_settings_single_slugs' => array( | |
| 61 | - 'title' => esc_html__( 'Forum Single Slugs', 'bbpress' ), | |
| 62 | - 'callback' => 'bbp_admin_setting_callback_single_slug_section', | |
| 63 | - 'page' => 'permalink', | |
| 64 | - ), | |
| 65 | - 'bbp_settings_user_slugs' => array( | |
| 66 | - 'title' => esc_html__( 'Forum User Slugs', 'bbpress' ), | |
| 67 | - 'callback' => 'bbp_admin_setting_callback_user_slug_section', | |
| 68 | - 'page' => 'permalink', | |
| 69 | - ), | |
| 27 | + // Settings | |
| 28 | + 'bbp_settings_users' => array( | |
| 29 | + 'title' => esc_html__( 'Forum User Settings', 'bbpress' ), | |
| 30 | + 'callback' => 'bbp_admin_setting_callback_user_section', | |
| 31 | + 'page' => 'discussion' | |
| 32 | + ), | |
| 33 | + 'bbp_settings_features' => array( | |
| 34 | + 'title' => esc_html__( 'Forum Features', 'bbpress' ), | |
| 35 | + 'callback' => 'bbp_admin_setting_callback_features_section', | |
| 36 | + 'page' => 'discussion' | |
| 37 | + ), | |
| 38 | + 'bbp_settings_theme_compat' => array( | |
| 39 | + 'title' => esc_html__( 'Forum Theme Packages', 'bbpress' ), | |
| 40 | + 'callback' => 'bbp_admin_setting_callback_subtheme_section', | |
| 41 | + 'page' => 'general' | |
| 42 | + ), | |
| 43 | + 'bbp_settings_per_page' => array( | |
| 44 | + 'title' => esc_html__( 'Topics and Replies Per Page', 'bbpress' ), | |
| 45 | + 'callback' => 'bbp_admin_setting_callback_per_page_section', | |
| 46 | + 'page' => 'reading' | |
| 47 | + ), | |
| 48 | + 'bbp_settings_per_rss_page' => array( | |
| 49 | + 'title' => esc_html__( 'Topics and Replies Per RSS Page', 'bbpress' ), | |
| 50 | + 'callback' => 'bbp_admin_setting_callback_per_rss_page_section', | |
| 51 | + 'page' => 'reading', | |
| 52 | + ), | |
| 53 | + 'bbp_settings_root_slugs' => array( | |
| 54 | + 'title' => esc_html__( 'Forum Root Slug', 'bbpress' ), | |
| 55 | + 'callback' => 'bbp_admin_setting_callback_root_slug_section', | |
| 56 | + 'page' => 'permalink' | |
| 57 | + ), | |
| 58 | + 'bbp_settings_single_slugs' => array( | |
| 59 | + 'title' => esc_html__( 'Forum Single Slugs', 'bbpress' ), | |
| 60 | + 'callback' => 'bbp_admin_setting_callback_single_slug_section', | |
| 61 | + 'page' => 'permalink', | |
| 62 | + ), | |
| 63 | + 'bbp_settings_user_slugs' => array( | |
| 64 | + 'title' => esc_html__( 'Forum User Slugs', 'bbpress' ), | |
| 65 | + 'callback' => 'bbp_admin_setting_callback_user_slug_section', | |
| 66 | + 'page' => 'permalink', | |
| 67 | + ), | |
| 70 | 68 | |
| 71 | - // Extend | |
| 72 | - 'bbp_settings_buddypress' => array( | |
| 73 | - 'title' => esc_html__( 'Forum Integration for BuddyPress', 'bbpress' ), | |
| 74 | - 'callback' => 'bbp_admin_setting_callback_buddypress_section', | |
| 75 | - 'page' => 'buddypress', | |
| 76 | - ), | |
| 77 | - 'bbp_settings_akismet' => array( | |
| 78 | - 'title' => esc_html__( 'Forum Integration for Akismet', 'bbpress' ), | |
| 79 | - 'callback' => 'bbp_admin_setting_callback_akismet_section', | |
| 80 | - 'page' => 'discussion' | |
| 81 | - ), | |
| 69 | + // Extend | |
| 70 | + 'bbp_settings_buddypress' => array( | |
| 71 | + 'title' => esc_html__( 'Forum Integration for BuddyPress', 'bbpress' ), | |
| 72 | + 'callback' => 'bbp_admin_setting_callback_buddypress_section', | |
| 73 | + 'page' => 'buddypress', | |
| 74 | + ), | |
| 75 | + 'bbp_settings_akismet' => array( | |
| 76 | + 'title' => esc_html__( 'Forum Integration for Akismet', 'bbpress' ), | |
| 77 | + 'callback' => 'bbp_admin_setting_callback_akismet_section', | |
| 78 | + 'page' => 'discussion' | |
| 79 | + ), | |
| 82 | 80 | |
| 83 | - // Converter | |
| 84 | - 'bbp_converter_connection' => array( | |
| 85 | - 'title' => esc_html__( 'Database Settings', 'bbpress' ), | |
| 86 | - 'callback' => 'bbp_converter_setting_callback_main_section', | |
| 87 | - 'page' => 'converter' | |
| 88 | - ), | |
| 89 | - 'bbp_converter_options' => array( | |
| 90 | - 'title' => esc_html__( 'Options', 'bbpress' ), | |
| 91 | - 'callback' => 'bbp_converter_setting_callback_options_section', | |
| 92 | - 'page' => 'converter' | |
| 93 | - ) | |
| 81 | + // Converter | |
| 82 | + 'bbp_converter_connection' => array( | |
| 83 | + 'title' => esc_html__( 'Database Settings', 'bbpress' ), | |
| 84 | + 'callback' => 'bbp_converter_setting_callback_main_section', | |
| 85 | + 'page' => 'converter' | |
| 86 | + ), | |
| 87 | + 'bbp_converter_options' => array( | |
| 88 | + 'title' => esc_html__( 'Options', 'bbpress' ), | |
| 89 | + 'callback' => 'bbp_converter_setting_callback_options_section', | |
| 90 | + 'page' => 'converter' | |
| 94 | 91 | ) |
| 95 | - ); | |
| 92 | + ) ); | |
| 96 | 93 | } |
| 97 | 94 | |
| 98 | 95 | /** |
| 99 | 96 | * Get all of the settings fields. |
| @@ -104,514 +101,511 @@ | ||
| 104 | 101 | */ |
| 105 | 102 | function bbp_admin_get_settings_fields() { |
| 106 | 103 | |
| 107 | 104 | // Filter & return |
| 108 | - return (array) apply_filters( | |
| 109 | - 'bbp_admin_get_settings_fields', | |
| 110 | - array( | |
| 105 | + return (array) apply_filters( 'bbp_admin_get_settings_fields', array( | |
| 111 | 106 | |
| 112 | - /** User Section **************************************************/ | |
| 107 | + /** User Section ******************************************************/ | |
| 113 | 108 | |
| 114 | - 'bbp_settings_users' => array( | |
| 109 | + 'bbp_settings_users' => array( | |
| 115 | 110 | |
| 116 | - // Default role setting | |
| 117 | - '_bbp_default_role' => array( | |
| 118 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 119 | - 'args' => array() | |
| 120 | - ), | |
| 111 | + // Default role setting | |
| 112 | + '_bbp_default_role' => array( | |
| 113 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 114 | + 'args' => array() | |
| 115 | + ), | |
| 121 | 116 | |
| 122 | - // Allow global access | |
| 123 | - '_bbp_allow_global_access' => array( | |
| 124 | - 'title' => esc_html__( 'Roles', 'bbpress' ), | |
| 125 | - 'callback' => 'bbp_admin_setting_callback_global_access', | |
| 126 | - 'sanitize_callback' => 'intval', | |
| 127 | - 'args' => array() | |
| 128 | - ), | |
| 117 | + // Allow global access | |
| 118 | + '_bbp_allow_global_access' => array( | |
| 119 | + 'title' => esc_html__( 'Roles', 'bbpress' ), | |
| 120 | + 'callback' => 'bbp_admin_setting_callback_global_access', | |
| 121 | + 'sanitize_callback' => 'intval', | |
| 122 | + 'args' => array() | |
| 123 | + ), | |
| 129 | 124 | |
| 130 | - // Allow content throttling | |
| 131 | - '_bbp_allow_content_throttle' => array( | |
| 132 | - 'sanitize_callback' => 'intval', | |
| 133 | - 'args' => array() | |
| 134 | - ), | |
| 125 | + // Allow content throttling | |
| 126 | + '_bbp_allow_content_throttle' => array( | |
| 127 | + 'sanitize_callback' => 'intval', | |
| 128 | + 'args' => array() | |
| 129 | + ), | |
| 135 | 130 | |
| 136 | - // Throttle setting | |
| 137 | - '_bbp_throttle_time' => array( | |
| 138 | - 'title' => esc_html__( 'Flooding', 'bbpress' ), | |
| 139 | - 'callback' => 'bbp_admin_setting_callback_throttle', | |
| 140 | - 'sanitize_callback' => 'intval', | |
| 141 | - 'args' => array() | |
| 142 | - ), | |
| 131 | + // Throttle setting | |
| 132 | + '_bbp_throttle_time' => array( | |
| 133 | + 'title' => esc_html__( 'Flooding', 'bbpress' ), | |
| 134 | + 'callback' => 'bbp_admin_setting_callback_throttle', | |
| 135 | + 'sanitize_callback' => 'intval', | |
| 136 | + 'args' => array() | |
| 137 | + ), | |
| 143 | 138 | |
| 144 | - // Allow content editing | |
| 145 | - '_bbp_allow_content_edit' => array( | |
| 146 | - 'sanitize_callback' => 'intval', | |
| 147 | - 'args' => array() | |
| 148 | - ), | |
| 139 | + // Allow content editing | |
| 140 | + '_bbp_allow_content_edit' => array( | |
| 141 | + 'sanitize_callback' => 'intval', | |
| 142 | + 'args' => array() | |
| 143 | + ), | |
| 149 | 144 | |
| 150 | - // Edit lock setting | |
| 151 | - '_bbp_edit_lock' => array( | |
| 152 | - 'title' => esc_html__( 'Editing', 'bbpress' ), | |
| 153 | - 'callback' => 'bbp_admin_setting_callback_editlock', | |
| 154 | - 'sanitize_callback' => 'intval', | |
| 155 | - 'args' => array() | |
| 156 | - ), | |
| 157 | - | |
| 158 | - // Allow anonymous posting setting | |
| 159 | - '_bbp_allow_anonymous' => array( | |
| 160 | - 'title' => esc_html__( 'Anonymous', 'bbpress' ), | |
| 161 | - 'callback' => 'bbp_admin_setting_callback_anonymous', | |
| 162 | - 'sanitize_callback' => 'intval', | |
| 163 | - 'args' => array() | |
| 164 | - ) | |
| 145 | + // Edit lock setting | |
| 146 | + '_bbp_edit_lock' => array( | |
| 147 | + 'title' => esc_html__( 'Editing', 'bbpress' ), | |
| 148 | + 'callback' => 'bbp_admin_setting_callback_editlock', | |
| 149 | + 'sanitize_callback' => 'intval', | |
| 150 | + 'args' => array() | |
| 165 | 151 | ), |
| 166 | 152 | |
| 167 | - /** Features Section **********************************************/ | |
| 153 | + // Allow anonymous posting setting | |
| 154 | + '_bbp_allow_anonymous' => array( | |
| 155 | + 'title' => esc_html__( 'Anonymous', 'bbpress' ), | |
| 156 | + 'callback' => 'bbp_admin_setting_callback_anonymous', | |
| 157 | + 'sanitize_callback' => 'intval', | |
| 158 | + 'args' => array() | |
| 159 | + ) | |
| 160 | + ), | |
| 168 | 161 | |
| 169 | - 'bbp_settings_features' => array( | |
| 162 | + /** Features Section **************************************************/ | |
| 170 | 163 | |
| 171 | - // Allow auto embedding setting | |
| 172 | - '_bbp_use_autoembed' => array( | |
| 173 | - 'title' => esc_html__( 'Auto-embed links', 'bbpress' ), | |
| 174 | - 'callback' => 'bbp_admin_setting_callback_use_autoembed', | |
| 175 | - 'sanitize_callback' => 'intval', | |
| 176 | - 'args' => array() | |
| 177 | - ), | |
| 164 | + 'bbp_settings_features' => array( | |
| 178 | 165 | |
| 179 | - // Set reply threading level | |
| 180 | - '_bbp_thread_replies_depth' => array( | |
| 181 | - 'title' => esc_html__( 'Reply Threading', 'bbpress' ), | |
| 182 | - 'callback' => 'bbp_admin_setting_callback_thread_replies_depth', | |
| 183 | - 'sanitize_callback' => 'intval', | |
| 184 | - 'args' => array() | |
| 185 | - ), | |
| 166 | + // Allow auto embedding setting | |
| 167 | + '_bbp_use_autoembed' => array( | |
| 168 | + 'title' => esc_html__( 'Auto-embed links', 'bbpress' ), | |
| 169 | + 'callback' => 'bbp_admin_setting_callback_use_autoembed', | |
| 170 | + 'sanitize_callback' => 'intval', | |
| 171 | + 'args' => array() | |
| 172 | + ), | |
| 186 | 173 | |
| 187 | - // Allow threaded replies | |
| 188 | - '_bbp_allow_threaded_replies' => array( | |
| 189 | - 'sanitize_callback' => 'intval', | |
| 190 | - 'args' => array() | |
| 191 | - ), | |
| 174 | + // Set reply threading level | |
| 175 | + '_bbp_thread_replies_depth' => array( | |
| 176 | + 'title' => esc_html__( 'Reply Threading', 'bbpress' ), | |
| 177 | + 'callback' => 'bbp_admin_setting_callback_thread_replies_depth', | |
| 178 | + 'sanitize_callback' => 'intval', | |
| 179 | + 'args' => array() | |
| 180 | + ), | |
| 192 | 181 | |
| 193 | - // Allow topic and reply revisions | |
| 194 | - '_bbp_allow_revisions' => array( | |
| 195 | - 'title' => esc_html__( 'Revisions', 'bbpress' ), | |
| 196 | - 'callback' => 'bbp_admin_setting_callback_revisions', | |
| 197 | - 'sanitize_callback' => 'intval', | |
| 198 | - 'args' => array() | |
| 199 | - ), | |
| 182 | + // Allow threaded replies | |
| 183 | + '_bbp_allow_threaded_replies' => array( | |
| 184 | + 'sanitize_callback' => 'intval', | |
| 185 | + 'args' => array() | |
| 186 | + ), | |
| 200 | 187 | |
| 201 | - // Allow favorites setting | |
| 202 | - '_bbp_enable_favorites' => array( | |
| 203 | - 'title' => esc_html__( 'Favorites', 'bbpress' ), | |
| 204 | - 'callback' => 'bbp_admin_setting_callback_favorites', | |
| 205 | - 'sanitize_callback' => 'intval', | |
| 206 | - 'args' => array() | |
| 207 | - ), | |
| 188 | + // Allow topic and reply revisions | |
| 189 | + '_bbp_allow_revisions' => array( | |
| 190 | + 'title' => esc_html__( 'Revisions', 'bbpress' ), | |
| 191 | + 'callback' => 'bbp_admin_setting_callback_revisions', | |
| 192 | + 'sanitize_callback' => 'intval', | |
| 193 | + 'args' => array() | |
| 194 | + ), | |
| 208 | 195 | |
| 209 | - // Allow subscriptions setting | |
| 210 | - '_bbp_enable_subscriptions' => array( | |
| 211 | - 'title' => esc_html__( 'Subscriptions', 'bbpress' ), | |
| 212 | - 'callback' => 'bbp_admin_setting_callback_subscriptions', | |
| 213 | - 'sanitize_callback' => 'intval', | |
| 214 | - 'args' => array() | |
| 215 | - ), | |
| 196 | + // Allow favorites setting | |
| 197 | + '_bbp_enable_favorites' => array( | |
| 198 | + 'title' => esc_html__( 'Favorites', 'bbpress' ), | |
| 199 | + 'callback' => 'bbp_admin_setting_callback_favorites', | |
| 200 | + 'sanitize_callback' => 'intval', | |
| 201 | + 'args' => array() | |
| 202 | + ), | |
| 216 | 203 | |
| 217 | - // Allow engagements setting | |
| 218 | - '_bbp_enable_engagements' => array( | |
| 219 | - 'title' => esc_html__( 'Engagements', 'bbpress' ), | |
| 220 | - 'callback' => 'bbp_admin_setting_callback_engagements', | |
| 221 | - 'sanitize_callback' => 'intval', | |
| 222 | - 'args' => array() | |
| 223 | - ), | |
| 204 | + // Allow subscriptions setting | |
| 205 | + '_bbp_enable_subscriptions' => array( | |
| 206 | + 'title' => esc_html__( 'Subscriptions', 'bbpress' ), | |
| 207 | + 'callback' => 'bbp_admin_setting_callback_subscriptions', | |
| 208 | + 'sanitize_callback' => 'intval', | |
| 209 | + 'args' => array() | |
| 210 | + ), | |
| 224 | 211 | |
| 225 | - // Allow topic tags | |
| 226 | - '_bbp_allow_topic_tags' => array( | |
| 227 | - 'title' => esc_html__( 'Topic tags', 'bbpress' ), | |
| 228 | - 'callback' => 'bbp_admin_setting_callback_topic_tags', | |
| 229 | - 'sanitize_callback' => 'intval', | |
| 230 | - 'args' => array() | |
| 231 | - ), | |
| 212 | + // Allow engagements setting | |
| 213 | + '_bbp_enable_engagements' => array( | |
| 214 | + 'title' => esc_html__( 'Engagements', 'bbpress' ), | |
| 215 | + 'callback' => 'bbp_admin_setting_callback_engagements', | |
| 216 | + 'sanitize_callback' => 'intval', | |
| 217 | + 'args' => array() | |
| 218 | + ), | |
| 232 | 219 | |
| 233 | - // Allow topic tags | |
| 234 | - '_bbp_allow_search' => array( | |
| 235 | - 'title' => esc_html__( 'Search', 'bbpress' ), | |
| 236 | - 'callback' => 'bbp_admin_setting_callback_search', | |
| 237 | - 'sanitize_callback' => 'intval', | |
| 238 | - 'args' => array() | |
| 239 | - ), | |
| 220 | + // Allow topic tags | |
| 221 | + '_bbp_allow_topic_tags' => array( | |
| 222 | + 'title' => esc_html__( 'Topic tags', 'bbpress' ), | |
| 223 | + 'callback' => 'bbp_admin_setting_callback_topic_tags', | |
| 224 | + 'sanitize_callback' => 'intval', | |
| 225 | + 'args' => array() | |
| 226 | + ), | |
| 240 | 227 | |
| 241 | - // Allow fancy editor setting | |
| 242 | - '_bbp_use_wp_editor' => array( | |
| 243 | - 'title' => esc_html__( 'Post Formatting', 'bbpress' ), | |
| 244 | - 'callback' => 'bbp_admin_setting_callback_use_wp_editor', | |
| 245 | - 'args' => array(), | |
| 246 | - 'sanitize_callback' => 'intval' | |
| 247 | - ), | |
| 228 | + // Allow topic tags | |
| 229 | + '_bbp_allow_search' => array( | |
| 230 | + 'title' => esc_html__( 'Search', 'bbpress' ), | |
| 231 | + 'callback' => 'bbp_admin_setting_callback_search', | |
| 232 | + 'sanitize_callback' => 'intval', | |
| 233 | + 'args' => array() | |
| 234 | + ), | |
| 248 | 235 | |
| 249 | - // Allow per-forum moderators | |
| 250 | - '_bbp_allow_forum_mods' => array( | |
| 251 | - 'title' => esc_html__( 'Forum Moderators', 'bbpress' ), | |
| 252 | - 'callback' => 'bbp_admin_setting_callback_forum_mods', | |
| 253 | - 'sanitize_callback' => 'intval', | |
| 254 | - 'args' => array() | |
| 255 | - ), | |
| 236 | + // Allow fancy editor setting | |
| 237 | + '_bbp_use_wp_editor' => array( | |
| 238 | + 'title' => esc_html__( 'Post Formatting', 'bbpress' ), | |
| 239 | + 'callback' => 'bbp_admin_setting_callback_use_wp_editor', | |
| 240 | + 'args' => array(), | |
| 241 | + 'sanitize_callback' => 'intval' | |
| 242 | + ), | |
| 256 | 243 | |
| 257 | - // Allow moderators to edit users | |
| 258 | - '_bbp_allow_super_mods' => array( | |
| 259 | - 'title' => esc_html__( 'Super Moderators', 'bbpress' ), | |
| 260 | - 'callback' => 'bbp_admin_setting_callback_super_mods', | |
| 261 | - 'sanitize_callback' => 'intval', | |
| 262 | - 'capability' => 'edit_users', | |
| 263 | - 'args' => array() | |
| 264 | - ) | |
| 244 | + // Allow per-forum moderators | |
| 245 | + '_bbp_allow_forum_mods' => array( | |
| 246 | + 'title' => esc_html__( 'Forum Moderators', 'bbpress' ), | |
| 247 | + 'callback' => 'bbp_admin_setting_callback_forum_mods', | |
| 248 | + 'sanitize_callback' => 'intval', | |
| 249 | + 'args' => array() | |
| 265 | 250 | ), |
| 266 | 251 | |
| 267 | - /** Theme Packages ************************************************/ | |
| 252 | + // Allow moderators to edit users | |
| 253 | + '_bbp_allow_super_mods' => array( | |
| 254 | + 'title' => esc_html__( 'Super Moderators', 'bbpress' ), | |
| 255 | + 'callback' => 'bbp_admin_setting_callback_super_mods', | |
| 256 | + 'sanitize_callback' => 'intval', | |
| 257 | + 'capability' => 'edit_users', | |
| 258 | + 'args' => array() | |
| 259 | + ) | |
| 260 | + ), | |
| 268 | 261 | |
| 269 | - 'bbp_settings_theme_compat' => array( | |
| 262 | + /** Theme Packages ****************************************************/ | |
| 270 | 263 | |
| 271 | - // Theme package setting | |
| 272 | - '_bbp_theme_package_id' => array( | |
| 273 | - 'title' => esc_html__( 'Current Package', 'bbpress' ), | |
| 274 | - 'callback' => 'bbp_admin_setting_callback_subtheme_id', | |
| 275 | - 'sanitize_callback' => 'esc_sql', | |
| 276 | - 'args' => array() | |
| 277 | - ) | |
| 278 | - ), | |
| 264 | + 'bbp_settings_theme_compat' => array( | |
| 279 | 265 | |
| 280 | - /** Per Page Section **********************************************/ | |
| 266 | + // Theme package setting | |
| 267 | + '_bbp_theme_package_id' => array( | |
| 268 | + 'title' => esc_html__( 'Current Package', 'bbpress' ), | |
| 269 | + 'callback' => 'bbp_admin_setting_callback_subtheme_id', | |
| 270 | + 'sanitize_callback' => 'esc_sql', | |
| 271 | + 'args' => array() | |
| 272 | + ) | |
| 273 | + ), | |
| 281 | 274 | |
| 282 | - 'bbp_settings_per_page' => array( | |
| 275 | + /** Per Page Section **************************************************/ | |
| 283 | 276 | |
| 284 | - // Topics per page setting | |
| 285 | - '_bbp_topics_per_page' => array( | |
| 286 | - 'title' => esc_html__( 'Topics', 'bbpress' ), | |
| 287 | - 'callback' => 'bbp_admin_setting_callback_topics_per_page', | |
| 288 | - 'sanitize_callback' => 'intval', | |
| 289 | - 'args' => array( 'label_for' => '_bbp_topics_per_page' ) | |
| 290 | - ), | |
| 277 | + 'bbp_settings_per_page' => array( | |
| 291 | 278 | |
| 292 | - // Replies per page setting | |
| 293 | - '_bbp_replies_per_page' => array( | |
| 294 | - 'title' => esc_html__( 'Replies', 'bbpress' ), | |
| 295 | - 'callback' => 'bbp_admin_setting_callback_replies_per_page', | |
| 296 | - 'sanitize_callback' => 'intval', | |
| 297 | - 'args' => array( 'label_for' => '_bbp_replies_per_page' ) | |
| 298 | - ) | |
| 279 | + // Topics per page setting | |
| 280 | + '_bbp_topics_per_page' => array( | |
| 281 | + 'title' => esc_html__( 'Topics', 'bbpress' ), | |
| 282 | + 'callback' => 'bbp_admin_setting_callback_topics_per_page', | |
| 283 | + 'sanitize_callback' => 'intval', | |
| 284 | + 'args' => array( 'label_for' => '_bbp_topics_per_page' ) | |
| 299 | 285 | ), |
| 300 | 286 | |
| 301 | - /** Per RSS Page Section ******************************************/ | |
| 287 | + // Replies per page setting | |
| 288 | + '_bbp_replies_per_page' => array( | |
| 289 | + 'title' => esc_html__( 'Replies', 'bbpress' ), | |
| 290 | + 'callback' => 'bbp_admin_setting_callback_replies_per_page', | |
| 291 | + 'sanitize_callback' => 'intval', | |
| 292 | + 'args' => array( 'label_for' => '_bbp_replies_per_page' ) | |
| 293 | + ) | |
| 294 | + ), | |
| 302 | 295 | |
| 303 | - 'bbp_settings_per_rss_page' => array( | |
| 296 | + /** Per RSS Page Section **********************************************/ | |
| 304 | 297 | |
| 305 | - // Topics per page setting | |
| 306 | - '_bbp_topics_per_rss_page' => array( | |
| 307 | - 'title' => esc_html__( 'Topics', 'bbpress' ), | |
| 308 | - 'callback' => 'bbp_admin_setting_callback_topics_per_rss_page', | |
| 309 | - 'sanitize_callback' => 'intval', | |
| 310 | - 'args' => array( 'label_for' => '_bbp_topics_per_rss_page' ) | |
| 311 | - ), | |
| 298 | + 'bbp_settings_per_rss_page' => array( | |
| 312 | 299 | |
| 313 | - // Replies per page setting | |
| 314 | - '_bbp_replies_per_rss_page' => array( | |
| 315 | - 'title' => esc_html__( 'Replies', 'bbpress' ), | |
| 316 | - 'callback' => 'bbp_admin_setting_callback_replies_per_rss_page', | |
| 317 | - 'sanitize_callback' => 'intval', | |
| 318 | - 'args' => array( 'label_for' => '_bbp_replies_per_rss_page' ) | |
| 319 | - ) | |
| 300 | + // Topics per page setting | |
| 301 | + '_bbp_topics_per_rss_page' => array( | |
| 302 | + 'title' => esc_html__( 'Topics', 'bbpress' ), | |
| 303 | + 'callback' => 'bbp_admin_setting_callback_topics_per_rss_page', | |
| 304 | + 'sanitize_callback' => 'intval', | |
| 305 | + 'args' => array( 'label_for' => '_bbp_topics_per_rss_page' ) | |
| 320 | 306 | ), |
| 321 | 307 | |
| 322 | - /** Front Slugs ***************************************************/ | |
| 308 | + // Replies per page setting | |
| 309 | + '_bbp_replies_per_rss_page' => array( | |
| 310 | + 'title' => esc_html__( 'Replies', 'bbpress' ), | |
| 311 | + 'callback' => 'bbp_admin_setting_callback_replies_per_rss_page', | |
| 312 | + 'sanitize_callback' => 'intval', | |
| 313 | + 'args' => array( 'label_for' => '_bbp_replies_per_rss_page' ) | |
| 314 | + ) | |
| 315 | + ), | |
| 323 | 316 | |
| 324 | - 'bbp_settings_root_slugs' => array( | |
| 317 | + /** Front Slugs *******************************************************/ | |
| 325 | 318 | |
| 326 | - // Root slug setting | |
| 327 | - '_bbp_root_slug' => array( | |
| 328 | - 'title' => esc_html__( 'Forum Root', 'bbpress' ), | |
| 329 | - 'callback' => 'bbp_admin_setting_callback_root_slug', | |
| 330 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 331 | - 'args' => array( 'label_for' => '_bbp_root_slug' ) | |
| 332 | - ), | |
| 319 | + 'bbp_settings_root_slugs' => array( | |
| 333 | 320 | |
| 334 | - // Include root setting | |
| 335 | - '_bbp_include_root' => array( | |
| 336 | - 'title' => esc_html__( 'Forum Prefix', 'bbpress' ), | |
| 337 | - 'callback' => 'bbp_admin_setting_callback_include_root', | |
| 338 | - 'sanitize_callback' => 'intval', | |
| 339 | - 'args' => array() | |
| 340 | - ), | |
| 321 | + // Root slug setting | |
| 322 | + '_bbp_root_slug' => array( | |
| 323 | + 'title' => esc_html__( 'Forum Root', 'bbpress' ), | |
| 324 | + 'callback' => 'bbp_admin_setting_callback_root_slug', | |
| 325 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 326 | + 'args' => array( 'label_for' => '_bbp_root_slug' ) | |
| 327 | + ), | |
| 341 | 328 | |
| 342 | - // What to show on Forum Root | |
| 343 | - '_bbp_show_on_root' => array( | |
| 344 | - 'title' => esc_html__( 'Forum root should show', 'bbpress' ), | |
| 345 | - 'callback' => 'bbp_admin_setting_callback_show_on_root', | |
| 346 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 347 | - 'args' => array( 'label_for' => '_bbp_show_on_root' ) | |
| 348 | - ), | |
| 329 | + // Include root setting | |
| 330 | + '_bbp_include_root' => array( | |
| 331 | + 'title' => esc_html__( 'Forum Prefix', 'bbpress' ), | |
| 332 | + 'callback' => 'bbp_admin_setting_callback_include_root', | |
| 333 | + 'sanitize_callback' => 'intval', | |
| 334 | + 'args' => array() | |
| 349 | 335 | ), |
| 350 | 336 | |
| 351 | - /** Single Slugs **************************************************/ | |
| 337 | + // What to show on Forum Root | |
| 338 | + '_bbp_show_on_root' => array( | |
| 339 | + 'title' => esc_html__( 'Forum root should show', 'bbpress' ), | |
| 340 | + 'callback' => 'bbp_admin_setting_callback_show_on_root', | |
| 341 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 342 | + 'args' => array( 'label_for'=>'_bbp_show_on_root' ) | |
| 343 | + ), | |
| 344 | + ), | |
| 352 | 345 | |
| 353 | - 'bbp_settings_single_slugs' => array( | |
| 346 | + /** Single Slugs ******************************************************/ | |
| 354 | 347 | |
| 355 | - // Forum slug setting | |
| 356 | - '_bbp_forum_slug' => array( | |
| 357 | - 'title' => esc_html__( 'Forum', 'bbpress' ), | |
| 358 | - 'callback' => 'bbp_admin_setting_callback_forum_slug', | |
| 359 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 360 | - 'args' => array( 'label_for' => '_bbp_forum_slug' ) | |
| 361 | - ), | |
| 348 | + 'bbp_settings_single_slugs' => array( | |
| 362 | 349 | |
| 363 | - // Topic slug setting | |
| 364 | - '_bbp_topic_slug' => array( | |
| 365 | - 'title' => esc_html__( 'Topic', 'bbpress' ), | |
| 366 | - 'callback' => 'bbp_admin_setting_callback_topic_slug', | |
| 367 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 368 | - 'args' => array( 'label_for' => '_bbp_topic_slug' ) | |
| 369 | - ), | |
| 350 | + // Forum slug setting | |
| 351 | + '_bbp_forum_slug' => array( | |
| 352 | + 'title' => esc_html__( 'Forum', 'bbpress' ), | |
| 353 | + 'callback' => 'bbp_admin_setting_callback_forum_slug', | |
| 354 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 355 | + 'args' => array( 'label_for'=>'_bbp_forum_slug' ) | |
| 356 | + ), | |
| 370 | 357 | |
| 371 | - // Topic tag slug setting | |
| 372 | - '_bbp_topic_tag_slug' => array( | |
| 373 | - 'title' => esc_html__( 'Topic Tag', 'bbpress' ), | |
| 374 | - 'callback' => 'bbp_admin_setting_callback_topic_tag_slug', | |
| 375 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 376 | - 'args' => array( 'label_for' => '_bbp_topic_tag_slug' ) | |
| 377 | - ), | |
| 358 | + // Topic slug setting | |
| 359 | + '_bbp_topic_slug' => array( | |
| 360 | + 'title' => esc_html__( 'Topic', 'bbpress' ), | |
| 361 | + 'callback' => 'bbp_admin_setting_callback_topic_slug', | |
| 362 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 363 | + 'args' => array( 'label_for'=>'_bbp_topic_slug' ) | |
| 364 | + ), | |
| 378 | 365 | |
| 379 | - // View slug setting | |
| 380 | - '_bbp_view_slug' => array( | |
| 381 | - 'title' => esc_html__( 'Topic View', 'bbpress' ), | |
| 382 | - 'callback' => 'bbp_admin_setting_callback_view_slug', | |
| 383 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 384 | - 'args' => array( 'label_for' => '_bbp_view_slug' ) | |
| 385 | - ), | |
| 366 | + // Topic tag slug setting | |
| 367 | + '_bbp_topic_tag_slug' => array( | |
| 368 | + 'title' => esc_html__( 'Topic Tag', 'bbpress' ), | |
| 369 | + 'callback' => 'bbp_admin_setting_callback_topic_tag_slug', | |
| 370 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 371 | + 'args' => array( 'label_for'=>'_bbp_topic_tag_slug' ) | |
| 372 | + ), | |
| 386 | 373 | |
| 387 | - // Reply slug setting | |
| 388 | - '_bbp_reply_slug' => array( | |
| 389 | - 'title' => _x( 'Reply', 'noun', 'bbpress' ), | |
| 390 | - 'callback' => 'bbp_admin_setting_callback_reply_slug', | |
| 391 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 392 | - 'args' => array( 'label_for' => '_bbp_reply_slug' ) | |
| 393 | - ), | |
| 374 | + // View slug setting | |
| 375 | + '_bbp_view_slug' => array( | |
| 376 | + 'title' => esc_html__( 'Topic View', 'bbpress' ), | |
| 377 | + 'callback' => 'bbp_admin_setting_callback_view_slug', | |
| 378 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 379 | + 'args' => array( 'label_for'=>'_bbp_view_slug' ) | |
| 380 | + ), | |
| 394 | 381 | |
| 395 | - // Edit slug setting | |
| 396 | - '_bbp_edit_slug' => array( | |
| 397 | - 'title' => esc_html__( 'Edit', 'bbpress' ), | |
| 398 | - 'callback' => 'bbp_admin_setting_callback_edit_slug', | |
| 399 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 400 | - 'args' => array( 'label_for' => '_bbp_edit_slug' ) | |
| 401 | - ), | |
| 382 | + // Reply slug setting | |
| 383 | + '_bbp_reply_slug' => array( | |
| 384 | + 'title' => _x( 'Reply', 'noun', 'bbpress' ), | |
| 385 | + 'callback' => 'bbp_admin_setting_callback_reply_slug', | |
| 386 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 387 | + 'args' => array( 'label_for'=>'_bbp_reply_slug' ) | |
| 388 | + ), | |
| 402 | 389 | |
| 403 | - // Search slug setting | |
| 404 | - '_bbp_search_slug' => array( | |
| 405 | - 'title' => esc_html__( 'Search', 'bbpress' ), | |
| 406 | - 'callback' => 'bbp_admin_setting_callback_search_slug', | |
| 407 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 408 | - 'args' => array( 'label_for' => '_bbp_search_slug' ) | |
| 409 | - ) | |
| 390 | + // Edit slug setting | |
| 391 | + '_bbp_edit_slug' => array( | |
| 392 | + 'title' => esc_html__( 'Edit', 'bbpress' ), | |
| 393 | + 'callback' => 'bbp_admin_setting_callback_edit_slug', | |
| 394 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 395 | + 'args' => array( 'label_for'=>'_bbp_edit_slug' ) | |
| 410 | 396 | ), |
| 411 | 397 | |
| 412 | - /** User Slugs ****************************************************/ | |
| 398 | + // Search slug setting | |
| 399 | + '_bbp_search_slug' => array( | |
| 400 | + 'title' => esc_html__( 'Search', 'bbpress' ), | |
| 401 | + 'callback' => 'bbp_admin_setting_callback_search_slug', | |
| 402 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 403 | + 'args' => array( 'label_for'=>'_bbp_search_slug' ) | |
| 404 | + ) | |
| 405 | + ), | |
| 413 | 406 | |
| 414 | - 'bbp_settings_user_slugs' => array( | |
| 407 | + /** User Slugs ********************************************************/ | |
| 415 | 408 | |
| 416 | - // User slug setting | |
| 417 | - '_bbp_user_slug' => array( | |
| 418 | - 'title' => esc_html__( 'User Base', 'bbpress' ), | |
| 419 | - 'callback' => 'bbp_admin_setting_callback_user_slug', | |
| 420 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 421 | - 'args' => array( 'label_for' => '_bbp_user_slug' ) | |
| 422 | - ), | |
| 409 | + 'bbp_settings_user_slugs' => array( | |
| 423 | 410 | |
| 424 | - // Topics slug setting | |
| 425 | - '_bbp_topic_archive_slug' => array( | |
| 426 | - 'title' => esc_html__( 'Topics Started', 'bbpress' ), | |
| 427 | - 'callback' => 'bbp_admin_setting_callback_topic_archive_slug', | |
| 428 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 429 | - 'args' => array( 'label_for' => '_bbp_topic_archive_slug' ) | |
| 430 | - ), | |
| 411 | + // User slug setting | |
| 412 | + '_bbp_user_slug' => array( | |
| 413 | + 'title' => esc_html__( 'User Base', 'bbpress' ), | |
| 414 | + 'callback' => 'bbp_admin_setting_callback_user_slug', | |
| 415 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 416 | + 'args' => array( 'label_for'=>'_bbp_user_slug' ) | |
| 417 | + ), | |
| 431 | 418 | |
| 432 | - // Replies slug setting | |
| 433 | - '_bbp_reply_archive_slug' => array( | |
| 434 | - 'title' => esc_html__( 'Replies Created', 'bbpress' ), | |
| 435 | - 'callback' => 'bbp_admin_setting_callback_reply_archive_slug', | |
| 436 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 437 | - 'args' => array( 'label_for' => '_bbp_reply_archive_slug' ) | |
| 438 | - ), | |
| 419 | + // Topics slug setting | |
| 420 | + '_bbp_topic_archive_slug' => array( | |
| 421 | + 'title' => esc_html__( 'Topics Started', 'bbpress' ), | |
| 422 | + 'callback' => 'bbp_admin_setting_callback_topic_archive_slug', | |
| 423 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 424 | + 'args' => array( 'label_for'=>'_bbp_topic_archive_slug' ) | |
| 425 | + ), | |
| 439 | 426 | |
| 440 | - // Favorites slug setting | |
| 441 | - '_bbp_user_favs_slug' => array( | |
| 442 | - 'title' => esc_html__( 'Favorite Topics', 'bbpress' ), | |
| 443 | - 'callback' => 'bbp_admin_setting_callback_user_favs_slug', | |
| 444 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 445 | - 'args' => array( 'label_for' => '_bbp_user_favs_slug' ) | |
| 446 | - ), | |
| 427 | + // Replies slug setting | |
| 428 | + '_bbp_reply_archive_slug' => array( | |
| 429 | + 'title' => esc_html__( 'Replies Created', 'bbpress' ), | |
| 430 | + 'callback' => 'bbp_admin_setting_callback_reply_archive_slug', | |
| 431 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 432 | + 'args' => array( 'label_for'=>'_bbp_reply_archive_slug' ) | |
| 433 | + ), | |
| 447 | 434 | |
| 448 | - // Subscriptions slug setting | |
| 449 | - '_bbp_user_subs_slug' => array( | |
| 450 | - 'title' => esc_html__( 'Subscriptions', 'bbpress' ), | |
| 451 | - 'callback' => 'bbp_admin_setting_callback_user_subs_slug', | |
| 452 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 453 | - 'args' => array( 'label_for' => '_bbp_user_subs_slug' ) | |
| 454 | - ), | |
| 435 | + // Favorites slug setting | |
| 436 | + '_bbp_user_favs_slug' => array( | |
| 437 | + 'title' => esc_html__( 'Favorite Topics', 'bbpress' ), | |
| 438 | + 'callback' => 'bbp_admin_setting_callback_user_favs_slug', | |
| 439 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 440 | + 'args' => array( 'label_for'=>'_bbp_user_favs_slug' ) | |
| 441 | + ), | |
| 455 | 442 | |
| 456 | - // Engagements slug setting | |
| 457 | - '_bbp_user_engs_slug' => array( | |
| 458 | - 'title' => esc_html__( 'Engagements', 'bbpress' ), | |
| 459 | - 'callback' => 'bbp_admin_setting_callback_user_engagements_slug', | |
| 460 | - 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 461 | - 'args' => array( 'label_for' => '_bbp_user_engs_slug' ) | |
| 462 | - ) | |
| 443 | + // Subscriptions slug setting | |
| 444 | + '_bbp_user_subs_slug' => array( | |
| 445 | + 'title' => esc_html__( 'Subscriptions', 'bbpress' ), | |
| 446 | + 'callback' => 'bbp_admin_setting_callback_user_subs_slug', | |
| 447 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 448 | + 'args' => array( 'label_for'=>'_bbp_user_subs_slug' ) | |
| 463 | 449 | ), |
| 464 | 450 | |
| 465 | - /** BuddyPress ****************************************************/ | |
| 451 | + // Engagements slug setting | |
| 452 | + '_bbp_user_engs_slug' => array( | |
| 453 | + 'title' => esc_html__( 'Engagements', 'bbpress' ), | |
| 454 | + 'callback' => 'bbp_admin_setting_callback_user_engagements_slug', | |
| 455 | + 'sanitize_callback' => 'bbp_sanitize_slug', | |
| 456 | + 'args' => array( 'label_for'=>'_bbp_user_engs_slug' ) | |
| 457 | + ) | |
| 458 | + ), | |
| 466 | 459 | |
| 467 | - 'bbp_settings_buddypress' => array( | |
| 460 | + /** BuddyPress ********************************************************/ | |
| 468 | 461 | |
| 469 | - // Are group forums enabled? | |
| 470 | - '_bbp_enable_group_forums' => array( | |
| 471 | - 'title' => esc_html__( 'Group Forums', 'bbpress' ), | |
| 472 | - 'callback' => 'bbp_admin_setting_callback_group_forums', | |
| 473 | - 'sanitize_callback' => 'intval', | |
| 474 | - 'args' => array() | |
| 475 | - ), | |
| 462 | + 'bbp_settings_buddypress' => array( | |
| 476 | 463 | |
| 477 | - // Group forums parent forum ID | |
| 478 | - '_bbp_group_forums_root_id' => array( | |
| 479 | - 'title' => esc_html__( 'Primary Forum', 'bbpress' ), | |
| 480 | - 'callback' => 'bbp_admin_setting_callback_group_forums_root_id', | |
| 481 | - 'sanitize_callback' => 'intval', | |
| 482 | - 'args' => array( 'label_for' => '_bbp_group_forums_root_id' ) | |
| 483 | - ) | |
| 464 | + // Are group forums enabled? | |
| 465 | + '_bbp_enable_group_forums' => array( | |
| 466 | + 'title' => esc_html__( 'Group Forums', 'bbpress' ), | |
| 467 | + 'callback' => 'bbp_admin_setting_callback_group_forums', | |
| 468 | + 'sanitize_callback' => 'intval', | |
| 469 | + 'args' => array() | |
| 484 | 470 | ), |
| 485 | 471 | |
| 486 | - /** Akismet *******************************************************/ | |
| 472 | + // Group forums parent forum ID | |
| 473 | + '_bbp_group_forums_root_id' => array( | |
| 474 | + 'title' => esc_html__( 'Primary Forum', 'bbpress' ), | |
| 475 | + 'callback' => 'bbp_admin_setting_callback_group_forums_root_id', | |
| 476 | + 'sanitize_callback' => 'intval', | |
| 477 | + 'args' => array( 'label_for'=>'_bbp_group_forums_root_id' ) | |
| 478 | + ) | |
| 479 | + ), | |
| 487 | 480 | |
| 488 | - 'bbp_settings_akismet' => array( | |
| 481 | + /** Akismet ***********************************************************/ | |
| 489 | 482 | |
| 490 | - // Should we use Akismet | |
| 491 | - '_bbp_enable_akismet' => array( | |
| 492 | - 'title' => esc_html__( 'Use Akismet', 'bbpress' ), | |
| 493 | - 'callback' => 'bbp_admin_setting_callback_akismet', | |
| 494 | - 'sanitize_callback' => 'intval', | |
| 495 | - 'args' => array() | |
| 496 | - ) | |
| 497 | - ), | |
| 483 | + 'bbp_settings_akismet' => array( | |
| 498 | 484 | |
| 499 | - /** Converter Page ************************************************/ | |
| 485 | + // Should we use Akismet | |
| 486 | + '_bbp_enable_akismet' => array( | |
| 487 | + 'title' => esc_html__( 'Use Akismet', 'bbpress' ), | |
| 488 | + 'callback' => 'bbp_admin_setting_callback_akismet', | |
| 489 | + 'sanitize_callback' => 'intval', | |
| 490 | + 'args' => array() | |
| 491 | + ) | |
| 492 | + ), | |
| 500 | 493 | |
| 501 | - // Connection | |
| 502 | - 'bbp_converter_connection' => array( | |
| 494 | + /** Converter Page ****************************************************/ | |
| 503 | 495 | |
| 504 | - // System Select | |
| 505 | - '_bbp_converter_platform' => array( | |
| 506 | - 'title' => esc_html__( 'Select Platform', 'bbpress' ), | |
| 507 | - 'callback' => 'bbp_converter_setting_callback_platform', | |
| 508 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 509 | - 'args' => array( 'label_for' => '_bbp_converter_platform' ) | |
| 510 | - ), | |
| 496 | + // Connection | |
| 497 | + 'bbp_converter_connection' => array( | |
| 511 | 498 | |
| 512 | - // Database Server | |
| 513 | - '_bbp_converter_db_server' => array( | |
| 514 | - 'title' => esc_html__( 'Database Server', 'bbpress' ), | |
| 515 | - 'callback' => 'bbp_converter_setting_callback_dbserver', | |
| 516 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 517 | - 'args' => array( 'label_for' => '_bbp_converter_db_server' ) | |
| 518 | - ), | |
| 499 | + // System Select | |
| 500 | + '_bbp_converter_platform' => array( | |
| 501 | + 'title' => esc_html__( 'Select Platform', 'bbpress' ), | |
| 502 | + 'callback' => 'bbp_converter_setting_callback_platform', | |
| 503 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 504 | + 'args' => array( 'label_for'=> '_bbp_converter_platform' ) | |
| 505 | + ), | |
| 519 | 506 | |
| 520 | - // Database Server Port | |
| 521 | - '_bbp_converter_db_port' => array( | |
| 522 | - 'title' => esc_html__( 'Database Port', 'bbpress' ), | |
| 523 | - 'callback' => 'bbp_converter_setting_callback_dbport', | |
| 524 | - 'sanitize_callback' => 'intval', | |
| 525 | - 'args' => array( 'label_for' => '_bbp_converter_db_port' ) | |
| 526 | - ), | |
| 507 | + // Database Server | |
| 508 | + '_bbp_converter_db_server' => array( | |
| 509 | + 'title' => esc_html__( 'Database Server', 'bbpress' ), | |
| 510 | + 'callback' => 'bbp_converter_setting_callback_dbserver', | |
| 511 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 512 | + 'args' => array( 'label_for'=> '_bbp_converter_db_server' ) | |
| 513 | + ), | |
| 527 | 514 | |
| 528 | - // Database Name | |
| 529 | - '_bbp_converter_db_name' => array( | |
| 530 | - 'title' => esc_html__( 'Database Name', 'bbpress' ), | |
| 531 | - 'callback' => 'bbp_converter_setting_callback_dbname', | |
| 532 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 533 | - 'args' => array( 'label_for' => '_bbp_converter_db_name' ) | |
| 534 | - ), | |
| 515 | + // Database Server Port | |
| 516 | + '_bbp_converter_db_port' => array( | |
| 517 | + 'title' => esc_html__( 'Database Port', 'bbpress' ), | |
| 518 | + 'callback' => 'bbp_converter_setting_callback_dbport', | |
| 519 | + 'sanitize_callback' => 'intval', | |
| 520 | + 'args' => array( 'label_for'=> '_bbp_converter_db_port' ) | |
| 521 | + ), | |
| 535 | 522 | |
| 536 | - // Database User | |
| 537 | - '_bbp_converter_db_user' => array( | |
| 538 | - 'title' => esc_html__( 'Database User', 'bbpress' ), | |
| 539 | - 'callback' => 'bbp_converter_setting_callback_dbuser', | |
| 540 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 541 | - 'args' => array( 'label_for' => '_bbp_converter_db_user' ) | |
| 542 | - ), | |
| 523 | + // Database Name | |
| 524 | + '_bbp_converter_db_name' => array( | |
| 525 | + 'title' => esc_html__( 'Database Name', 'bbpress' ), | |
| 526 | + 'callback' => 'bbp_converter_setting_callback_dbname', | |
| 527 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 528 | + 'args' => array( 'label_for'=> '_bbp_converter_db_name' ) | |
| 529 | + ), | |
| 543 | 530 | |
| 544 | - // Database Password | |
| 545 | - '_bbp_converter_db_pass' => array( | |
| 546 | - 'title' => esc_html__( 'Database Password', 'bbpress' ), | |
| 547 | - 'callback' => 'bbp_converter_setting_callback_dbpass', | |
| 548 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 549 | - 'args' => array( 'label_for' => '_bbp_converter_db_pass' ) | |
| 550 | - ), | |
| 531 | + // Database User | |
| 532 | + '_bbp_converter_db_user' => array( | |
| 533 | + 'title' => esc_html__( 'Database User', 'bbpress' ), | |
| 534 | + 'callback' => 'bbp_converter_setting_callback_dbuser', | |
| 535 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 536 | + 'args' => array( 'label_for'=> '_bbp_converter_db_user' ) | |
| 537 | + ), | |
| 551 | 538 | |
| 552 | - // Database Prefix | |
| 553 | - '_bbp_converter_db_prefix' => array( | |
| 554 | - 'title' => esc_html__( 'Table Prefix', 'bbpress' ), | |
| 555 | - 'callback' => 'bbp_converter_setting_callback_dbprefix', | |
| 556 | - 'sanitize_callback' => 'sanitize_text_field', | |
| 557 | - 'args' => array( 'label_for' => '_bbp_converter_db_prefix' ) | |
| 558 | - ) | |
| 539 | + // Database Password | |
| 540 | + '_bbp_converter_db_pass' => array( | |
| 541 | + 'title' => esc_html__( 'Database Password', 'bbpress' ), | |
| 542 | + 'callback' => 'bbp_converter_setting_callback_dbpass', | |
| 543 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 544 | + 'args' => array( 'label_for'=> '_bbp_converter_db_pass' ) | |
| 559 | 545 | ), |
| 560 | 546 | |
| 561 | - // Options | |
| 562 | - 'bbp_converter_options' => array( | |
| 547 | + // Database Prefix | |
| 548 | + '_bbp_converter_db_prefix' => array( | |
| 549 | + 'title' => esc_html__( 'Table Prefix', 'bbpress' ), | |
| 550 | + 'callback' => 'bbp_converter_setting_callback_dbprefix', | |
| 551 | + 'sanitize_callback' => 'sanitize_text_field', | |
| 552 | + 'args' => array( 'label_for'=> '_bbp_converter_db_prefix' ) | |
| 553 | + ) | |
| 554 | + ), | |
| 563 | 555 | |
| 564 | - // Rows Limit | |
| 565 | - '_bbp_converter_rows' => array( | |
| 566 | - 'title' => esc_html__( 'Rows Limit', 'bbpress' ), | |
| 567 | - 'callback' => 'bbp_converter_setting_callback_rows', | |
| 568 | - 'sanitize_callback' => 'intval', | |
| 569 | - 'args' => array( 'label_for' => '_bbp_converter_rows' ) | |
| 570 | - ), | |
| 556 | + // Options | |
| 557 | + 'bbp_converter_options' => array( | |
| 571 | 558 | |
| 572 | - // Delay Time | |
| 573 | - '_bbp_converter_delay_time' => array( | |
| 574 | - 'title' => esc_html__( 'Delay Time', 'bbpress' ), | |
| 575 | - 'callback' => 'bbp_converter_setting_callback_delay_time', | |
| 576 | - 'sanitize_callback' => 'intval', | |
| 577 | - 'args' => array( 'label_for' => '_bbp_converter_delay_time' ) | |
| 578 | - ), | |
| 559 | + // Rows Limit | |
| 560 | + '_bbp_converter_rows' => array( | |
| 561 | + 'title' => esc_html__( 'Rows Limit', 'bbpress' ), | |
| 562 | + 'callback' => 'bbp_converter_setting_callback_rows', | |
| 563 | + 'sanitize_callback' => 'intval', | |
| 564 | + 'args' => array( 'label_for'=> '_bbp_converter_rows' ) | |
| 565 | + ), | |
| 579 | 566 | |
| 580 | - // Convert Users | |
| 581 | - '_bbp_converter_convert_users' => array( | |
| 582 | - 'title' => esc_html__( 'Convert Users', 'bbpress' ), | |
| 583 | - 'callback' => 'bbp_converter_setting_callback_convert_users', | |
| 584 | - 'sanitize_callback' => 'intval', | |
| 585 | - 'args' => array( 'label_for' => '_bbp_converter_convert_users' ) | |
| 586 | - ), | |
| 567 | + // Delay Time | |
| 568 | + '_bbp_converter_delay_time' => array( | |
| 569 | + 'title' => esc_html__( 'Delay Time', 'bbpress' ), | |
| 570 | + 'callback' => 'bbp_converter_setting_callback_delay_time', | |
| 571 | + 'sanitize_callback' => 'intval', | |
| 572 | + 'args' => array( 'label_for'=> '_bbp_converter_delay_time' ) | |
| 573 | + ), | |
| 587 | 574 | |
| 588 | - // Halt | |
| 589 | - '_bbp_converter_halt' => array( | |
| 590 | - 'title' => esc_html__( 'Stop on Error', 'bbpress' ), | |
| 591 | - 'callback' => 'bbp_converter_setting_callback_halt', | |
| 592 | - 'sanitize_callback' => 'intval', | |
| 593 | - 'args' => array( 'label_for' => '_bbp_converter_halt' ) | |
| 594 | - ), | |
| 575 | + // Convert Users | |
| 576 | + '_bbp_converter_convert_users' => array( | |
| 577 | + 'title' => esc_html__( 'Convert Users', 'bbpress' ), | |
| 578 | + 'callback' => 'bbp_converter_setting_callback_convert_users', | |
| 579 | + 'sanitize_callback' => 'intval', | |
| 580 | + 'args' => array( 'label_for'=> '_bbp_converter_convert_users' ) | |
| 581 | + ), | |
| 595 | 582 | |
| 596 | - // Restart | |
| 597 | - '_bbp_converter_restart' => array( | |
| 598 | - 'title' => esc_html__( 'Start Over', 'bbpress' ), | |
| 599 | - 'callback' => 'bbp_converter_setting_callback_restart', | |
| 600 | - 'sanitize_callback' => 'intval', | |
| 601 | - 'args' => array( 'label_for' => '_bbp_converter_restart' ) | |
| 602 | - ), | |
| 583 | + // Halt | |
| 584 | + '_bbp_converter_halt' => array( | |
| 585 | + 'title' => esc_html__( 'Stop on Error', 'bbpress' ), | |
| 586 | + 'callback' => 'bbp_converter_setting_callback_halt', | |
| 587 | + 'sanitize_callback' => 'intval', | |
| 588 | + 'args' => array( 'label_for'=> '_bbp_converter_halt' ) | |
| 589 | + ), | |
| 603 | 590 | |
| 604 | - // Clean | |
| 605 | - '_bbp_converter_clean' => array( | |
| 606 | - 'title' => esc_html__( 'Helper Data', 'bbpress' ), | |
| 607 | - 'callback' => 'bbp_converter_setting_callback_clean', | |
| 608 | - 'sanitize_callback' => 'intval', | |
| 609 | - 'args' => array( 'label_for' => '_bbp_converter_clean' ) | |
| 610 | - ) | |
| 591 | + // Restart | |
| 592 | + '_bbp_converter_restart' => array( | |
| 593 | + 'title' => esc_html__( 'Start Over', 'bbpress' ), | |
| 594 | + 'callback' => 'bbp_converter_setting_callback_restart', | |
| 595 | + 'sanitize_callback' => 'intval', | |
| 596 | + 'args' => array( 'label_for'=> '_bbp_converter_restart' ) | |
| 597 | + ), | |
| 598 | + | |
| 599 | + // Clean | |
| 600 | + '_bbp_converter_clean' => array( | |
| 601 | + 'title' => esc_html__( 'Helper Data', 'bbpress' ), | |
| 602 | + 'callback' => 'bbp_converter_setting_callback_clean', | |
| 603 | + 'sanitize_callback' => 'intval', | |
| 604 | + 'args' => array( 'label_for'=> '_bbp_converter_clean' ) | |
| 611 | 605 | ) |
| 612 | 606 | ) |
| 613 | - ); | |
| 607 | + ) ); | |
| 614 | 608 | } |
| 615 | 609 | |
| 616 | 610 | /** |
| 617 | 611 | * Get settings fields by section. |
| @@ -617,10 +611,10 @@ | ||
| 617 | 611 | * Get settings fields by section. |
| 618 | 612 | * |
| 619 | 613 | * @since 2.1.0 bbPress (r4001) |
| 620 | 614 | * |
| 621 | - * @param string $section_id ID of the section to get fields for. | |
| 622 | - * @staticvar array $fields All of the available fields. | |
| 615 | + * @param string $section_id ID of the section to get fields for | |
| 616 | + * @staticvar array $fields All of the available fields | |
| 623 | 617 | * @return mixed False if section is invalid, array of fields otherwise. |
| 624 | 618 | */ |
| 625 | 619 | function bbp_admin_get_settings_fields_for_section( $section_id = '' ) { |
| 626 | 620 | static $fields = array(); |
| @@ -649,9 +643,9 @@ | ||
| 649 | 643 | |
| 650 | 644 | /** User Section **************************************************************/ |
| 651 | 645 | |
| 652 | 646 | /** |
| 653 | - * User settings section description for the settings page. | |
| 647 | + * User settings section description for the settings page | |
| 654 | 648 | * |
| 655 | 649 | * @since 2.0.0 bbPress (r2786) |
| 656 | 650 | */ |
| 657 | 651 | function bbp_admin_setting_callback_user_section() { |
| @@ -663,9 +657,9 @@ | ||
| 663 | 657 | } |
| 664 | 658 | |
| 665 | 659 | |
| 666 | 660 | /** |
| 667 | - * Edit lock setting field. | |
| 661 | + * Edit lock setting field | |
| 668 | 662 | * |
| 669 | 663 | * @since 2.0.0 bbPress (r2737) |
| 670 | 664 | */ |
| 671 | 665 | function bbp_admin_setting_callback_editlock() { |
| @@ -679,16 +673,10 @@ | ||
| 679 | 673 | |
| 680 | 674 | <?php $select = ob_get_clean(); ?> |
| 681 | 675 | |
| 682 | 676 | <label for="_bbp_allow_content_edit"> |
| 683 | - <input name="_bbp_allow_content_edit" id="_bbp_allow_content_edit" type="checkbox" value="1" <?php checked( bbp_allow_content_edit( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_content_edit' ); ?> /> | |
| 684 | - <?php | |
| 685 | - printf( | |
| 686 | - /* translators: %s: Total minutes to edit a post */ | |
| 687 | - esc_html__( 'Allow users to edit their content for %s minutes after posting', 'bbpress' ), | |
| 688 | - $select | |
| 689 | - ); | |
| 690 | - ?> | |
| 677 | + <input name="_bbp_allow_content_edit" id="_bbp_allow_content_edit" type="checkbox" value="1" <?php checked( bbp_allow_content_edit( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_content_edit' ); ?> /> | |
| 678 | + <?php printf( esc_html__( 'Allow users to edit their content for %s minutes after posting', 'bbpress' ), $select ); ?> | |
| 691 | 679 | </label> |
| 692 | 680 | <p class="description"><?php esc_html_e( 'If checked, setting to "0 minutes" allows editing forever.', 'bbpress' ); ?></p> |
| 693 | 681 | |
| 694 | 682 | <?php |
| @@ -694,9 +682,9 @@ | ||
| 694 | 682 | <?php |
| 695 | 683 | } |
| 696 | 684 | |
| 697 | 685 | /** |
| 698 | - * Throttle setting field. | |
| 686 | + * Throttle setting field | |
| 699 | 687 | * |
| 700 | 688 | * @since 2.0.0 bbPress (r2737) |
| 701 | 689 | */ |
| 702 | 690 | function bbp_admin_setting_callback_throttle() { |
| @@ -710,16 +698,10 @@ | ||
| 710 | 698 | |
| 711 | 699 | <?php $select = ob_get_clean(); ?> |
| 712 | 700 | |
| 713 | 701 | <label for="_bbp_allow_content_throttle"> |
| 714 | - <input name="_bbp_allow_content_throttle" id="_bbp_allow_content_throttle" type="checkbox" value="1" <?php checked( bbp_allow_content_throttle( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_content_throttle' ); ?> /> | |
| 715 | - <?php | |
| 716 | - printf( | |
| 717 | - /* translators: %s: Total seconds to throttle a user */ | |
| 718 | - esc_html__( 'Allow flood protection by throttling users for %s seconds after posting', 'bbpress' ), | |
| 719 | - $select | |
| 720 | - ); | |
| 721 | - ?> | |
| 702 | + <input name="_bbp_allow_content_throttle" id="_bbp_allow_content_throttle" type="checkbox" value="1" <?php checked( bbp_allow_content_throttle( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_content_throttle' ); ?> /> | |
| 703 | + <?php printf( esc_html__( 'Allow flood protection by throttling users for %s seconds after posting', 'bbpress' ), $select ); ?> | |
| 722 | 704 | </label> |
| 723 | 705 | <p class="description"><?php esc_html_e( 'Use this to discourage users from spamming your forums.', 'bbpress' ); ?></p> |
| 724 | 706 | |
| 725 | 707 | <?php |
| @@ -725,9 +707,9 @@ | ||
| 725 | 707 | <?php |
| 726 | 708 | } |
| 727 | 709 | |
| 728 | 710 | /** |
| 729 | - * Allow anonymous posting setting field. | |
| 711 | + * Allow anonymous posting setting field | |
| 730 | 712 | * |
| 731 | 713 | * @since 2.0.0 bbPress (r2737) |
| 732 | 714 | */ |
| 733 | 715 | function bbp_admin_setting_callback_anonymous() { |
| @@ -732,9 +714,9 @@ | ||
| 732 | 714 | */ |
| 733 | 715 | function bbp_admin_setting_callback_anonymous() { |
| 734 | 716 | ?> |
| 735 | 717 | |
| 736 | - <input name="_bbp_allow_anonymous" id="_bbp_allow_anonymous" type="checkbox" value="1" <?php checked( bbp_allow_anonymous( false ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_anonymous' ); ?> /> | |
| 718 | + <input name="_bbp_allow_anonymous" id="_bbp_allow_anonymous" type="checkbox" value="1" <?php checked( bbp_allow_anonymous( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_anonymous' ); ?> /> | |
| 737 | 719 | <label for="_bbp_allow_anonymous"><?php esc_html_e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label> |
| 738 | 720 | <p class="description"><?php esc_html_e( 'Works best on intranets or paired with antispam measures like Akismet.', 'bbpress' ); ?></p> |
| 739 | 721 | |
| 740 | 722 | <?php |
| @@ -740,9 +722,9 @@ | ||
| 740 | 722 | <?php |
| 741 | 723 | } |
| 742 | 724 | |
| 743 | 725 | /** |
| 744 | - * Allow global access setting field. | |
| 726 | + * Allow global access setting field | |
| 745 | 727 | * |
| 746 | 728 | * @since 2.0.0 bbPress (r3378) |
| 747 | 729 | */ |
| 748 | 730 | function bbp_admin_setting_callback_global_access() { |
| @@ -766,16 +748,10 @@ | ||
| 766 | 748 | |
| 767 | 749 | <?php $select = ob_get_clean(); ?> |
| 768 | 750 | |
| 769 | 751 | <label for="_bbp_allow_global_access"> |
| 770 | - <input name="_bbp_allow_global_access" id="_bbp_allow_global_access" type="checkbox" value="1" <?php checked( bbp_allow_global_access( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> /> | |
| 771 | - <?php | |
| 772 | - printf( | |
| 773 | - /* translators: %s: Default role name */ | |
| 774 | - esc_html__( 'Automatically give registered visitors the %s forum role', 'bbpress' ), | |
| 775 | - $select | |
| 776 | - ); | |
| 777 | - ?> | |
| 752 | + <input name="_bbp_allow_global_access" id="_bbp_allow_global_access" type="checkbox" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> /> | |
| 753 | + <?php printf( esc_html__( 'Automatically give registered visitors the %s forum role', 'bbpress' ), $select ); ?> | |
| 778 | 754 | </label> |
| 779 | 755 | <p class="description"><?php esc_html_e( 'Uncheck this to manually assign all user access to your forums.', 'bbpress' ); ?></p> |
| 780 | 756 | |
| 781 | 757 | <?php |
| @@ -783,9 +759,9 @@ | ||
| 783 | 759 | |
| 784 | 760 | /** Features Section **********************************************************/ |
| 785 | 761 | |
| 786 | 762 | /** |
| 787 | - * Features settings section description for the settings page. | |
| 763 | + * Features settings section description for the settings page | |
| 788 | 764 | * |
| 789 | 765 | * @since 2.0.0 bbPress (r2786) |
| 790 | 766 | */ |
| 791 | 767 | function bbp_admin_setting_callback_features_section() { |
| @@ -796,9 +772,9 @@ | ||
| 796 | 772 | <?php |
| 797 | 773 | } |
| 798 | 774 | |
| 799 | 775 | /** |
| 800 | - * Allow favorites setting field. | |
| 776 | + * Allow favorites setting field | |
| 801 | 777 | * |
| 802 | 778 | * @since 2.0.0 bbPress (r2786) |
| 803 | 779 | */ |
| 804 | 780 | function bbp_admin_setting_callback_favorites() { |
| @@ -803,9 +779,9 @@ | ||
| 803 | 779 | */ |
| 804 | 780 | function bbp_admin_setting_callback_favorites() { |
| 805 | 781 | ?> |
| 806 | 782 | |
| 807 | - <input name="_bbp_enable_favorites" id="_bbp_enable_favorites" type="checkbox" value="1" <?php checked( bbp_is_favorites_active( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_enable_favorites' ); ?> /> | |
| 783 | + <input name="_bbp_enable_favorites" id="_bbp_enable_favorites" type="checkbox" value="1" <?php checked( bbp_is_favorites_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_favorites' ); ?> /> | |
| 808 | 784 | <label for="_bbp_enable_favorites"><?php esc_html_e( 'Allow users to mark topics as favorites', 'bbpress' ); ?></label> |
| 809 | 785 | |
| 810 | 786 | <?php |
| 811 | 787 | } |
| @@ -810,9 +786,9 @@ | ||
| 810 | 786 | <?php |
| 811 | 787 | } |
| 812 | 788 | |
| 813 | 789 | /** |
| 814 | - * Allow subscriptions setting field. | |
| 790 | + * Allow subscriptions setting field | |
| 815 | 791 | * |
| 816 | 792 | * @since 2.0.0 bbPress (r2737) |
| 817 | 793 | */ |
| 818 | 794 | function bbp_admin_setting_callback_subscriptions() { |
| @@ -817,9 +793,9 @@ | ||
| 817 | 793 | */ |
| 818 | 794 | function bbp_admin_setting_callback_subscriptions() { |
| 819 | 795 | ?> |
| 820 | 796 | |
| 821 | - <input name="_bbp_enable_subscriptions" id="_bbp_enable_subscriptions" type="checkbox" value="1" <?php checked( bbp_is_subscriptions_active( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_enable_subscriptions' ); ?> /> | |
| 797 | + <input name="_bbp_enable_subscriptions" id="_bbp_enable_subscriptions" type="checkbox" value="1" <?php checked( bbp_is_subscriptions_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_subscriptions' ); ?> /> | |
| 822 | 798 | <label for="_bbp_enable_subscriptions"><?php esc_html_e( 'Allow users to subscribe to forums and topics', 'bbpress' ); ?></label> |
| 823 | 799 | |
| 824 | 800 | <?php |
| 825 | 801 | } |
| @@ -824,9 +800,9 @@ | ||
| 824 | 800 | <?php |
| 825 | 801 | } |
| 826 | 802 | |
| 827 | 803 | /** |
| 828 | - * Allow engagements setting field. | |
| 804 | + * Allow engagements setting field | |
| 829 | 805 | * |
| 830 | 806 | * @since 2.0.0 bbPress (r2737) |
| 831 | 807 | */ |
| 832 | 808 | function bbp_admin_setting_callback_engagements() { |
| @@ -831,9 +807,9 @@ | ||
| 831 | 807 | */ |
| 832 | 808 | function bbp_admin_setting_callback_engagements() { |
| 833 | 809 | ?> |
| 834 | 810 | |
| 835 | - <input name="_bbp_enable_engagements" id="_bbp_enable_engagements" type="checkbox" value="1" <?php checked( bbp_is_engagements_active( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_enable_engagements' ); ?> /> | |
| 811 | + <input name="_bbp_enable_engagements" id="_bbp_enable_engagements" type="checkbox" value="1" <?php checked( bbp_is_engagements_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_engagements' ); ?> /> | |
| 836 | 812 | <label for="_bbp_enable_engagements"><?php esc_html_e( 'Allow tracking of topics each user engages in', 'bbpress' ); ?></label> |
| 837 | 813 | |
| 838 | 814 | <?php |
| 839 | 815 | } |
| @@ -838,9 +814,9 @@ | ||
| 838 | 814 | <?php |
| 839 | 815 | } |
| 840 | 816 | |
| 841 | 817 | /** |
| 842 | - * Allow topic tags setting field. | |
| 818 | + * Allow topic tags setting field | |
| 843 | 819 | * |
| 844 | 820 | * @since 2.4.0 bbPress (r4944) |
| 845 | 821 | */ |
| 846 | 822 | function bbp_admin_setting_callback_topic_tags() { |
| @@ -845,9 +821,9 @@ | ||
| 845 | 821 | */ |
| 846 | 822 | function bbp_admin_setting_callback_topic_tags() { |
| 847 | 823 | ?> |
| 848 | 824 | |
| 849 | - <input name="_bbp_allow_topic_tags" id="_bbp_allow_topic_tags" type="checkbox" value="1" <?php checked( bbp_allow_topic_tags( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> /> | |
| 825 | + <input name="_bbp_allow_topic_tags" id="_bbp_allow_topic_tags" type="checkbox" value="1" <?php checked( bbp_allow_topic_tags( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> /> | |
| 850 | 826 | <label for="_bbp_allow_topic_tags"><?php esc_html_e( 'Allow topics to have tags', 'bbpress' ); ?></label> |
| 851 | 827 | |
| 852 | 828 | <?php |
| 853 | 829 | } |
| @@ -852,9 +828,9 @@ | ||
| 852 | 828 | <?php |
| 853 | 829 | } |
| 854 | 830 | |
| 855 | 831 | /** |
| 856 | - * Allow forum-mods setting field. | |
| 832 | + * Allow forum-mods setting field | |
| 857 | 833 | * |
| 858 | 834 | * @since 2.6.0 bbPress (r5834) |
| 859 | 835 | */ |
| 860 | 836 | function bbp_admin_setting_callback_forum_mods() { |
| @@ -859,9 +835,9 @@ | ||
| 859 | 835 | */ |
| 860 | 836 | function bbp_admin_setting_callback_forum_mods() { |
| 861 | 837 | ?> |
| 862 | 838 | |
| 863 | - <input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> /> | |
| 839 | + <input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> /> | |
| 864 | 840 | <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label> |
| 865 | 841 | <p class="description"><?php esc_html_e( 'This does not include the ability to edit users.', 'bbpress' ); ?></p> |
| 866 | 842 | |
| 867 | 843 | <?php |
| @@ -867,9 +843,9 @@ | ||
| 867 | 843 | <?php |
| 868 | 844 | } |
| 869 | 845 | |
| 870 | 846 | /** |
| 871 | - * Allow super-mods setting field. | |
| 847 | + * Allow super-mods setting field | |
| 872 | 848 | * |
| 873 | 849 | * @since 2.6.0 bbPress (r6562) |
| 874 | 850 | */ |
| 875 | 851 | function bbp_admin_setting_callback_super_mods() { |
| @@ -874,9 +850,9 @@ | ||
| 874 | 850 | */ |
| 875 | 851 | function bbp_admin_setting_callback_super_mods() { |
| 876 | 852 | ?> |
| 877 | 853 | |
| 878 | - <input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> /> | |
| 854 | + <input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> /> | |
| 879 | 855 | <label for="_bbp_allow_super_mods"><?php esc_html_e( 'Allow Moderators and Keymasters to edit users', 'bbpress' ); ?></label> |
| 880 | 856 | <p class="description"><?php esc_html_e( 'This includes roles, passwords, and email addresses.', 'bbpress' ); ?></p> |
| 881 | 857 | |
| 882 | 858 | <?php |
| @@ -882,9 +858,9 @@ | ||
| 882 | 858 | <?php |
| 883 | 859 | } |
| 884 | 860 | |
| 885 | 861 | /** |
| 886 | - * Allow forum wide search. | |
| 862 | + * Allow forum wide search | |
| 887 | 863 | * |
| 888 | 864 | * @since 2.4.0 bbPress (r4970) |
| 889 | 865 | */ |
| 890 | 866 | function bbp_admin_setting_callback_search() { |
| @@ -889,9 +865,9 @@ | ||
| 889 | 865 | */ |
| 890 | 866 | function bbp_admin_setting_callback_search() { |
| 891 | 867 | ?> |
| 892 | 868 | |
| 893 | - <input name="_bbp_allow_search" id="_bbp_allow_search" type="checkbox" value="1" <?php checked( bbp_allow_search( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_search' ); ?> /> | |
| 869 | + <input name="_bbp_allow_search" id="_bbp_allow_search" type="checkbox" value="1" <?php checked( bbp_allow_search( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_search' ); ?> /> | |
| 894 | 870 | <label for="_bbp_allow_search"><?php esc_html_e( 'Allow forum wide search', 'bbpress' ); ?></label> |
| 895 | 871 | |
| 896 | 872 | <?php |
| 897 | 873 | } |
| @@ -896,11 +872,11 @@ | ||
| 896 | 872 | <?php |
| 897 | 873 | } |
| 898 | 874 | |
| 899 | 875 | /** |
| 900 | - * Hierarchical reply maximum depth level setting field. | |
| 876 | + * Hierarchical reply maximum depth level setting field | |
| 901 | 877 | * |
| 902 | - * Replies will be threaded if depth is 2 or greater. | |
| 878 | + * Replies will be threaded if depth is 2 or greater | |
| 903 | 879 | * |
| 904 | 880 | * @since 2.4.0 bbPress (r4944) |
| 905 | 881 | */ |
| 906 | 882 | function bbp_admin_setting_callback_thread_replies_depth() { |
| @@ -924,21 +900,10 @@ | ||
| 924 | 900 | |
| 925 | 901 | <?php $select = ob_get_clean(); ?> |
| 926 | 902 | |
| 927 | 903 | <label for="_bbp_allow_threaded_replies"> |
| 928 | - <input name="_bbp_allow_threaded_replies" id="_bbp_allow_threaded_replies" type="checkbox" value="1" | |
| 929 | - <?php | |
| 930 | - checked( '1', bbp_allow_threaded_replies( false ) ); | |
| 931 | - bbp_maybe_admin_setting_disabled( '_bbp_allow_threaded_replies' ); | |
| 932 | - ?> | |
| 933 | - /> | |
| 934 | - <?php | |
| 935 | - printf( | |
| 936 | - /* translators: %s: Depth level input field HTML */ | |
| 937 | - esc_html__( 'Enable threaded (nested) replies %s levels deep', 'bbpress' ), | |
| 938 | - $select | |
| 939 | - ); | |
| 940 | - ?> | |
| 904 | + <input name="_bbp_allow_threaded_replies" id="_bbp_allow_threaded_replies" type="checkbox" value="1" <?php checked( '1', bbp_allow_threaded_replies( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_threaded_replies' ); ?> /> | |
| 905 | + <?php printf( esc_html__( 'Enable threaded (nested) replies %s levels deep', 'bbpress' ), $select ); ?> | |
| 941 | 906 | </label> |
| 942 | 907 | |
| 943 | 908 | <?php |
| 944 | 909 | } |
| @@ -943,9 +908,9 @@ | ||
| 943 | 908 | <?php |
| 944 | 909 | } |
| 945 | 910 | |
| 946 | 911 | /** |
| 947 | - * Allow topic and reply revisions. | |
| 912 | + * Allow topic and reply revisions | |
| 948 | 913 | * |
| 949 | 914 | * @since 2.0.0 bbPress (r3412) |
| 950 | 915 | */ |
| 951 | 916 | function bbp_admin_setting_callback_revisions() { |
| @@ -950,9 +915,9 @@ | ||
| 950 | 915 | */ |
| 951 | 916 | function bbp_admin_setting_callback_revisions() { |
| 952 | 917 | ?> |
| 953 | 918 | |
| 954 | - <input name="_bbp_allow_revisions" id="_bbp_allow_revisions" type="checkbox" value="1" <?php checked( bbp_allow_revisions( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_allow_revisions' ); ?> /> | |
| 919 | + <input name="_bbp_allow_revisions" id="_bbp_allow_revisions" type="checkbox" value="1" <?php checked( bbp_allow_revisions( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_revisions' ); ?> /> | |
| 955 | 920 | <label for="_bbp_allow_revisions"><?php esc_html_e( 'Allow topic and reply revision logging', 'bbpress' ); ?></label> |
| 956 | 921 | |
| 957 | 922 | <?php |
| 958 | 923 | } |
| @@ -957,9 +922,9 @@ | ||
| 957 | 922 | <?php |
| 958 | 923 | } |
| 959 | 924 | |
| 960 | 925 | /** |
| 961 | - * Use the WordPress editor setting field. | |
| 926 | + * Use the WordPress editor setting field | |
| 962 | 927 | * |
| 963 | 928 | * @since 2.1.0 bbPress (r3586) |
| 964 | 929 | */ |
| 965 | 930 | function bbp_admin_setting_callback_use_wp_editor() { |
| @@ -964,9 +929,9 @@ | ||
| 964 | 929 | */ |
| 965 | 930 | function bbp_admin_setting_callback_use_wp_editor() { |
| 966 | 931 | ?> |
| 967 | 932 | |
| 968 | - <input name="_bbp_use_wp_editor" id="_bbp_use_wp_editor" type="checkbox" value="1" <?php checked( bbp_use_wp_editor( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_use_wp_editor' ); ?> /> | |
| 933 | + <input name="_bbp_use_wp_editor" id="_bbp_use_wp_editor" type="checkbox" value="1" <?php checked( bbp_use_wp_editor( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_wp_editor' ); ?> /> | |
| 969 | 934 | <label for="_bbp_use_wp_editor"><?php esc_html_e( 'Add toolbar & buttons to textareas to help with HTML formatting', 'bbpress' ); ?></label> |
| 970 | 935 | |
| 971 | 936 | <?php |
| 972 | 937 | } |
| @@ -971,9 +936,9 @@ | ||
| 971 | 936 | <?php |
| 972 | 937 | } |
| 973 | 938 | |
| 974 | 939 | /** |
| 975 | - * Main subtheme section. | |
| 940 | + * Main subtheme section | |
| 976 | 941 | * |
| 977 | 942 | * @since 2.0.0 bbPress (r2786) |
| 978 | 943 | */ |
| 979 | 944 | function bbp_admin_setting_callback_subtheme_section() { |
| @@ -984,9 +949,9 @@ | ||
| 984 | 949 | <?php |
| 985 | 950 | } |
| 986 | 951 | |
| 987 | 952 | /** |
| 988 | - * Use the WordPress editor setting field. | |
| 953 | + * Use the WordPress editor setting field | |
| 989 | 954 | * |
| 990 | 955 | * @since 2.1.0 bbPress (r3586) |
| 991 | 956 | */ |
| 992 | 957 | function bbp_admin_setting_callback_subtheme_id() { |
| @@ -1016,9 +981,9 @@ | ||
| 1016 | 981 | <?php endif; |
| 1017 | 982 | } |
| 1018 | 983 | |
| 1019 | 984 | /** |
| 1020 | - * Allow oEmbed in replies. | |
| 985 | + * Allow oEmbed in replies | |
| 1021 | 986 | * |
| 1022 | 987 | * @since 2.1.0 bbPress (r3752) |
| 1023 | 988 | */ |
| 1024 | 989 | function bbp_admin_setting_callback_use_autoembed() { |
| @@ -1023,9 +988,9 @@ | ||
| 1023 | 988 | */ |
| 1024 | 989 | function bbp_admin_setting_callback_use_autoembed() { |
| 1025 | 990 | ?> |
| 1026 | 991 | |
| 1027 | - <input name="_bbp_use_autoembed" id="_bbp_use_autoembed" type="checkbox" value="1" <?php checked( bbp_use_autoembed( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_use_autoembed' ); ?> /> | |
| 992 | + <input name="_bbp_use_autoembed" id="_bbp_use_autoembed" type="checkbox" value="1" <?php checked( bbp_use_autoembed( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_use_autoembed' ); ?> /> | |
| 1028 | 993 | <label for="_bbp_use_autoembed"><?php esc_html_e( 'Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and replies', 'bbpress' ); ?></label> |
| 1029 | 994 | |
| 1030 | 995 | <?php |
| 1031 | 996 | } |
| @@ -1032,9 +997,9 @@ | ||
| 1032 | 997 | |
| 1033 | 998 | /** Per Page Section **********************************************************/ |
| 1034 | 999 | |
| 1035 | 1000 | /** |
| 1036 | - * Per page settings section description for the settings page. | |
| 1001 | + * Per page settings section description for the settings page | |
| 1037 | 1002 | * |
| 1038 | 1003 | * @since 2.0.0 bbPress (r2786) |
| 1039 | 1004 | */ |
| 1040 | 1005 | function bbp_admin_setting_callback_per_page_section() { |
| @@ -1045,9 +1010,9 @@ | ||
| 1045 | 1010 | <?php |
| 1046 | 1011 | } |
| 1047 | 1012 | |
| 1048 | 1013 | /** |
| 1049 | - * Topics per page setting field. | |
| 1014 | + * Topics per page setting field | |
| 1050 | 1015 | * |
| 1051 | 1016 | * @since 2.0.0 bbPress (r2786) |
| 1052 | 1017 | */ |
| 1053 | 1018 | function bbp_admin_setting_callback_topics_per_page() { |
| @@ -1059,9 +1024,9 @@ | ||
| 1059 | 1024 | <?php |
| 1060 | 1025 | } |
| 1061 | 1026 | |
| 1062 | 1027 | /** |
| 1063 | - * Replies per page setting field. | |
| 1028 | + * Replies per page setting field | |
| 1064 | 1029 | * |
| 1065 | 1030 | * @since 2.0.0 bbPress (r2786) |
| 1066 | 1031 | */ |
| 1067 | 1032 | function bbp_admin_setting_callback_replies_per_page() { |
| @@ -1075,9 +1040,9 @@ | ||
| 1075 | 1040 | |
| 1076 | 1041 | /** Per RSS Page Section ******************************************************/ |
| 1077 | 1042 | |
| 1078 | 1043 | /** |
| 1079 | - * Per page settings section description for the settings page. | |
| 1044 | + * Per page settings section description for the settings page | |
| 1080 | 1045 | * |
| 1081 | 1046 | * @since 2.0.0 bbPress (r2786) |
| 1082 | 1047 | */ |
| 1083 | 1048 | function bbp_admin_setting_callback_per_rss_page_section() { |
| @@ -1088,9 +1053,9 @@ | ||
| 1088 | 1053 | <?php |
| 1089 | 1054 | } |
| 1090 | 1055 | |
| 1091 | 1056 | /** |
| 1092 | - * Topics per RSS page setting field. | |
| 1057 | + * Topics per RSS page setting field | |
| 1093 | 1058 | * |
| 1094 | 1059 | * @since 2.0.0 bbPress (r2786) |
| 1095 | 1060 | */ |
| 1096 | 1061 | function bbp_admin_setting_callback_topics_per_rss_page() { |
| @@ -1102,9 +1067,9 @@ | ||
| 1102 | 1067 | <?php |
| 1103 | 1068 | } |
| 1104 | 1069 | |
| 1105 | 1070 | /** |
| 1106 | - * Replies per RSS page setting field. | |
| 1071 | + * Replies per RSS page setting field | |
| 1107 | 1072 | * |
| 1108 | 1073 | * @since 2.0.0 bbPress (r2786) |
| 1109 | 1074 | */ |
| 1110 | 1075 | function bbp_admin_setting_callback_replies_per_rss_page() { |
| @@ -1118,9 +1083,9 @@ | ||
| 1118 | 1083 | |
| 1119 | 1084 | /** Slug Section **************************************************************/ |
| 1120 | 1085 | |
| 1121 | 1086 | /** |
| 1122 | - * Slugs settings section description for the settings page. | |
| 1087 | + * Slugs settings section description for the settings page | |
| 1123 | 1088 | * |
| 1124 | 1089 | * @since 2.0.0 bbPress (r2786) |
| 1125 | 1090 | */ |
| 1126 | 1091 | function bbp_admin_setting_callback_root_slug_section() { |
| @@ -1135,9 +1100,9 @@ | ||
| 1135 | 1100 | <?php |
| 1136 | 1101 | } |
| 1137 | 1102 | |
| 1138 | 1103 | /** |
| 1139 | - * Root slug setting field. | |
| 1104 | + * Root slug setting field | |
| 1140 | 1105 | * |
| 1141 | 1106 | * @since 2.0.0 bbPress (r2786) |
| 1142 | 1107 | */ |
| 1143 | 1108 | function bbp_admin_setting_callback_root_slug() { |
| @@ -1150,9 +1115,9 @@ | ||
| 1150 | 1115 | bbp_form_slug_conflict_check( '_bbp_root_slug', 'forums' ); |
| 1151 | 1116 | } |
| 1152 | 1117 | |
| 1153 | 1118 | /** |
| 1154 | - * Include root slug setting field. | |
| 1119 | + * Include root slug setting field | |
| 1155 | 1120 | * |
| 1156 | 1121 | * @since 2.0.0 bbPress (r2786) |
| 1157 | 1122 | */ |
| 1158 | 1123 | function bbp_admin_setting_callback_include_root() { |
| @@ -1157,9 +1122,9 @@ | ||
| 1157 | 1122 | */ |
| 1158 | 1123 | function bbp_admin_setting_callback_include_root() { |
| 1159 | 1124 | ?> |
| 1160 | 1125 | |
| 1161 | - <input name="_bbp_include_root" id="_bbp_include_root" type="checkbox" value="1" <?php checked( bbp_include_root_slug() ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_include_root' ); ?> /> | |
| 1126 | + <input name="_bbp_include_root" id="_bbp_include_root" type="checkbox" value="1" <?php checked( bbp_include_root_slug() ); bbp_maybe_admin_setting_disabled( '_bbp_include_root' ); ?> /> | |
| 1162 | 1127 | <label for="_bbp_include_root"><?php esc_html_e( 'Prefix all forum content with the Forum Root slug (Recommended)', 'bbpress' ); ?></label> |
| 1163 | 1128 | |
| 1164 | 1129 | <?php |
| 1165 | 1130 | } |
| @@ -1164,9 +1129,9 @@ | ||
| 1164 | 1129 | <?php |
| 1165 | 1130 | } |
| 1166 | 1131 | |
| 1167 | 1132 | /** |
| 1168 | - * Include root slug setting field. | |
| 1133 | + * Include root slug setting field | |
| 1169 | 1134 | * |
| 1170 | 1135 | * @since 2.0.0 bbPress (r2786) |
| 1171 | 1136 | */ |
| 1172 | 1137 | function bbp_admin_setting_callback_show_on_root() { |
| @@ -1201,17 +1166,9 @@ | ||
| 1201 | 1166 | |
| 1202 | 1167 | // This setting doesn't work if the theme has an archive-forum.php template. |
| 1203 | 1168 | if ( ! empty( $forum_archive ) ) : ?> |
| 1204 | 1169 | |
| 1205 | - <p class="description"> | |
| 1206 | - <?php | |
| 1207 | - printf( | |
| 1208 | - /* translators: %s: Forum archive template file path */ | |
| 1209 | - esc_html__( 'This setting will be ignored because %s was found in your theme.', 'bbpress' ), | |
| 1210 | - '<code>' . $forum_archive . '</code>' | |
| 1211 | - ); | |
| 1212 | - ?> | |
| 1213 | - </p> | |
| 1170 | + <p class="description"><?php printf( esc_html__( 'This setting will be ignored because %s was found in your theme.', 'bbpress' ), '<code>' . $forum_archive . '</code>' ); ?></p> | |
| 1214 | 1171 | |
| 1215 | 1172 | <?php endif; |
| 1216 | 1173 | } |
| 1217 | 1174 | |
| @@ -1217,9 +1174,9 @@ | ||
| 1217 | 1174 | |
| 1218 | 1175 | /** User Slug Section *********************************************************/ |
| 1219 | 1176 | |
| 1220 | 1177 | /** |
| 1221 | - * Slugs settings section description for the settings page. | |
| 1178 | + * Slugs settings section description for the settings page | |
| 1222 | 1179 | * |
| 1223 | 1180 | * @since 2.0.0 bbPress (r2786) |
| 1224 | 1181 | */ |
| 1225 | 1182 | function bbp_admin_setting_callback_user_slug_section() { |
| @@ -1230,9 +1187,9 @@ | ||
| 1230 | 1187 | <?php |
| 1231 | 1188 | } |
| 1232 | 1189 | |
| 1233 | 1190 | /** |
| 1234 | - * User slug setting field. | |
| 1191 | + * User slug setting field | |
| 1235 | 1192 | * |
| 1236 | 1193 | * @since 2.0.0 bbPress (r2786) |
| 1237 | 1194 | */ |
| 1238 | 1195 | function bbp_admin_setting_callback_user_slug() { |
| @@ -1245,9 +1202,9 @@ | ||
| 1245 | 1202 | bbp_form_slug_conflict_check( '_bbp_user_slug', 'users' ); |
| 1246 | 1203 | } |
| 1247 | 1204 | |
| 1248 | 1205 | /** |
| 1249 | - * Topic archive slug setting field. | |
| 1206 | + * Topic archive slug setting field | |
| 1250 | 1207 | * |
| 1251 | 1208 | * @since 2.0.0 bbPress (r2786) |
| 1252 | 1209 | */ |
| 1253 | 1210 | function bbp_admin_setting_callback_topic_archive_slug() { |
| @@ -1260,9 +1217,9 @@ | ||
| 1260 | 1217 | bbp_form_slug_conflict_check( '_bbp_topic_archive_slug', 'topics' ); |
| 1261 | 1218 | } |
| 1262 | 1219 | |
| 1263 | 1220 | /** |
| 1264 | - * Reply archive slug setting field. | |
| 1221 | + * Reply archive slug setting field | |
| 1265 | 1222 | * |
| 1266 | 1223 | * @since 2.4.0 bbPress (r4932) |
| 1267 | 1224 | */ |
| 1268 | 1225 | function bbp_admin_setting_callback_reply_archive_slug() { |
| @@ -1275,9 +1232,9 @@ | ||
| 1275 | 1232 | bbp_form_slug_conflict_check( '_bbp_reply_archive_slug', 'replies' ); |
| 1276 | 1233 | } |
| 1277 | 1234 | |
| 1278 | 1235 | /** |
| 1279 | - * Favorites slug setting field. | |
| 1236 | + * Favorites slug setting field | |
| 1280 | 1237 | * |
| 1281 | 1238 | * @since 2.4.0 bbPress (r4932) |
| 1282 | 1239 | */ |
| 1283 | 1240 | function bbp_admin_setting_callback_user_favs_slug() { |
| @@ -1290,9 +1247,9 @@ | ||
| 1290 | 1247 | bbp_form_slug_conflict_check( '_bbp_user_favs_slug', 'favorites' ); |
| 1291 | 1248 | } |
| 1292 | 1249 | |
| 1293 | 1250 | /** |
| 1294 | - * Subscriptions slug setting field. | |
| 1251 | + * Subscriptions slug setting field | |
| 1295 | 1252 | * |
| 1296 | 1253 | * @since 2.4.0 bbPress (r4932) |
| 1297 | 1254 | */ |
| 1298 | 1255 | function bbp_admin_setting_callback_user_subs_slug() { |
| @@ -1305,9 +1262,9 @@ | ||
| 1305 | 1262 | bbp_form_slug_conflict_check( '_bbp_user_subs_slug', 'subscriptions' ); |
| 1306 | 1263 | } |
| 1307 | 1264 | |
| 1308 | 1265 | /** |
| 1309 | - * Engagements slug setting field. | |
| 1266 | + * Engagements slug setting field | |
| 1310 | 1267 | * |
| 1311 | 1268 | * @since 2.6.0 bbPress (r6320) |
| 1312 | 1269 | */ |
| 1313 | 1270 | function bbp_admin_setting_callback_user_engagements_slug() { |
| @@ -1322,9 +1279,9 @@ | ||
| 1322 | 1279 | |
| 1323 | 1280 | /** Single Slugs **************************************************************/ |
| 1324 | 1281 | |
| 1325 | 1282 | /** |
| 1326 | - * Slugs settings section description for the settings page. | |
| 1283 | + * Slugs settings section description for the settings page | |
| 1327 | 1284 | * |
| 1328 | 1285 | * @since 2.0.0 bbPress (r2786) |
| 1329 | 1286 | */ |
| 1330 | 1287 | function bbp_admin_setting_callback_single_slug_section() { |
| @@ -1335,9 +1292,9 @@ | ||
| 1335 | 1292 | <?php |
| 1336 | 1293 | } |
| 1337 | 1294 | |
| 1338 | 1295 | /** |
| 1339 | - * Forum slug setting field. | |
| 1296 | + * Forum slug setting field | |
| 1340 | 1297 | * |
| 1341 | 1298 | * @since 2.0.0 bbPress (r2786) |
| 1342 | 1299 | */ |
| 1343 | 1300 | function bbp_admin_setting_callback_forum_slug() { |
| @@ -1350,9 +1307,9 @@ | ||
| 1350 | 1307 | bbp_form_slug_conflict_check( '_bbp_forum_slug', 'forum' ); |
| 1351 | 1308 | } |
| 1352 | 1309 | |
| 1353 | 1310 | /** |
| 1354 | - * Topic slug setting field. | |
| 1311 | + * Topic slug setting field | |
| 1355 | 1312 | * |
| 1356 | 1313 | * @since 2.0.0 bbPress (r2786) |
| 1357 | 1314 | */ |
| 1358 | 1315 | function bbp_admin_setting_callback_topic_slug() { |
| @@ -1365,9 +1322,9 @@ | ||
| 1365 | 1322 | bbp_form_slug_conflict_check( '_bbp_topic_slug', 'topic' ); |
| 1366 | 1323 | } |
| 1367 | 1324 | |
| 1368 | 1325 | /** |
| 1369 | - * Reply slug setting field. | |
| 1326 | + * Reply slug setting field | |
| 1370 | 1327 | * |
| 1371 | 1328 | * @since 2.0.0 bbPress (r2786) |
| 1372 | 1329 | */ |
| 1373 | 1330 | function bbp_admin_setting_callback_reply_slug() { |
| @@ -1380,9 +1337,9 @@ | ||
| 1380 | 1337 | bbp_form_slug_conflict_check( '_bbp_reply_slug', 'reply' ); |
| 1381 | 1338 | } |
| 1382 | 1339 | |
| 1383 | 1340 | /** |
| 1384 | - * Topic tag slug setting field. | |
| 1341 | + * Topic tag slug setting field | |
| 1385 | 1342 | * |
| 1386 | 1343 | * @since 2.0.0 bbPress (r2786) |
| 1387 | 1344 | */ |
| 1388 | 1345 | function bbp_admin_setting_callback_topic_tag_slug() { |
| @@ -1396,9 +1353,9 @@ | ||
| 1396 | 1353 | bbp_form_slug_conflict_check( '_bbp_topic_tag_slug', 'topic-tag' ); |
| 1397 | 1354 | } |
| 1398 | 1355 | |
| 1399 | 1356 | /** |
| 1400 | - * View slug setting field. | |
| 1357 | + * View slug setting field | |
| 1401 | 1358 | * |
| 1402 | 1359 | * @since 2.0.0 bbPress (r2789) |
| 1403 | 1360 | */ |
| 1404 | 1361 | function bbp_admin_setting_callback_view_slug() { |
| @@ -1411,9 +1368,9 @@ | ||
| 1411 | 1368 | bbp_form_slug_conflict_check( '_bbp_view_slug', 'view' ); |
| 1412 | 1369 | } |
| 1413 | 1370 | |
| 1414 | 1371 | /** |
| 1415 | - * Search slug setting field. | |
| 1372 | + * Search slug setting field | |
| 1416 | 1373 | * |
| 1417 | 1374 | * @since 2.3.0 bbPress (r4579) |
| 1418 | 1375 | */ |
| 1419 | 1376 | function bbp_admin_setting_callback_search_slug() { |
| @@ -1426,9 +1383,9 @@ | ||
| 1426 | 1383 | bbp_form_slug_conflict_check( '_bbp_search_slug', 'search' ); |
| 1427 | 1384 | } |
| 1428 | 1385 | |
| 1429 | 1386 | /** |
| 1430 | - * Edit slug setting field. | |
| 1387 | + * Edit slug setting field | |
| 1431 | 1388 | * |
| 1432 | 1389 | * @since 2.6.2 bbPress (r6965) |
| 1433 | 1390 | */ |
| 1434 | 1391 | function bbp_admin_setting_callback_edit_slug() { |
| @@ -1443,9 +1400,9 @@ | ||
| 1443 | 1400 | |
| 1444 | 1401 | /** BuddyPress ****************************************************************/ |
| 1445 | 1402 | |
| 1446 | 1403 | /** |
| 1447 | - * Extension settings section description for the settings page. | |
| 1404 | + * Extension settings section description for the settings page | |
| 1448 | 1405 | * |
| 1449 | 1406 | * @since 2.1.0 bbPress (r3575) |
| 1450 | 1407 | */ |
| 1451 | 1408 | function bbp_admin_setting_callback_buddypress_section() { |
| @@ -1456,9 +1413,9 @@ | ||
| 1456 | 1413 | <?php |
| 1457 | 1414 | } |
| 1458 | 1415 | |
| 1459 | 1416 | /** |
| 1460 | - * Allow BuddyPress group forums setting field. | |
| 1417 | + * Allow BuddyPress group forums setting field | |
| 1461 | 1418 | * |
| 1462 | 1419 | * @since 2.1.0 bbPress (r3575) |
| 1463 | 1420 | */ |
| 1464 | 1421 | function bbp_admin_setting_callback_group_forums() { |
| @@ -1463,9 +1420,9 @@ | ||
| 1463 | 1420 | */ |
| 1464 | 1421 | function bbp_admin_setting_callback_group_forums() { |
| 1465 | 1422 | ?> |
| 1466 | 1423 | |
| 1467 | - <input name="_bbp_enable_group_forums" id="_bbp_enable_group_forums" type="checkbox" value="1" <?php checked( bbp_is_group_forums_active( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_enable_group_forums' ); ?> /> | |
| 1424 | + <input name="_bbp_enable_group_forums" id="_bbp_enable_group_forums" type="checkbox" value="1" <?php checked( bbp_is_group_forums_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_group_forums' ); ?> /> | |
| 1468 | 1425 | <label for="_bbp_enable_group_forums"><?php esc_html_e( 'Allow BuddyPress Groups to have their own forums', 'bbpress' ); ?></label> |
| 1469 | 1426 | |
| 1470 | 1427 | <?php |
| 1471 | 1428 | } |
| @@ -1470,9 +1427,9 @@ | ||
| 1470 | 1427 | <?php |
| 1471 | 1428 | } |
| 1472 | 1429 | |
| 1473 | 1430 | /** |
| 1474 | - * Replies per page setting field. | |
| 1431 | + * Replies per page setting field | |
| 1475 | 1432 | * |
| 1476 | 1433 | * @since 2.1.0 bbPress (r3575) |
| 1477 | 1434 | */ |
| 1478 | 1435 | function bbp_admin_setting_callback_group_forums_root_id() { |
| @@ -1484,19 +1441,17 @@ | ||
| 1484 | 1441 | $group_root = 0; |
| 1485 | 1442 | } |
| 1486 | 1443 | |
| 1487 | 1444 | // Output the dropdown for all forums |
| 1488 | - $select = bbp_get_dropdown( | |
| 1489 | - array( | |
| 1490 | - 'selected' => $group_root, | |
| 1491 | - 'show_none' => esc_html__( '— No parent —', 'bbpress' ), | |
| 1492 | - 'orderby' => 'title', | |
| 1493 | - 'order' => 'ASC', | |
| 1494 | - 'select_id' => '_bbp_group_forums_root_id', | |
| 1495 | - 'disable_categories' => false, | |
| 1496 | - 'disabled' => '_bbp_group_forums_root_id' | |
| 1497 | - ) | |
| 1498 | - ); | |
| 1445 | + $select = bbp_get_dropdown( array( | |
| 1446 | + 'selected' => $group_root, | |
| 1447 | + 'show_none' => esc_html__( '— No parent —', 'bbpress' ), | |
| 1448 | + 'orderby' => 'title', | |
| 1449 | + 'order' => 'ASC', | |
| 1450 | + 'select_id' => '_bbp_group_forums_root_id', | |
| 1451 | + 'disable_categories' => false, | |
| 1452 | + 'disabled' => '_bbp_group_forums_root_id' | |
| 1453 | + ) ); | |
| 1499 | 1454 | |
| 1500 | 1455 | // Check cap one time |
| 1501 | 1456 | $can_add_new = current_user_can( 'publish_forums' ); |
| 1502 | 1457 | $button = ''; |
| @@ -1504,25 +1459,17 @@ | ||
| 1504 | 1459 | // Text variations based on configuration |
| 1505 | 1460 | if ( empty( $group_root ) && ( true === $can_add_new ) ) { |
| 1506 | 1461 | |
| 1507 | 1462 | // New URL |
| 1508 | - $new_url = wp_nonce_url( | |
| 1509 | - add_query_arg( | |
| 1510 | - array( | |
| 1511 | - 'page' => 'bbpress', | |
| 1512 | - 'create' => 'bbp-group-forum-root' | |
| 1513 | - ), | |
| 1514 | - admin_url( 'options-general.php' ) | |
| 1515 | - ), | |
| 1516 | - '_bbp_group_forums_root_id' | |
| 1517 | - ); | |
| 1463 | + $new_url = wp_nonce_url( add_query_arg( array( | |
| 1464 | + 'page' => 'bbpress', | |
| 1465 | + 'create' => 'bbp-group-forum-root' | |
| 1466 | + ), admin_url( 'options-general.php' ) ), '_bbp_group_forums_root_id' ); | |
| 1518 | 1467 | |
| 1519 | 1468 | // Button & text |
| 1520 | 1469 | $button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>'; |
| 1521 | - /* translators: 1: Forum select dropdown HTML, 2: Create new forum link HTML */ | |
| 1522 | - $text = esc_html__( 'Use %1$s to contain your group forums, or %2$s', 'bbpress' ); | |
| 1470 | + $text = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); //phpcs:ignore | |
| 1523 | 1471 | } else { |
| 1524 | - /* translators: %s: Forum select dropdown HTML */ | |
| 1525 | 1472 | $text = esc_html__( 'Use %s to contain your group forums', 'bbpress' ); |
| 1526 | 1473 | } |
| 1527 | 1474 | |
| 1528 | 1475 | // Output |
| @@ -1534,9 +1481,9 @@ | ||
| 1534 | 1481 | |
| 1535 | 1482 | /** Akismet *******************************************************************/ |
| 1536 | 1483 | |
| 1537 | 1484 | /** |
| 1538 | - * Extension settings section description for the settings page. | |
| 1485 | + * Extension settings section description for the settings page | |
| 1539 | 1486 | * |
| 1540 | 1487 | * @since 2.1.0 bbPress (r3575) |
| 1541 | 1488 | */ |
| 1542 | 1489 | function bbp_admin_setting_callback_akismet_section() { |
| @@ -1548,9 +1495,9 @@ | ||
| 1548 | 1495 | } |
| 1549 | 1496 | |
| 1550 | 1497 | |
| 1551 | 1498 | /** |
| 1552 | - * Allow Akismet setting field. | |
| 1499 | + * Allow Akismet setting field | |
| 1553 | 1500 | * |
| 1554 | 1501 | * @since 2.1.0 bbPress (r3575) |
| 1555 | 1502 | */ |
| 1556 | 1503 | function bbp_admin_setting_callback_akismet() { |
| @@ -1555,9 +1502,9 @@ | ||
| 1555 | 1502 | */ |
| 1556 | 1503 | function bbp_admin_setting_callback_akismet() { |
| 1557 | 1504 | ?> |
| 1558 | 1505 | |
| 1559 | - <input name="_bbp_enable_akismet" id="_bbp_enable_akismet" type="checkbox" value="1" <?php checked( bbp_is_akismet_active( true ) ); ?><?php bbp_maybe_admin_setting_disabled( '_bbp_enable_akismet' ); ?> /> | |
| 1506 | + <input name="_bbp_enable_akismet" id="_bbp_enable_akismet" type="checkbox" value="1" <?php checked( bbp_is_akismet_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_akismet' ); ?> /> | |
| 1560 | 1507 | <label for="_bbp_enable_akismet"><?php esc_html_e( 'Allow Akismet to actively prevent forum spam.', 'bbpress' ); ?></label> |
| 1561 | 1508 | |
| 1562 | 1509 | <?php |
| 1563 | 1510 | } |
| @@ -1564,9 +1511,9 @@ | ||
| 1564 | 1511 | |
| 1565 | 1512 | /** Settings Page *************************************************************/ |
| 1566 | 1513 | |
| 1567 | 1514 | /** |
| 1568 | - * The main settings page. | |
| 1515 | + * The main settings page | |
| 1569 | 1516 | * |
| 1570 | 1517 | * @since 2.0.0 bbPress (r2643) |
| 1571 | 1518 | */ |
| 1572 | 1519 | function bbp_admin_settings() { |
| @@ -1593,9 +1540,9 @@ | ||
| 1593 | 1540 | |
| 1594 | 1541 | /** Converter Section *********************************************************/ |
| 1595 | 1542 | |
| 1596 | 1543 | /** |
| 1597 | - * Main settings section description for the settings page. | |
| 1544 | + * Main settings section description for the settings page | |
| 1598 | 1545 | * |
| 1599 | 1546 | * @since 2.1.0 bbPress (r3813) |
| 1600 | 1547 | */ |
| 1601 | 1548 | function bbp_converter_setting_callback_main_section() { |
| @@ -1600,15 +1547,15 @@ | ||
| 1600 | 1547 | */ |
| 1601 | 1548 | function bbp_converter_setting_callback_main_section() { |
| 1602 | 1549 | ?> |
| 1603 | 1550 | |
| 1604 | - <p><?php esc_html_e( 'Information about the database for your previous forums so they can be converted.', 'bbpress' ); ?></p> | |
| 1551 | + <p><?php _e( 'Information about the database for your previous forums so they can be converted.', 'bbpress' ); ?></p> | |
| 1605 | 1552 | |
| 1606 | 1553 | <?php |
| 1607 | 1554 | } |
| 1608 | 1555 | |
| 1609 | 1556 | /** |
| 1610 | - * Edit Platform setting field. | |
| 1557 | + * Edit Platform setting field | |
| 1611 | 1558 | * |
| 1612 | 1559 | * @since 2.1.0 bbPress (r3813) |
| 1613 | 1560 | */ |
| 1614 | 1561 | function bbp_converter_setting_callback_platform() { |
| @@ -1629,64 +1576,37 @@ | ||
| 1629 | 1576 | <?php |
| 1630 | 1577 | } |
| 1631 | 1578 | |
| 1632 | 1579 | /** |
| 1633 | - * Edit Database Server setting field. | |
| 1580 | + * Edit Database Server setting field | |
| 1634 | 1581 | * |
| 1635 | 1582 | * @since 2.1.0 bbPress (r3813) |
| 1636 | 1583 | */ |
| 1637 | 1584 | function bbp_converter_setting_callback_dbserver() { |
| 1638 | 1585 | ?> |
| 1639 | - <input | |
| 1640 | - name="_bbp_converter_db_server" | |
| 1641 | - id="_bbp_converter_db_server" | |
| 1642 | - type="text" | |
| 1643 | - class="code" | |
| 1644 | - value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" | |
| 1645 | - <?php bbp_maybe_admin_setting_disabled( '_bbp_converter_db_server' ); ?> | |
| 1646 | - /> | |
| 1647 | - <p class="description"> | |
| 1648 | - <?php | |
| 1649 | - printf( | |
| 1650 | - /* translators: %s: Default value wrapped in code tags */ | |
| 1651 | - esc_html__( 'Use default %s if same server, or IP or hostname', 'bbpress' ), | |
| 1652 | - '<code>localhost</code>' | |
| 1653 | - ); | |
| 1654 | - ?> | |
| 1655 | - </p> | |
| 1656 | - <?php | |
| 1586 | + | |
| 1587 | + <input name="_bbp_converter_db_server" id="_bbp_converter_db_server" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" <?php bbp_maybe_admin_setting_disabled( '_bbp_converter_db_server' ); ?> /> | |
| 1588 | + <p class="description"><?php printf( esc_html__( 'Use default %s if same server, or IP or hostname', 'bbpress' ), '<code>localhost</code>' ); ?></p> | |
| 1589 | + | |
| 1590 | +<?php | |
| 1657 | 1591 | } |
| 1658 | 1592 | |
| 1659 | 1593 | /** |
| 1660 | - * Edit Database Server Port setting field. | |
| 1594 | + * Edit Database Server Port setting field | |
| 1661 | 1595 | * |
| 1662 | 1596 | * @since 2.1.0 bbPress (r3813) |
| 1663 | 1597 | */ |
| 1664 | 1598 | function bbp_converter_setting_callback_dbport() { |
| 1665 | - ?> | |
| 1666 | - <input | |
| 1667 | - name="_bbp_converter_db_port" | |
| 1668 | - id="_bbp_converter_db_port" | |
| 1669 | - type="text" | |
| 1670 | - class="code" | |
| 1671 | - value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" | |
| 1672 | - <?php bbp_maybe_admin_setting_disabled( '_bbp_converter_db_port' ); ?> | |
| 1673 | - /> | |
| 1674 | - <p class="description"> | |
| 1675 | - <?php | |
| 1599 | +?> | |
| 1676 | 1600 | |
| 1677 | - printf( | |
| 1678 | - /* translators: %s: Default port number wrapped in code tags */ | |
| 1679 | - esc_html__( 'Use default %s if unsure', 'bbpress' ), | |
| 1680 | - '<code>3306</code>' | |
| 1681 | - ); | |
| 1682 | - ?> | |
| 1683 | - </p> | |
| 1684 | - <?php | |
| 1601 | + <input name="_bbp_converter_db_port" id="_bbp_converter_db_port" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" <?php bbp_maybe_admin_setting_disabled( '_bbp_converter_db_port' ); ?> /> | |
| 1602 | + <p class="description"><?php printf( esc_html__( 'Use default %s if unsure', 'bbpress' ), '<code>3306</code>' ); ?></p> | |
| 1603 | + | |
| 1604 | +<?php | |
| 1685 | 1605 | } |
| 1686 | 1606 | |
| 1687 | 1607 | /** |
| 1688 | - * Edit Database User setting field. | |
| 1608 | + * Edit Database User setting field | |
| 1689 | 1609 | * |
| 1690 | 1610 | * @since 2.1.0 bbPress (r3813) |
| 1691 | 1611 | */ |
| 1692 | 1612 | function bbp_converter_setting_callback_dbuser() { |
| @@ -1698,9 +1618,9 @@ | ||
| 1698 | 1618 | <?php |
| 1699 | 1619 | } |
| 1700 | 1620 | |
| 1701 | 1621 | /** |
| 1702 | - * Edit Database Pass setting field. | |
| 1622 | + * Edit Database Pass setting field | |
| 1703 | 1623 | * |
| 1704 | 1624 | * @since 2.1.0 bbPress (r3813) |
| 1705 | 1625 | */ |
| 1706 | 1626 | function bbp_converter_setting_callback_dbpass() { |
| @@ -1718,9 +1638,9 @@ | ||
| 1718 | 1638 | <?php |
| 1719 | 1639 | } |
| 1720 | 1640 | |
| 1721 | 1641 | /** |
| 1722 | - * Edit Database Name setting field. | |
| 1642 | + * Edit Database Name setting field | |
| 1723 | 1643 | * |
| 1724 | 1644 | * @since 2.1.0 bbPress (r3813) |
| 1725 | 1645 | */ |
| 1726 | 1646 | function bbp_converter_setting_callback_dbname() { |
| @@ -1732,9 +1652,9 @@ | ||
| 1732 | 1652 | <?php |
| 1733 | 1653 | } |
| 1734 | 1654 | |
| 1735 | 1655 | /** |
| 1736 | - * Main settings section description for the settings page. | |
| 1656 | + * Main settings section description for the settings page | |
| 1737 | 1657 | * |
| 1738 | 1658 | * @since 2.1.0 bbPress (r3813) |
| 1739 | 1659 | */ |
| 1740 | 1660 | function bbp_converter_setting_callback_options_section() { |
| @@ -1745,9 +1665,9 @@ | ||
| 1745 | 1665 | <?php |
| 1746 | 1666 | } |
| 1747 | 1667 | |
| 1748 | 1668 | /** |
| 1749 | - * Edit Table Prefix setting field. | |
| 1669 | + * Edit Table Prefix setting field | |
| 1750 | 1670 | * |
| 1751 | 1671 | * @since 2.1.0 bbPress (r3813) |
| 1752 | 1672 | */ |
| 1753 | 1673 | function bbp_converter_setting_callback_dbprefix() { |
| @@ -1753,22 +1673,15 @@ | ||
| 1753 | 1673 | function bbp_converter_setting_callback_dbprefix() { |
| 1754 | 1674 | ?> |
| 1755 | 1675 | |
| 1756 | 1676 | <input name="_bbp_converter_db_prefix" id="_bbp_converter_db_prefix" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_prefix' ); ?>" <?php bbp_maybe_admin_setting_disabled( '_bbp_converter_db_prefix' ); ?> /> |
| 1757 | - <p class="description"> | |
| 1758 | - <?php printf( | |
| 1759 | - /* translators: %s: Database prefix example wrapped in code tags */ | |
| 1760 | - esc_html__( 'Use %s if converting from BuddyPress Legacy', 'bbpress' ), | |
| 1761 | - '<code>wp_bb_</code>' | |
| 1762 | - ); | |
| 1763 | - ?> | |
| 1764 | - </p> | |
| 1677 | + <p class="description"><?php printf( esc_html__( 'Use %s if converting from BuddyPress Legacy', 'bbpress' ), '<code>wp_bb_</code>' ); ?></p> | |
| 1765 | 1678 | |
| 1766 | 1679 | <?php |
| 1767 | 1680 | } |
| 1768 | 1681 | |
| 1769 | 1682 | /** |
| 1770 | - * Edit Rows Limit setting field. | |
| 1683 | + * Edit Rows Limit setting field | |
| 1771 | 1684 | * |
| 1772 | 1685 | * @since 2.1.0 bbPress (r3813) |
| 1773 | 1686 | */ |
| 1774 | 1687 | function bbp_converter_setting_callback_rows() { |
| @@ -1781,9 +1694,9 @@ | ||
| 1781 | 1694 | <?php |
| 1782 | 1695 | } |
| 1783 | 1696 | |
| 1784 | 1697 | /** |
| 1785 | - * Edit Delay Time setting field. | |
| 1698 | + * Edit Delay Time setting field | |
| 1786 | 1699 | * |
| 1787 | 1700 | * @since 2.1.0 bbPress (r3813) |
| 1788 | 1701 | */ |
| 1789 | 1702 | function bbp_converter_setting_callback_delay_time() { |
| @@ -1796,9 +1709,9 @@ | ||
| 1796 | 1709 | <?php |
| 1797 | 1710 | } |
| 1798 | 1711 | |
| 1799 | 1712 | /** |
| 1800 | - * Edit Halt setting field. | |
| 1713 | + * Edit Halt setting field | |
| 1801 | 1714 | * |
| 1802 | 1715 | * @since 2.6.0 bbPress (r6599) |
| 1803 | 1716 | */ |
| 1804 | 1717 | function bbp_converter_setting_callback_halt() { |
| @@ -1812,9 +1725,9 @@ | ||
| 1812 | 1725 | } |
| 1813 | 1726 | |
| 1814 | 1727 | |
| 1815 | 1728 | /** |
| 1816 | - * Edit Restart setting field. | |
| 1729 | + * Edit Restart setting field | |
| 1817 | 1730 | * |
| 1818 | 1731 | * @since 2.1.0 bbPress (r3813) |
| 1819 | 1732 | */ |
| 1820 | 1733 | function bbp_converter_setting_callback_restart() { |
| @@ -1827,9 +1740,9 @@ | ||
| 1827 | 1740 | <?php |
| 1828 | 1741 | } |
| 1829 | 1742 | |
| 1830 | 1743 | /** |
| 1831 | - * Edit Clean setting field. | |
| 1744 | + * Edit Clean setting field | |
| 1832 | 1745 | * |
| 1833 | 1746 | * @since 2.1.0 bbPress (r3813) |
| 1834 | 1747 | */ |
| 1835 | 1748 | function bbp_converter_setting_callback_clean() { |
| @@ -1842,9 +1755,9 @@ | ||
| 1842 | 1755 | <?php |
| 1843 | 1756 | } |
| 1844 | 1757 | |
| 1845 | 1758 | /** |
| 1846 | - * Edit Convert Users setting field. | |
| 1759 | + * Edit Convert Users setting field | |
| 1847 | 1760 | * |
| 1848 | 1761 | * @since 2.1.0 bbPress (r3813) |
| 1849 | 1762 | */ |
| 1850 | 1763 | function bbp_converter_setting_callback_convert_users() { |
| @@ -1859,9 +1772,9 @@ | ||
| 1859 | 1772 | |
| 1860 | 1773 | /** Converter Page ************************************************************/ |
| 1861 | 1774 | |
| 1862 | 1775 | /** |
| 1863 | - * The main settings page. | |
| 1776 | + * The main settings page | |
| 1864 | 1777 | * |
| 1865 | 1778 | * @since 2.1.0 bbPress (r3186) |
| 1866 | 1779 | */ |
| 1867 | 1780 | function bbp_converter_settings_page() { |
| @@ -1871,9 +1784,8 @@ | ||
| 1871 | 1784 | $max = (int) bbp_admin()->converter->max_steps; |
| 1872 | 1785 | |
| 1873 | 1786 | // Starting or continuing? |
| 1874 | 1787 | $status_text = ! empty( $step ) |
| 1875 | - /* translators: %s: Current step number */ | |
| 1876 | 1788 | ? sprintf( esc_html__( 'Up next: step %s', 'bbpress' ), $step ) |
| 1877 | 1789 | : esc_html__( 'Ready', 'bbpress' ); |
| 1878 | 1790 | |
| 1879 | 1791 | // Starting or continuing? |
| @@ -1882,9 +1794,8 @@ | ||
| 1882 | 1794 | : esc_html__( 'Start', 'bbpress' ); |
| 1883 | 1795 | |
| 1884 | 1796 | // Starting or continuing? |
| 1885 | 1797 | $progress_text = ! empty( $step ) |
| 1886 | - /* translators: 1: Current step number, 2: Total number of steps */ | |
| 1887 | 1798 | ? sprintf( esc_html__( 'Previously stopped at step %1$d of %2$d', 'bbpress' ), $step, $max ) |
| 1888 | 1799 | : esc_html__( 'Ready to go.', 'bbpress' ); ?> |
| 1889 | 1800 | |
| 1890 | 1801 | <div class="wrap"> |
| @@ -1940,9 +1851,9 @@ | ||
| 1940 | 1851 | |
| 1941 | 1852 | /** Helpers *******************************************************************/ |
| 1942 | 1853 | |
| 1943 | 1854 | /** |
| 1944 | - * Contextual help for Forums settings page. | |
| 1855 | + * Contextual help for Forums settings page | |
| 1945 | 1856 | * |
| 1946 | 1857 | * @since 2.0.0 bbPress (r3119) |
| 1947 | 1858 | */ |
| 1948 | 1859 | function bbp_admin_settings_help() { |
| @@ -1954,88 +1865,73 @@ | ||
| 1954 | 1865 | return; |
| 1955 | 1866 | } |
| 1956 | 1867 | |
| 1957 | 1868 | // Overview |
| 1958 | - $current_screen->add_help_tab( | |
| 1959 | - array( | |
| 1960 | - 'id' => 'overview', | |
| 1961 | - 'title' => esc_html__( 'Overview', 'bbpress' ), | |
| 1962 | - 'content' => | |
| 1963 | - '<p>' . esc_html__( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' . | |
| 1964 | - '<p>' . esc_html__( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>' | |
| 1965 | - ) | |
| 1966 | - ); | |
| 1869 | + $current_screen->add_help_tab( array( | |
| 1870 | + 'id' => 'overview', | |
| 1871 | + 'title' => esc_html__( 'Overview', 'bbpress' ), | |
| 1872 | + 'content' => '<p>' . esc_html__( 'This screen provides access to all of the Forums settings.', 'bbpress' ) . '</p>' . | |
| 1873 | + '<p>' . esc_html__( 'Please see the additional help tabs for more information on each individual section.', 'bbpress' ) . '</p>' | |
| 1874 | + ) ); | |
| 1967 | 1875 | |
| 1968 | 1876 | // Main Settings |
| 1969 | - $current_screen->add_help_tab( | |
| 1970 | - array( | |
| 1971 | - 'id' => 'main_settings', | |
| 1972 | - 'title' => esc_html__( 'Main Settings', 'bbpress' ), | |
| 1973 | - 'content' => | |
| 1974 | - '<p>' . esc_html__( 'The "Main Settings" section includes a number of options:', 'bbpress' ) . '</p>' . | |
| 1975 | - '<p>' . | |
| 1976 | - '<ul>' . | |
| 1977 | - '<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>' . | |
| 1978 | - '<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>' . | |
| 1979 | - '<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>' . | |
| 1980 | - '<li>' . esc_html__( 'Subscriptions allow users to subscribe for notifications to topics that interest them. This is enabled by default.', 'bbpress' ) . '</li>' . | |
| 1981 | - '<li>' . esc_html__( 'Topic-Tags allow users to filter topics between forums. This is enabled by default.', 'bbpress' ) . '</li>' . | |
| 1982 | - '<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>' . | |
| 1983 | - '<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>' . | |
| 1984 | - '<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>' . | |
| 1985 | - '</ul>' . | |
| 1986 | - '</p>' . | |
| 1987 | - '<p>' . esc_html__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'bbpress' ) . '</p>' | |
| 1988 | - ) | |
| 1989 | - ); | |
| 1877 | + $current_screen->add_help_tab( array( | |
| 1878 | + 'id' => 'main_settings', | |
| 1879 | + 'title' => esc_html__( 'Main Settings', 'bbpress' ), | |
| 1880 | + 'content' => '<p>' . esc_html__( 'The "Main Settings" section includes a number of options:', 'bbpress' ) . '</p>' . | |
| 1881 | + '<p>' . | |
| 1882 | + '<ul>' . | |
| 1883 | + '<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>' . | |
| 1884 | + '<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>' . | |
| 1885 | + '<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>' . | |
| 1886 | + '<li>' . esc_html__( 'Subscriptions allow users to subscribe for notifications to topics that interest them. This is enabled by default.', 'bbpress' ) . '</li>' . | |
| 1887 | + '<li>' . esc_html__( 'Topic-Tags allow users to filter topics between forums. This is enabled by default.', 'bbpress' ) . '</li>' . | |
| 1888 | + '<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>' . | |
| 1889 | + '<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>' . | |
| 1890 | + '<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>' . | |
| 1891 | + '</ul>' . | |
| 1892 | + '</p>' . | |
| 1893 | + '<p>' . esc_html__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'bbpress' ) . '</p>' | |
| 1894 | + ) ); | |
| 1990 | 1895 | |
| 1991 | 1896 | // Theme Package |
| 1992 | - $current_screen->add_help_tab( | |
| 1993 | - array( | |
| 1994 | - 'id' => 'theme_packages', | |
| 1995 | - 'title' => esc_html__( 'Theme Packages', 'bbpress' ), | |
| 1996 | - 'content' => | |
| 1997 | - '<p>' . esc_html__( 'The "Theme Packages" section allows you to choose which theme package should be used.', 'bbpress' ) . '</p>' . | |
| 1998 | - '<p>' . | |
| 1999 | - '<ul>' . | |
| 2000 | - '<li>' . esc_html__( 'The "bbPress Default" package is installed by default.', 'bbpress' ) . '</li>' . | |
| 2001 | - '<li>' . esc_html__( 'Some themes may choose to ignore this setting entirely.', 'bbpress' ) . '</li>' . | |
| 2002 | - '<li>' . esc_html__( 'Packages can be stacked to allow for intelligent fallbacks.', 'bbpress' ) . '</li>' . | |
| 2003 | - '</ul>' . | |
| 2004 | - '</p>' | |
| 2005 | - ) | |
| 2006 | - ); | |
| 1897 | + $current_screen->add_help_tab( array( | |
| 1898 | + 'id' => 'theme_packages', | |
| 1899 | + 'title' => esc_html__( 'Theme Packages', 'bbpress' ), | |
| 1900 | + 'content' => '<p>' . esc_html__( 'The "Theme Packages" section allows you to choose which theme package should be used.', 'bbpress' ) . '</p>' . | |
| 1901 | + '<p>' . | |
| 1902 | + '<ul>' . | |
| 1903 | + '<li>' . esc_html__( 'The "bbPress Default" package is installed by default.', 'bbpress' ) . '</li>' . | |
| 1904 | + '<li>' . esc_html__( 'Some themes may choose to ignore this setting entirely.', 'bbpress' ) . '</li>' . | |
| 1905 | + '<li>' . esc_html__( 'Packages can be stacked to allow for intelligent fallbacks.', 'bbpress' ) . '</li>' . | |
| 1906 | + '</ul>' . | |
| 1907 | + '</p>' | |
| 1908 | + ) ); | |
| 2007 | 1909 | |
| 2008 | 1910 | // Per Page |
| 2009 | - $current_screen->add_help_tab( | |
| 2010 | - array( | |
| 2011 | - 'id' => 'per_page', | |
| 2012 | - 'title' => esc_html__( 'Per Page', 'bbpress' ), | |
| 2013 | - 'content' => | |
| 2014 | - '<p>' . esc_html__( 'The "Per Page" section allows you to control the number of topics and replies appear on each page.', 'bbpress' ) . '</p>' . | |
| 2015 | - '<ul>' . | |
| 2016 | - '<li>' . 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' ) . '</li>' . | |
| 2017 | - '<li>' . esc_html__( 'These are broken up into two separate groups: one for what appears in your theme, another for RSS feeds.', 'bbpress' ) . '</li>' . | |
| 2018 | - '</ul>' . | |
| 2019 | - '<p>' | |
| 2020 | - ) | |
| 2021 | - ); | |
| 1911 | + $current_screen->add_help_tab( array( | |
| 1912 | + 'id' => 'per_page', | |
| 1913 | + 'title' => esc_html__( 'Per Page', 'bbpress' ), | |
| 1914 | + 'content' => '<p>' . esc_html__( 'The "Per Page" section allows you to control the number of topics and replies appear on each page.', 'bbpress' ) . '</p>' . | |
| 1915 | + '<ul>' . | |
| 1916 | + '<li>' . 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' ) . '</li>' . | |
| 1917 | + '<li>' . esc_html__( 'These are broken up into two separate groups: one for what appears in your theme, another for RSS feeds.', 'bbpress' ) . '</li>' . | |
| 1918 | + '</ul>' . | |
| 1919 | + '<p>' | |
| 1920 | + ) ); | |
| 2022 | 1921 | |
| 2023 | 1922 | // Slugs |
| 2024 | - $current_screen->add_help_tab( | |
| 2025 | - array( | |
| 2026 | - 'id' => 'slugs', | |
| 2027 | - 'title' => esc_html__( 'Slugs', 'bbpress' ), | |
| 2028 | - 'content' => | |
| 2029 | - '<p>' . esc_html__( 'The "Slugs" section allows you to control the permalink structure for your forums.', 'bbpress' ) . '</p>' . | |
| 2030 | - '<ul>' . | |
| 2031 | - '<li>' . 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' ) . '</li>' . | |
| 2032 | - '<li>' . esc_html__( '"Single Slugs" are used as a prefix when viewing an individual forum, topic, reply, user, or view.', 'bbpress' ) . '</li>' . | |
| 2033 | - '<li>' . esc_html__( 'In the event of a slug collision with WordPress or BuddyPress, a warning will appear next to the problem slug(s).', 'bbpress' ) . '</li>' . | |
| 2034 | - '</ul>' . | |
| 2035 | - '<p>' | |
| 2036 | - ) | |
| 2037 | - ); | |
| 1923 | + $current_screen->add_help_tab( array( | |
| 1924 | + 'id' => 'slugs', | |
| 1925 | + 'title' => esc_html__( 'Slugs', 'bbpress' ), | |
| 1926 | + 'content' => '<p>' . esc_html__( 'The "Slugs" section allows you to control the permalink structure for your forums.', 'bbpress' ) . '</p>' . | |
| 1927 | + '<ul>' . | |
| 1928 | + '<li>' . 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' ) . '</li>' . | |
| 1929 | + '<li>' . esc_html__( '"Single Slugs" are used as a prefix when viewing an individual forum, topic, reply, user, or view.', 'bbpress' ) . '</li>' . | |
| 1930 | + '<li>' . esc_html__( 'In the event of a slug collision with WordPress or BuddyPress, a warning will appear next to the problem slug(s).', 'bbpress' ) . '</li>' . | |
| 1931 | + '</ul>' . | |
| 1932 | + '<p>' | |
| 1933 | + ) ); | |
| 2038 | 1934 | |
| 2039 | 1935 | // Help Sidebar |
| 2040 | 1936 | $current_screen->set_help_sidebar( |
| 2041 | 1937 | '<p><strong>' . esc_html__( 'For more information:', 'bbpress' ) . '</strong></p>' . |
| @@ -2055,9 +1951,9 @@ | ||
| 2055 | 1951 | disabled( isset( bbpress()->options[ $option_key ] ) ); |
| 2056 | 1952 | } |
| 2057 | 1953 | |
| 2058 | 1954 | /** |
| 2059 | - * Output settings API option. | |
| 1955 | + * Output settings API option | |
| 2060 | 1956 | * |
| 2061 | 1957 | * @since 2.0.0 bbPress (r3203) |
| 2062 | 1958 | * |
| 2063 | 1959 | * @param string $option |
| @@ -2066,43 +1962,42 @@ | ||
| 2066 | 1962 | */ |
| 2067 | 1963 | function bbp_form_option( $option, $default = '', $slug = false ) { |
| 2068 | 1964 | echo bbp_get_form_option( $option, $default, $slug ); |
| 2069 | 1965 | } |
| 1966 | + /** | |
| 1967 | + * Return settings API option | |
| 1968 | + * | |
| 1969 | + * @since 2.0.0 bbPress (r3203) | |
| 1970 | + * | |
| 1971 | + * @param string $option | |
| 1972 | + * @param string $default | |
| 1973 | + * @param bool $is_slug | |
| 1974 | + * | |
| 1975 | + * @return mixed | |
| 1976 | + */ | |
| 1977 | + function bbp_get_form_option( $option, $default = '', $is_slug = false ) { | |
| 2070 | 1978 | |
| 2071 | -/** | |
| 2072 | - * Return settings API option. | |
| 2073 | - * | |
| 2074 | - * @since 2.0.0 bbPress (r3203) | |
| 2075 | - * | |
| 2076 | - * @param string $option | |
| 2077 | - * @param string $default | |
| 2078 | - * @param bool $is_slug | |
| 2079 | - * | |
| 2080 | - * @return mixed | |
| 2081 | - */ | |
| 2082 | -function bbp_get_form_option( $option, $default = '', $is_slug = false ) { | |
| 1979 | + // Get the option and sanitize it | |
| 1980 | + $value = get_option( $option, $default ); | |
| 2083 | 1981 | |
| 2084 | - // Get the option and sanitize it | |
| 2085 | - $value = get_option( $option, $default ); | |
| 1982 | + // Slug? | |
| 1983 | + if ( true === $is_slug ) { | |
| 1984 | + $value = esc_attr( apply_filters( 'editable_slug', $value ) ); | |
| 2086 | 1985 | |
| 2087 | - // Slug? | |
| 2088 | - if ( true === $is_slug ) { | |
| 2089 | - $value = esc_attr( apply_filters( 'editable_slug', $value ) ); | |
| 1986 | + // Not a slug | |
| 1987 | + } else { | |
| 1988 | + $value = esc_attr( $value ); | |
| 1989 | + } | |
| 2090 | 1990 | |
| 2091 | - // Not a slug | |
| 2092 | - } else { | |
| 2093 | - $value = esc_attr( $value ); | |
| 2094 | - } | |
| 1991 | + // Fallback to default | |
| 1992 | + if ( empty( $value ) ) { | |
| 1993 | + $value = $default; | |
| 1994 | + } | |
| 2095 | 1995 | |
| 2096 | - // Fallback to default, unless numeric (allow zero) | |
| 2097 | - if ( empty( $value ) && ! is_numeric( $value ) ) { | |
| 2098 | - $value = $default; | |
| 1996 | + // Filter & return | |
| 1997 | + return apply_filters( 'bbp_get_form_option', $value, $option, $default, $is_slug ); | |
| 2099 | 1998 | } |
| 2100 | 1999 | |
| 2101 | - // Filter & return | |
| 2102 | - return apply_filters( 'bbp_get_form_option', $value, $option, $default, $is_slug ); | |
| 2103 | -} | |
| 2104 | - | |
| 2105 | 2000 | /** |
| 2106 | 2001 | * Used to check if a bbPress slug conflicts with an existing known slug. |
| 2107 | 2002 | * |
| 2108 | 2003 | * @since 2.0.0 bbPress (r3306) |
| @@ -2120,123 +2015,56 @@ | ||
| 2120 | 2015 | |
| 2121 | 2016 | if ( empty( $the_core_slugs ) ) { |
| 2122 | 2017 | |
| 2123 | 2018 | // Slugs to check |
| 2124 | - $core_slugs = apply_filters( | |
| 2125 | - 'bbp_slug_conflict_check', | |
| 2126 | - array( | |
| 2019 | + $core_slugs = apply_filters( 'bbp_slug_conflict_check', array( | |
| 2127 | 2020 | |
| 2128 | - /** WordPress Core ********************************************/ | |
| 2021 | + /** WordPress Core ****************************************************/ | |
| 2129 | 2022 | |
| 2130 | - // Core Post Types | |
| 2131 | - 'post_base' => array( | |
| 2132 | - 'name' => esc_html__( 'Posts', 'bbpress' ), | |
| 2133 | - 'default' => 'post', | |
| 2134 | - 'context' => 'WordPress' | |
| 2135 | - ), | |
| 2136 | - 'page_base' => array( | |
| 2137 | - 'name' => esc_html__( 'Pages', 'bbpress' ), | |
| 2138 | - 'default' => 'page', | |
| 2139 | - 'context' => 'WordPress' | |
| 2140 | - ), | |
| 2141 | - 'revision_base' => array( | |
| 2142 | - 'name' => esc_html__( 'Revisions', 'bbpress' ), | |
| 2143 | - 'default' => 'revision', | |
| 2144 | - 'context' => 'WordPress' | |
| 2145 | - ), | |
| 2146 | - 'attachment_base' => array( | |
| 2147 | - 'name' => esc_html__( 'Attachments', 'bbpress' ), | |
| 2148 | - 'default' => 'attachment', | |
| 2149 | - 'context' => 'WordPress' | |
| 2150 | - ), | |
| 2151 | - 'nav_menu_base' => array( | |
| 2152 | - 'name' => esc_html__( 'Menus', 'bbpress' ), | |
| 2153 | - 'default' => 'nav_menu_item', | |
| 2154 | - 'context' => 'WordPress' | |
| 2155 | - ), | |
| 2023 | + // Core Post Types | |
| 2024 | + 'post_base' => array( 'name' => esc_html__( 'Posts', 'bbpress' ), 'default' => 'post', 'context' => 'WordPress' ), | |
| 2025 | + 'page_base' => array( 'name' => esc_html__( 'Pages', 'bbpress' ), 'default' => 'page', 'context' => 'WordPress' ), | |
| 2026 | + 'revision_base' => array( 'name' => esc_html__( 'Revisions', 'bbpress' ), 'default' => 'revision', 'context' => 'WordPress' ), | |
| 2027 | + 'attachment_base' => array( 'name' => esc_html__( 'Attachments', 'bbpress' ), 'default' => 'attachment', 'context' => 'WordPress' ), | |
| 2028 | + 'nav_menu_base' => array( 'name' => esc_html__( 'Menus', 'bbpress' ), 'default' => 'nav_menu_item', 'context' => 'WordPress' ), | |
| 2156 | 2029 | |
| 2157 | - // Post Tags | |
| 2158 | - 'tag_base' => array( | |
| 2159 | - 'name' => esc_html__( 'Tag base', 'bbpress' ), | |
| 2160 | - 'default' => 'tag', | |
| 2161 | - 'context' => 'WordPress' | |
| 2162 | - ), | |
| 2030 | + // Post Tags | |
| 2031 | + 'tag_base' => array( 'name' => esc_html__( 'Tag base', 'bbpress' ), 'default' => 'tag', 'context' => 'WordPress' ), | |
| 2163 | 2032 | |
| 2164 | - // Post Categories | |
| 2165 | - 'category_base' => array( | |
| 2166 | - 'name' => esc_html__( 'Category base', 'bbpress' ), | |
| 2167 | - 'default' => 'category', | |
| 2168 | - 'context' => 'WordPress' | |
| 2169 | - ), | |
| 2033 | + // Post Categories | |
| 2034 | + 'category_base' => array( 'name' => esc_html__( 'Category base', 'bbpress' ), 'default' => 'category', 'context' => 'WordPress' ), | |
| 2170 | 2035 | |
| 2171 | - /** bbPress Core **********************************************/ | |
| 2036 | + /** bbPress Core ******************************************************/ | |
| 2172 | 2037 | |
| 2173 | - // Forum archive slug | |
| 2174 | - '_bbp_root_slug' => array( | |
| 2175 | - 'name' => esc_html__( 'Forums base', 'bbpress' ), | |
| 2176 | - 'default' => 'forums', | |
| 2177 | - 'context' => 'bbPress' | |
| 2178 | - ), | |
| 2038 | + // Forum archive slug | |
| 2039 | + '_bbp_root_slug' => array( 'name' => esc_html__( 'Forums base', 'bbpress' ), 'default' => 'forums', 'context' => 'bbPress' ), | |
| 2179 | 2040 | |
| 2180 | - // Topic archive slug | |
| 2181 | - '_bbp_topic_archive_slug' => array( | |
| 2182 | - 'name' => esc_html__( 'Topics base', 'bbpress' ), | |
| 2183 | - 'default' => 'topics', | |
| 2184 | - 'context' => 'bbPress' | |
| 2185 | - ), | |
| 2041 | + // Topic archive slug | |
| 2042 | + '_bbp_topic_archive_slug' => array( 'name' => esc_html__( 'Topics base', 'bbpress' ), 'default' => 'topics', 'context' => 'bbPress' ), | |
| 2186 | 2043 | |
| 2187 | - // Forum slug | |
| 2188 | - '_bbp_forum_slug' => array( | |
| 2189 | - 'name' => esc_html__( 'Forum slug', 'bbpress' ), | |
| 2190 | - 'default' => 'forum', | |
| 2191 | - 'context' => 'bbPress' | |
| 2192 | - ), | |
| 2044 | + // Forum slug | |
| 2045 | + '_bbp_forum_slug' => array( 'name' => esc_html__( 'Forum slug', 'bbpress' ), 'default' => 'forum', 'context' => 'bbPress' ), | |
| 2193 | 2046 | |
| 2194 | - // Topic slug | |
| 2195 | - '_bbp_topic_slug' => array( | |
| 2196 | - 'name' => esc_html__( 'Topic slug', 'bbpress' ), | |
| 2197 | - 'default' => 'topic', | |
| 2198 | - 'context' => 'bbPress' | |
| 2199 | - ), | |
| 2047 | + // Topic slug | |
| 2048 | + '_bbp_topic_slug' => array( 'name' => esc_html__( 'Topic slug', 'bbpress' ), 'default' => 'topic', 'context' => 'bbPress' ), | |
| 2200 | 2049 | |
| 2201 | - // Reply slug | |
| 2202 | - '_bbp_reply_slug' => array( | |
| 2203 | - 'name' => esc_html__( 'Reply slug', 'bbpress' ), | |
| 2204 | - 'default' => 'reply', | |
| 2205 | - 'context' => 'bbPress' | |
| 2206 | - ), | |
| 2050 | + // Reply slug | |
| 2051 | + '_bbp_reply_slug' => array( 'name' => esc_html__( 'Reply slug', 'bbpress' ), 'default' => 'reply', 'context' => 'bbPress' ), | |
| 2207 | 2052 | |
| 2208 | - // Edit slug | |
| 2209 | - '_bbp_edit_slug' => array( | |
| 2210 | - 'name' => esc_html__( 'Edit slug', 'bbpress' ), | |
| 2211 | - 'default' => 'edit', | |
| 2212 | - 'context' => 'bbPress' | |
| 2213 | - ), | |
| 2053 | + // Edit slug | |
| 2054 | + '_bbp_edit_slug' => array( 'name' => esc_html__( 'Edit slug', 'bbpress' ), 'default' => 'edit', 'context' => 'bbPress' ), | |
| 2214 | 2055 | |
| 2215 | - // User profile slug | |
| 2216 | - '_bbp_user_slug' => array( | |
| 2217 | - 'name' => esc_html__( 'User base', 'bbpress' ), | |
| 2218 | - 'default' => 'users', | |
| 2219 | - 'context' => 'bbPress' | |
| 2220 | - ), | |
| 2056 | + // User profile slug | |
| 2057 | + '_bbp_user_slug' => array( 'name' => esc_html__( 'User base', 'bbpress' ), 'default' => 'users', 'context' => 'bbPress' ), | |
| 2221 | 2058 | |
| 2222 | - // View slug | |
| 2223 | - '_bbp_view_slug' => array( | |
| 2224 | - 'name' => esc_html__( 'View base', 'bbpress' ), | |
| 2225 | - 'default' => 'view', | |
| 2226 | - 'context' => 'bbPress' | |
| 2227 | - ), | |
| 2059 | + // View slug | |
| 2060 | + '_bbp_view_slug' => array( 'name' => esc_html__( 'View base', 'bbpress' ), 'default' => 'view', 'context' => 'bbPress' ), | |
| 2228 | 2061 | |
| 2229 | - // Topic tag slug | |
| 2230 | - '_bbp_topic_tag_slug' => array( | |
| 2231 | - 'name' => esc_html__( 'Topic tag slug', 'bbpress' ), | |
| 2232 | - 'default' => 'topic-tag', | |
| 2233 | - 'context' => 'bbPress' | |
| 2234 | - ), | |
| 2235 | - ) | |
| 2236 | - ); | |
| 2062 | + // Topic tag slug | |
| 2063 | + '_bbp_topic_tag_slug' => array( 'name' => esc_html__( 'Topic tag slug', 'bbpress' ), 'default' => 'topic-tag', 'context' => 'bbPress' ), | |
| 2064 | + ) ); | |
| 2237 | 2065 | |
| 2238 | - /** BuddyPress Core ***************************************************/ | |
| 2066 | + /** BuddyPress Core *******************************************************/ | |
| 2239 | 2067 | |
| 2240 | 2068 | if ( defined( 'BP_VERSION' ) ) { |
| 2241 | 2069 | $bp = buddypress(); |
| 2242 | 2070 | |
| @@ -2243,9 +2071,8 @@ | ||
| 2243 | 2071 | // Loop through root slugs and check for conflict |
| 2244 | 2072 | if ( ! empty( $bp->pages ) ) { |
| 2245 | 2073 | foreach ( $bp->pages as $page => $page_data ) { |
| 2246 | 2074 | $page_base = $page . '_base'; |
| 2247 | - /* translators: %s: BuddyPress page title */ | |
| 2248 | 2075 | $page_title = sprintf( esc_html__( '%s page', 'bbpress' ), $page_data->title ); |
| 2249 | 2076 | $core_slugs[ $page_base ] = array( |
| 2250 | 2077 | 'name' => $page_title, |
| 2251 | 2078 | 'default' => $page_data->slug, |
| @@ -2265,20 +2092,11 @@ | ||
| 2265 | 2092 | // Get the slug |
| 2266 | 2093 | $slug_check = bbp_get_form_option( $key, $value['default'], true ); |
| 2267 | 2094 | |
| 2268 | 2095 | // Compare |
| 2269 | - if ( ( $slug !== $key ) && ( $slug_check === $this_slug ) ) : | |
| 2270 | - ?> | |
| 2271 | - <span class="attention"> | |
| 2272 | - <?php | |
| 2273 | - printf( | |
| 2274 | - /* translators: 1: Context (e.g., "BuddyPress"), 2: Name of the conflicting item */ | |
| 2275 | - esc_html__( 'Possible %1$s conflict: %2$s', 'bbpress' ), | |
| 2276 | - $value['context'], | |
| 2277 | - '<strong>' . $value['name'] . '</strong>' | |
| 2278 | - ); | |
| 2279 | - ?> | |
| 2280 | - </span> | |
| 2281 | - <?php | |
| 2282 | - endif; | |
| 2096 | + if ( ( $slug !== $key ) && ( $slug_check === $this_slug ) ) : ?> | |
| 2097 | + | |
| 2098 | + <span class="attention"><?php printf( esc_html__( 'Possible %1$s conflict: %2$s', 'bbpress' ), $value['context'], '<strong>' . $value['name'] . '</strong>' ); ?></span> | |
| 2099 | + | |
| 2100 | + <?php endif; | |
| 2283 | 2101 | } |
| 2284 | 2102 | } |