Changeset 1983 for trunk/bb-includes/class.bp-options.php
- Timestamp:
- 03/11/2009 01:12:09 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/bb-includes/class.bp-options.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/class.bp-options.php
r1954 r1983 4 4 * in the bbPress database 5 5 * 6 * @see BP_Options_Interface 6 7 * @package bbPress 7 8 */ 8 9 class BP_Options 9 10 { 10 function prefix() { 11 function prefix() 12 { 11 13 return 'bp_bbpress_'; 12 14 } 13 15 14 function get($option) { 15 switch ($option) { 16 function get( $option ) 17 { 18 switch ( $option ) { 16 19 case 'application_uri': 17 return bb_get_uri( null, null, BB_URI_CONTEXT_NONE);20 return bb_get_uri( null, null, BB_URI_CONTEXT_NONE ); 18 21 break; 19 22 case 'cron_uri': 20 return bb_get_uri( 'bb-cron.php', array('check' => BP_Options::get('cron_check')), BB_URI_CONTEXT_WP_HTTP_REQUEST);23 return bb_get_uri( 'bb-cron.php', array( 'check' => BP_Options::get( 'cron_check' ) ), BB_URI_CONTEXT_WP_HTTP_REQUEST ); 21 24 break; 22 25 case 'cron_check': 23 return bb_hash( '187425');26 return bb_hash( '187425' ); 24 27 break; 25 28 case 'charset': 26 return bb_get_option( $option);29 return bb_get_option( $option ); 27 30 break; 28 31 case 'wp_http_version': 29 return 'bbPress/' . bb_get_option( 'version');32 return 'bbPress/' . bb_get_option( 'version' ); 30 33 break; 31 34 case 'hash_function_name': … … 33 36 break; 34 37 default: 35 return bb_get_option( BP_Options::prefix() . $option);38 return bb_get_option( BP_Options::prefix() . $option ); 36 39 break; 37 40 } 38 41 } 39 42 40 function add($option, $value) { 41 return BP_Options::update($option, $value); 43 function add( $option, $value ) 44 { 45 return BP_Options::update( $option, $value ); 42 46 } 43 47 44 function update($option, $value) { 45 return bb_update_option(BP_Options::prefix() . $option, $value); 48 function update( $option, $value ) 49 { 50 return bb_update_option( BP_Options::prefix() . $option, $value ); 46 51 } 47 52 48 function delete($option) { 49 return bb_delete_option(BP_Options::prefix() . $option); 53 function delete( $option ) 54 { 55 return bb_delete_option( BP_Options::prefix() . $option ); 50 56 } 51 57 } // END class BP_Options 58 59 /** 60 * Allows storage of transients for BackPress 61 * 62 * @see BP_Transients_Interface 63 * @package bbPress 64 */ 65 class BP_Transients 66 { 67 function prefix() 68 { 69 return 'bp_bbpress_'; 70 } 71 72 function get( $transient ) 73 { 74 return bb_get_transient( BP_Options::prefix() . $transient ); 75 } 76 77 function set( $transient, $value, $expiration = 0 ) 78 { 79 return bb_set_transient( BP_Options::prefix() . $transient, $value, $expiration ); 80 } 81 82 function delete( $transient ) 83 { 84 return bb_delete_transient( BP_Options::prefix() . $transient ); 85 } 86 } // END class BP_Transients
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)