Changeset 5686 for trunk/bp-blogs/bp-blogs-activity.php
- Timestamp:
- 02/09/2012 10:36:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-activity.php
r5302 r5686 1 1 <?php 2 /****************************************************************************** 3 * These functions handle the recording, deleting and formatting of activity and 4 * notifications for the user and for this specific component. 2 3 /** 4 * BuddyPress Blogs Activity 5 * 6 * @package BuddyPress 7 * @subpackage BlogsActivity 5 8 */ 6 9 … … 8 11 if ( !defined( 'ABSPATH' ) ) exit; 9 12 10 13 /** 14 * Register activity actions for the blogs component 15 * 16 * @since BuddyPress (1.0) 17 * @package BuddyPress 18 * @subpackage BlogsActivity 19 * @global type $bp 20 * @return boolean 21 */ 11 22 function bp_blogs_register_activity_actions() { 12 23 global $bp; 13 24 14 if ( !bp_is_active( 'activity' ) ) 25 // Bail if activity is not active 26 if ( ! bp_is_active( 'activity' ) ) 15 27 return false; 16 28 … … 23 35 add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' ); 24 36 37 /** 38 * Record the activity to the actvity stream 39 * 40 * @since BuddyPress (1.0) 41 * @package BuddyPress 42 * @subpackage BlogsActivity 43 * @global BuddyPress $bp 44 * @param array $args 45 * @return boolean 46 */ 25 47 function bp_blogs_record_activity( $args = '' ) { 26 48 global $bp; 27 49 28 if ( !bp_is_active( 'activity' ) ) 50 // Bail if activity is not active 51 if ( ! bp_is_active( 'activity' ) ) 29 52 return false; 30 53 … … 46 69 47 70 // Remove large images and replace them with just one image thumbnail 48 if ( bp_is_active( 'activity' ) &&!empty( $content ) )71 if ( !empty( $content ) ) 49 72 $content = bp_activity_thumbnail_content_images( $content, $primary_link ); 50 73 … … 67 90 } 68 91 92 /** 93 * Delete a blogs activity stream item 94 * 95 * @since BuddyPress (1.0) 96 * @package BuddyPress 97 * @subpackage BlogsActivity 98 * @global BuddyPress $bp 99 * @param array $args 100 * @return If activity is not active 101 */ 69 102 function bp_blogs_delete_activity( $args = true ) { 70 103 global $bp; 71 104 72 if ( bp_is_active( 'activity' ) ) { 73 $defaults = array( 74 'item_id' => false, 75 'component' => $bp->blogs->id, 76 'type' => false, 77 'user_id' => false, 78 'secondary_item_id' => false 79 ); 105 // Bail if activity is not active 106 if ( ! bp_is_active( 'activity' ) ) 107 return false; 80 108 81 $params = wp_parse_args( $args, $defaults ); 82 extract( $params, EXTR_SKIP ); 109 $defaults = array( 110 'item_id' => false, 111 'component' => $bp->blogs->id, 112 'type' => false, 113 'user_id' => false, 114 'secondary_item_id' => false 115 ); 83 116 84 bp_activity_delete_by_item_id( array( 85 'item_id' => $item_id, 86 'component' => $component, 87 'type' => $type, 88 'user_id' => $user_id, 89 'secondary_item_id' => $secondary_item_id 90 ) ); 91 } 117 $params = wp_parse_args( $args, $defaults ); 118 extract( $params, EXTR_SKIP ); 119 120 bp_activity_delete_by_item_id( array( 121 'item_id' => $item_id, 122 'component' => $component, 123 'type' => $type, 124 'user_id' => $user_id, 125 'secondary_item_id' => $secondary_item_id 126 ) ); 92 127 } 93 128
Note: See TracChangeset
for help on using the changeset viewer.