Changeset 4709 for trunk/bp-core/bp-core-functions.php
- Timestamp:
- 07/18/2011 10:43:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r4678 r4709 19 19 function bp_get_option( $option_name, $default = '' ) { 20 20 $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default ); 21 21 22 22 return apply_filters( 'bp_get_option', $value ); 23 23 } … … 79 79 function bp_core_get_page_meta() { 80 80 $page_ids = bp_get_option( 'bp-pages' ); 81 81 82 82 // Upgrading from an earlier version of BP pre-1.3 83 if ( !isset( $page_ids['members'] ) && $ms_page_ids = get_site_option( 'bp-pages' ) ) { 83 if ( !isset( $page_ids['members'] ) && $ms_page_ids = get_site_option( 'bp-pages' ) ) { 84 84 $page_blog_id = bp_is_multiblog_mode() ? get_current_blog_id() : bp_get_root_blog_id(); 85 85 … … 90 90 } 91 91 } 92 92 93 93 return apply_filters( 'bp_core_get_page_meta', $page_ids ); 94 94 } … … 698 698 function bp_core_record_activity() { 699 699 global $bp; 700 700 701 701 if ( !is_user_logged_in() ) 702 702 return false; 703 703 704 704 $user_id = $bp->loggedin_user->id; 705 705 706 706 if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) ) 707 707 return false; … … 912 912 } 913 913 add_action( 'bp_init', 'bp_core_add_ajax_hook' ); 914 915 /** 916 * Initializes {@link BP_Embed} after everything is loaded. 917 * 918 * @global object $bp BuddyPress global settings 919 * @package BuddyPress Core 920 * @since 1.3 921 */ 922 function bp_embed_init() { 923 global $bp; 924 925 if ( empty( $bp->embed ) ) 926 $bp->embed = new BP_Embed(); 927 } 928 add_action( 'bp_init', 'bp_embed_init' ); 914 929 915 930 /** … … 1075 1090 */ 1076 1091 function bp_is_root_blog( $blog_id = 0 ) { 1077 1078 1092 // Assume false 1079 1093 $is_root_blog = false; … … 1119 1133 1120 1134 define( 'BP_ROOT_BLOG', $root_blog_id ); 1121 1135 1122 1136 // Root blog is defined 1123 1137 } else { … … 1221 1235 * 1222 1236 * @uses apply_filters() Filter 'bp_is_username_compatibility_mode' to alter 1223 * @return bool False when compatibility mode is disabled (default); true when enabled 1237 * @return bool False when compatibility mode is disabled (default); true when enabled 1224 1238 */ 1225 1239 function bp_is_username_compatibility_mode() { … … 1232 1246 * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is 1233 1247 * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog 1234 * on the network. Thus, instead of having all 'boonebgorges' links go to 1248 * on the network. Thus, instead of having all 'boonebgorges' links go to 1235 1249 * http://example.com/members/boonebgorges 1236 1250 * on the root blog, each blog will have its own version of the same profile content, eg … … 1245 1259 * 1246 1260 * @uses apply_filters() Filter 'bp_is_multiblog_mode' to alter 1247 * @return bool False when multiblog mode is disabled (default); true when enabled 1261 * @return bool False when multiblog mode is disabled (default); true when enabled 1248 1262 */ 1249 1263 function bp_is_multiblog_mode() { … … 1264 1278 * 1265 1279 * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter 1266 * @return bool False when WP Admin Bar support is disabled (default); true when enabled 1280 * @return bool False when WP Admin Bar support is disabled (default); true when enabled 1267 1281 */ 1268 1282 function bp_use_wp_admin_bar() { 1269 1283 return apply_filters( 'bp_use_wp_admin_bar', defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR ); 1284 } 1285 1286 /** 1287 * Are oembeds allowed in activity items? 1288 * 1289 * @return bool False when activity embed support is disabled; true when enabled (default) 1290 * @since 1.3 1291 */ 1292 function bp_use_embed_in_activity() { 1293 return apply_filters( 'bp_use_oembed_in_activity', !defined( 'BP_EMBED_DISABLE_ACTIVITY' ) || !BP_EMBED_DISABLE_ACTIVITY ); 1294 } 1295 1296 /** 1297 * Are oembeds allwoed in acitivity replies? 1298 * 1299 * @return bool False when activity replies embed support is disabled; true when enabled (default) 1300 * @since 1.3 1301 */ 1302 function bp_use_embed_in_activity_replies() { 1303 return apply_filters( 'bp_use_embed_in_activity_replies', !defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) || !BP_EMBED_DISABLE_ACTIVITY_REPLIES ); 1304 } 1305 1306 /** 1307 * Are oembeds allowed on forum posts? 1308 * 1309 * @return bool False when form post embed support is disabled; true when enabled (default) 1310 * @since 1.3 1311 */ 1312 function bp_use_embed_in_forum_posts() { 1313 return apply_filters( 'bp_use_embed_in_forum_posts', !defined( 'BP_EMBED_DISABLE_FORUM_POSTS' ) || !BP_EMBED_DISABLE_FORUM_POSTS ); 1270 1314 } 1271 1315 … … 1373 1417 do_action( 'bp_do_404', $redirect ); 1374 1418 1375 $wp_query->set_404(); 1376 status_header( 404 ); 1419 $wp_query->set_404(); 1420 status_header( 404 ); 1377 1421 nocache_headers(); 1378 1422
Note: See TracChangeset
for help on using the changeset viewer.