Changeset 13587
- Timestamp:
- 09/29/2023 02:07:48 AM (18 months ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-settings.php
r13533 r13587 453 453 echo bp_get_form_option( $option, $default, $slug ); 454 454 } 455 456 /** 457 * Return settings API option 458 * 459 * @since 1.6.0 460 * 461 * 462 * @param string $option Form option to return. 463 * @param string $default Form option default. 464 * @param bool $slug Form option slug. 465 * @return string 466 */ 467 function bp_get_form_option( $option, $default = '', $slug = false ) { 468 469 // Get the option and sanitize it. 470 $value = bp_get_option( $option, $default ); 471 472 // Slug? 473 if ( true === $slug ) { 474 475 /** 476 * Filters the slug value in the form field. 477 * 478 * @since 1.6.0 479 * 480 * @param string $value Value being returned for the requested option. 481 */ 482 $value = esc_attr( apply_filters( 'editable_slug', $value ) ); 483 } else { // Not a slug. 484 $value = esc_attr( $value ); 485 } 486 487 // Fallback to default. 488 if ( empty( $value ) ) { 489 $value = $default; 490 } 491 455 492 /** 456 * Return settings API option493 * Filters the settings API option. 457 494 * 458 495 * @since 1.6.0 459 496 * 460 * 461 * @param string $option Form option to return. 462 * @param string $default Form option default. 463 * @param bool $slug Form option slug. 464 * @return string 497 * @param string $value Value being returned for the requested option. 498 * @param string $option Option whose value is being requested. 465 499 */ 466 function bp_get_form_option( $option, $default = '', $slug = false ) { 467 468 // Get the option and sanitize it. 469 $value = bp_get_option( $option, $default ); 470 471 // Slug? 472 if ( true === $slug ) { 473 474 /** 475 * Filters the slug value in the form field. 476 * 477 * @since 1.6.0 478 * 479 * @param string $value Value being returned for the requested option. 480 */ 481 $value = esc_attr( apply_filters( 'editable_slug', $value ) ); 482 } else { // Not a slug. 483 $value = esc_attr( $value ); 484 } 485 486 // Fallback to default. 487 if ( empty( $value ) ) 488 $value = $default; 489 490 /** 491 * Filters the settings API option. 492 * 493 * @since 1.6.0 494 * 495 * @param string $value Value being returned for the requested option. 496 * @param string $option Option whose value is being requested. 497 */ 498 return apply_filters( 'bp_get_form_option', $value, $option ); 499 } 500 return apply_filters( 'bp_get_form_option', $value, $option ); 501 } -
trunk/src/bp-settings/bp-settings-template.php
r13503 r13587 19 19 echo bp_get_settings_slug(); 20 20 } 21 22 /** 23 * Return the settings component slug. 24 * 25 * @since 1.5.0 26 * 27 * @return string 28 */ 29 function bp_get_settings_slug() { 30 21 31 /** 22 * Return the settings component slug.32 * Filters the Settings component slug. 23 33 * 24 34 * @since 1.5.0 25 35 * 26 * @ return string36 * @param string $slug Settings component slug. 27 37 */ 28 function bp_get_settings_slug() { 29 30 /** 31 * Filters the Settings component slug. 32 * 33 * @since 1.5.0 34 * 35 * @param string $slug Settings component slug. 36 */ 37 return apply_filters( 'bp_get_settings_slug', buddypress()->settings->slug ); 38 } 38 return apply_filters( 'bp_get_settings_slug', buddypress()->settings->slug ); 39 } 39 40 40 41 /** … … 46 47 echo bp_get_settings_root_slug(); 47 48 } 49 50 /** 51 * Return the settings component root slug. 52 * 53 * @since 1.5.0 54 * 55 * @return string 56 */ 57 function bp_get_settings_root_slug() { 58 48 59 /** 49 * Return the settings component root slug.60 * Filters the Settings component root slug. 50 61 * 51 62 * @since 1.5.0 52 63 * 53 * @ return string64 * @param string $root_slug Settings component root slug. 54 65 */ 55 function bp_get_settings_root_slug() { 56 57 /** 58 * Filters the Settings component root slug. 59 * 60 * @since 1.5.0 61 * 62 * @param string $root_slug Settings component root slug. 63 */ 64 return apply_filters( 'bp_get_settings_root_slug', buddypress()->settings->root_slug ); 65 } 66 return apply_filters( 'bp_get_settings_root_slug', buddypress()->settings->root_slug ); 67 } 66 68 67 69 /**
Note: See TracChangeset
for help on using the changeset viewer.