[ Index ] |
PHP Cross Reference of BuddyPress |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * BP_Options allows storage of options for BackPress 4 * in the bbPress database 5 * 6 * @see BP_Options_Interface 7 * @package bbPress 8 */ 9 class BP_Options 10 { 11 function prefix() 12 { 13 return 'bp_bbpress_'; 14 } 15 16 function get( $option ) 17 { 18 switch ( $option ) { 19 case 'application_id': 20 return bb_get_option( 'site_id' ); 21 break; 22 case 'application_uri': 23 return bb_get_uri( null, null, BB_URI_CONTEXT_NONE ); 24 break; 25 case 'cron_uri': 26 return bb_get_uri( 'bb-cron.php', array( 'check' => BP_Options::get( 'cron_check' ) ), BB_URI_CONTEXT_WP_HTTP_REQUEST ); 27 break; 28 case 'wp_http_version': 29 return 'bbPress/' . bb_get_option( 'version' ); 30 break; 31 case 'hash_function_name': 32 return 'bb_hash'; 33 break; 34 case 'language_locale': 35 return bb_get_locale(); 36 break; 37 case 'language_directory': 38 return BB_LANG_DIR; 39 break; 40 case 'charset': 41 case 'gmt_offset': 42 case 'timezone_string': 43 return bb_get_option( $option ); 44 break; 45 default: 46 return bb_get_option( BP_Options::prefix() . $option ); 47 break; 48 } 49 } 50 51 function add( $option, $value ) 52 { 53 return BP_Options::update( $option, $value ); 54 } 55 56 function update( $option, $value ) 57 { 58 return bb_update_option( BP_Options::prefix() . $option, $value ); 59 } 60 61 function delete( $option ) 62 { 63 return bb_delete_option( BP_Options::prefix() . $option ); 64 } 65 } // END class BP_Options 66 67 /** 68 * Allows storage of transients for BackPress 69 * 70 * @see BP_Transients_Interface 71 * @package bbPress 72 */ 73 class BP_Transients 74 { 75 function prefix() 76 { 77 return 'bp_bbpress_'; 78 } 79 80 function get( $transient ) 81 { 82 return bb_get_transient( BP_Transients::prefix() . $transient ); 83 } 84 85 function set( $transient, $value, $expiration = 0 ) 86 { 87 return bb_set_transient( BP_Transients::prefix() . $transient, $value, $expiration ); 88 } 89 90 function delete( $transient ) 91 { 92 return bb_delete_transient( BP_Transients::prefix() . $transient ); 93 } 94 } // END class BP_Transients
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Dec 7 01:01:35 2017 | Cross-referenced by PHPXref 0.7.1 |