Changeset 4281 for trunk/includes/admin/admin.php
- Timestamp:
- 10/30/2012 11:43:17 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/admin/admin.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/admin.php
r4261 r4281 304 304 305 305 // Bail if no sections available 306 if ( ! $sections = bbp_admin_get_settings_sections() ) 306 $sections = bbp_admin_get_settings_sections(); 307 if ( empty( $sections ) ) 307 308 return false; 308 309 309 310 // Loop through sections 310 foreach ( $sections as $section_id => $section ) {311 foreach ( (array) $sections as $section_id => $section ) { 311 312 312 313 // Only proceed if current user can see this section … … 315 316 316 317 // Only add section and fields if section has fields 317 if ( $fields = bbp_admin_get_settings_fields_for_section( $section_id ) ) { 318 319 // Add the section 320 add_settings_section( $section_id, $section['title'], $section['callback'], $section['page'] ); 321 322 // Loop through fields for this section 323 foreach ( $fields as $field_id => $field ) { 324 325 // Add the field 326 add_settings_field( $field_id, $field['title'], $field['callback'], $section['page'], $section_id, $field['args'] ); 327 328 // Register the setting 329 register_setting( $section['page'], $field_id, $field['sanitize_callback'] ); 330 } 318 $fields = bbp_admin_get_settings_fields_for_section( $section_id ); 319 if ( empty( $fields ) ) 320 continue; 321 322 // Add the section 323 add_settings_section( $section_id, $section['title'], $section['callback'], $section['page'] ); 324 325 // Loop through fields for this section 326 foreach ( (array) $fields as $field_id => $field ) { 327 328 // Add the field 329 add_settings_field( $field_id, $field['title'], $field['callback'], $section['page'], $section_id, $field['args'] ); 330 331 // Register the setting 332 register_setting( $section['page'], $field_id, $field['sanitize_callback'] ); 331 333 } 332 334 } … … 458 460 // Add a few links to the existing links array 459 461 return array_merge( $links, array( 460 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . __( 'Settings', 'bbpress' ) . '</a>',461 'about' => '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . __( 'About', 'bbpress' ) . '</a>'462 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>', 463 'about' => '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>' 462 464 ) ); 463 465 } … … 1212 1214 */ 1213 1215 public function register_admin_style () { 1214 wp_admin_css_color( 'bbpress', __( 'Green', 'bbpress' ), $this->styles_url . 'admin.css', array( '#222222', '#006600', '#deece1', '#6eb469' ) );1216 wp_admin_css_color( 'bbpress', esc_html_x( 'Green', 'admin color scheme', 'bbpress' ), $this->styles_url . 'admin.css', array( '#222222', '#006600', '#deece1', '#6eb469' ) ); 1215 1217 } 1216 1218
Note: See TracChangeset
for help on using the changeset viewer.