/bp-core/deprecated/1.7.php

  1. <?php 
  2. /** 
  3. * Deprecated Functions 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage Core 
  7. * @deprecated Since 1.7.0 
  8. */ 
  9.  
  10. // Exit if accessed directly 
  11. defined( 'ABSPATH' ) || exit; 
  12.  
  13. /** 
  14. * Output the BuddyPress maintenance mode 
  15. * 
  16. * @since 1.6.0 
  17. * @deprecated 1.7.0 
  18. */ 
  19. function bp_maintenance_mode() { 
  20. echo bp_get_maintenance_mode(); 
  21. /** 
  22. * Return the BuddyPress maintenance mode 
  23. * 
  24. * @since 1.6.0 
  25. * @deprecated 1.7.0 
  26. * @return string The BuddyPress maintenance mode 
  27. */ 
  28. function bp_get_maintenance_mode() { 
  29. return buddypress()->maintenance_mode; 
  30.  
  31. /** 
  32. * @deprecated 1.7.0 
  33. */ 
  34. function xprofile_get_profile() { 
  35. _deprecated_function( __FUNCTION__, '1.7' ); 
  36. bp_locate_template( array( 'profile/profile-loop.php' ), true ); 
  37.  
  38. /** 
  39. * @deprecated 1.7.0 
  40. */ 
  41. function bp_get_profile_header() { 
  42. _deprecated_function( __FUNCTION__, '1.7' ); 
  43. bp_locate_template( array( 'profile/profile-header.php' ), true ); 
  44.  
  45. /** 
  46. * @deprecated 1.7.0 
  47. * @param string $component_name 
  48. * @return boolean 
  49. */ 
  50. function bp_exists( $component_name ) { 
  51. _deprecated_function( __FUNCTION__, '1.7' ); 
  52. if ( function_exists( $component_name . '_install' ) ) 
  53. return true; 
  54.  
  55. return false; 
  56.  
  57. /** 
  58. * @deprecated 1.7.0 
  59. */ 
  60. function bp_get_plugin_sidebar() { 
  61. _deprecated_function( __FUNCTION__, '1.7' ); 
  62. bp_locate_template( array( 'plugin-sidebar.php' ), true ); 
  63.  
  64. /** 
  65. * On multiblog installations you must first allow themes to be activated and 
  66. * show up on the theme selection screen. This function will let the BuddyPress 
  67. * bundled themes show up on the root blog selection screen and bypass this 
  68. * step. It also means that the themes won't show for selection on other blogs. 
  69. * 
  70. * @deprecated 1.7.0 
  71. * @package BuddyPress Core 
  72. */ 
  73. function bp_core_allow_default_theme( $themes ) { 
  74. _deprecated_function( __FUNCTION__, '1.7' ); 
  75.  
  76. if ( !bp_current_user_can( 'bp_moderate' ) ) 
  77. return $themes; 
  78.  
  79. if ( bp_get_root_blog_id() != get_current_blog_id() ) 
  80. return $themes; 
  81.  
  82. if ( isset( $themes['bp-default'] ) ) 
  83. return $themes; 
  84.  
  85. $themes['bp-default'] = true; 
  86.  
  87. return $themes; 
  88.  
  89. /** 
  90. * No longer used by BuddyPress core 
  91. * 
  92. * @deprecated 1.7.0 
  93. * @param string $page 
  94. * @return boolean True if is BuddyPress page 
  95. */ 
  96. function bp_is_page( $page = '' ) { 
  97. _deprecated_function( __FUNCTION__, '1.7' ); 
  98.  
  99. if ( !bp_is_user() && bp_is_current_component( $page ) ) 
  100. return true; 
  101.  
  102. if ( 'home' == $page ) 
  103. return is_front_page(); 
  104.  
  105. return false; 
  106.  
  107. /** Admin *********************************************************************/ 
  108.  
  109. /** 
  110. * This function was originally used to update pre-1.1 schemas, but that was 
  111. * before we had a legitimate update process. 
  112. * 
  113. * @deprecated 1.7.0 
  114. * @global WPDB $wpdb 
  115. */ 
  116. function bp_update_db_stuff() { 
  117. global $wpdb; 
  118.  
  119. $bp = buddypress(); 
  120. $bp_prefix = bp_core_get_table_prefix(); 
  121.  
  122. // Rename the old user activity cached table if needed. 
  123. if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) { 
  124. $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); 
  125.  
  126. // Rename fields from pre BP 1.2 
  127. if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) { 
  128. if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) { 
  129. $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" ); 
  130.  
  131. if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) { 
  132. $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" ); 
  133.  
  134. // On first installation - record all existing blogs in the system. 
  135. if ( !(int) $bp->site_options['bp-blogs-first-install'] ) { 
  136. bp_blogs_record_existing_blogs(); 
  137. bp_update_option( 'bp-blogs-first-install', 1 ); 
  138.  
  139. if ( is_multisite() ) { 
  140. bp_core_add_illegal_names(); 
  141.  
  142. // Update and remove the message threads table if it exists 
  143. if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) { 
  144. if ( BP_Messages_Thread::update_tables() ) { 
  145. $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" ); 
.