Changeset 5623 for trunk/bp-activity/bp-activity-akismet.php
- Timestamp:
- 01/07/2012 07:48:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-akismet.php
r5622 r5623 56 56 // Hook into the Activity wp-admin screen 57 57 add_action( 'bp_activity_admin_comment_row_actions', array( $this, 'comment_row_action' ), 10, 2 ); 58 add_action( 'bp_activity_admin_load', array( $this, 'add_history_metabox' ) ); 58 59 } 59 60 … … 97 98 $b[ $k ] = $item; 98 99 if ( $k == 'edit' ) 99 $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '# history"> '. __( 'History', 'buddypress' ) . '</a>';100 $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; 100 101 } 101 102 … … 104 105 105 106 if ( $desc ) 106 echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '# history">' . htmlspecialchars( $desc ) . '</a></span>';107 echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>'; 107 108 108 109 return apply_filters( 'bp_akismet_comment_row_action', $actions ); 109 110 } 110 111 111 112 112 /** … … 485 485 486 486 /** 487 * Adds a "History" meta box to the activity edit screen. 488 * 489 * @param string $screen_action The type of screen that has been requested 490 * @since 1.6 491 */ 492 function add_history_metabox( $screen_action ) { 493 // Only proceed if we're on the edit screen 494 if ( 'edit' != $screen_action ) 495 return; 496 497 // Display meta box with a low priority (low position on screen by default) 498 add_meta_box( 'bp_activity_history', __( 'Activity History', 'buddypress' ), array( $this, 'history_metabox' ), 'toplevel_page_bp-activity', 'advanced', 'low' ); 499 } 500 501 /** 502 * History meta box for the Activity admin edit screen 503 * 504 * @param object $item Activity item 505 * @since 1.6 506 * @todo Update activity meta to allow >1 record with the same key (iterate through $history). 507 * @see http://buddypress.trac.wordpress.org/ticket/3907 508 */ 509 function history_metabox( $item ) { 510 $history = BP_Akismet::get_activity_history( $item->id ); 511 512 if ( empty( $history ) ) 513 return; 514 515 echo '<div class="akismet-history"><div>'; 516 printf( '<span>%1$s</span> — %2$s', bp_core_time_since( $history[2] ), esc_html( $history[1] ) ); 517 echo '</div></div>'; 518 } 519 520 /** 487 521 * Update an activity item's Akismet history 488 522 *
Note: See TracChangeset
for help on using the changeset viewer.