Changeset 7809 for trunk/bp-core/bp-core-cache.php
- Timestamp:
- 02/06/2014 06:58:17 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-cache.php
r7786 r7809 56 56 add_action( 'bp_first_activity_for_member', 'bp_core_clear_member_count_caches' ); 57 57 add_action( 'deleted_user', 'bp_core_clear_member_count_caches' ); 58 59 /** 60 * Clear the directory_pages cache when one of the pages is updated. 61 * 62 * @since BuddyPress (2.0.0) 63 * 64 * @param int $post_id 65 */ 66 function bp_core_clear_directory_pages_cache_page_edit( $post_id ) { 67 if ( ! bp_is_root_blog() ) { 68 return; 69 } 70 71 // Bail if BP is not defined here 72 if ( ! buddypress() ) { 73 return; 74 } 75 76 $page_ids = bp_core_get_directory_page_ids(); 77 78 if ( ! in_array( $post_id, (array) $page_ids ) ) { 79 return; 80 } 81 82 wp_cache_delete( 'directory_pages', 'bp' ); 83 } 84 add_action( 'save_post_page', 'bp_core_clear_directory_pages_cache_page_edit' ); 85 86 /** 87 * Clear the directory_pages cache when the bp-pages option is updated. 88 * 89 * @since BuddyPress (2.0.0) 90 */ 91 function bp_core_clear_directory_pages_cache_settings_edit() { 92 wp_cache_delete( 'directory_pages', 'bp' ); 93 } 94 add_action( 'update_option_bp-pages', 'bp_core_clear_directory_pages_cache_settings_edit' ); 58 95 59 96 /**
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)