Changeset 9763
- Timestamp:
- 04/17/2015 03:34:18 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r9694 r9763 193 193 /** Override **********************************************************/ 194 194 195 /** 196 * Fires after all of the BuddyPress theme compat actions have been added. 197 * 198 * @since BuddyPress (1.7.0) 199 * 200 * @param BP_Legacy $this Current BP_Legacy instance. 201 */ 195 202 do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) ); 196 203 } … … 259 266 } 260 267 261 // Add words that we need to use in JS to the end of the page 262 // so they can be translated and still used. 268 /** 269 * Filters core JavaScript strings for internationalization before AJAX usage. 270 * 271 * @since BuddyPress (2.0.0) 272 * 273 * @param array $value Array of key/value pairs for AJAX usage. 274 */ 263 275 $params = apply_filters( 'bp_core_get_js_strings', array( 264 276 'accepted' => __( 'Accepted', 'buddypress' ), … … 487 499 public function theme_compat_page_templates( $templates = array() ) { 488 500 489 // Bail if not looking at a directory 501 /** 502 * Filters whether or not we are looking at a directory to determine if to return early. 503 * 504 * @since BuddyPress (2.2.0) 505 * 506 * @param bool $value Whether or not we are viewing a directory. 507 */ 490 508 if ( true === (bool) apply_filters( 'bp_legacy_theme_compat_page_templates_directory_only', ! bp_is_directory() ) ) { 491 509 return $templates; … … 699 717 $object_extras = $_BP_COOKIE['bp-' . $object . '-extras']; 700 718 719 /** 720 * Filters the AJAX query string for the component loops. 721 * 722 * @since BuddyPress (1.7.0) 723 * 724 * @param string $query_string The query string we are working with. 725 * @param string $object The type of page we are on. 726 * @param string $object_filter The current object filter. 727 * @param string $object_scope The current object scope. 728 * @param string $object_page The current object page. 729 * @param string $object_search_terms The current object search terms. 730 * @param string $object_extras The current object extras. 731 */ 701 732 return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras ); 702 733 } … … 817 848 bp_get_template_part( 'activity/activity-loop' ); 818 849 $result['contents'] = ob_get_contents(); 850 851 /** 852 * Filters the feed URL for when activity is requested via AJAX. 853 * 854 * @since BuddyPress (1.7.0) 855 * 856 * @param string $feed_url URL for the feed to be used. 857 * @param string $scope Scope for the activity request. 858 */ 819 859 $result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope ); 820 860 ob_end_clean(); … … 854 894 855 895 } else { 896 897 /** This filter is documented in bp-activity/bp-activity-actions.php */ 856 898 $activity_id = apply_filters( 'bp_activity_custom_update', false, $_POST['object'], $_POST['item_id'], $_POST['content'] ); 857 899 } … … 986 1028 exit( '-1' ); 987 1029 988 / / Call the action before the delete so plugins can still fetch information about it1030 /** This action is documented in bp-activity/bp-activity-actions.php */ 989 1031 do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id ); 990 1032 … … 992 1034 exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); 993 1035 1036 /** This action is documented in bp-activity/bp-activity-actions.php */ 994 1037 do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); 995 1038 exit; … … 1022 1065 exit( '-1' ); 1023 1066 1024 / / Call the action before the delete so plugins can still fetch information about it1067 /** This action is documented in bp-activity/bp-activity-actions.php */ 1025 1068 do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id ); 1026 1069 … … 1028 1071 exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); 1029 1072 1073 /** This action is documented in bp-activity/bp-activity-actions.php */ 1030 1074 do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id ); 1031 1075 exit; … … 1065 1109 check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); 1066 1110 1067 / / Call an action before the spamming so plugins can modify things if they want to1111 /** This action is documented in bp-activity/bp-activity-actions.php */ 1068 1112 do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity ); 1069 1113 … … 1072 1116 $activity->save(); 1073 1117 1118 /** This action is documented in bp-activity/bp-activity-actions.php */ 1074 1119 do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id ); 1075 1120 exit; … … 1115 1160 1116 1161 /** 1117 * Fetches fullan activity's full, non-excerpted content via a POST request.1162 * Fetches an activity's full, non-excerpted content via a POST request. 1118 1163 * Used for the 'Read More' link on long activity items. 1119 1164 * … … 1136 1181 exit; // @todo: error? 1137 1182 1183 /** 1184 * Fires before the return of an activity's full, non-excerpted content via a POST request. 1185 * 1186 * @since BuddyPress (1.7.0) 1187 * 1188 * @param string $activity Activity content. Passed by reference. 1189 */ 1138 1190 do_action_ref_array( 'bp_legacy_theme_get_single_activity_content', array( &$activity ) ); 1139 1191 1140 1192 // Activity content retrieved through AJAX should run through normal filters, but not be truncated 1141 1193 remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); 1194 1195 /** This filter is documented in bp-activity/bp-activity-template.php */ 1142 1196 $content = apply_filters( 'bp_get_activity_content_body', $activity->content ); 1143 1197 … … 1445 1499 <div class="message-box new-message <?php echo $class; ?>"> 1446 1500 <div class="message-metadata"> 1447 <?php do_action( 'bp_before_message_meta' ); ?> 1501 <?php 1502 1503 /** 1504 * Fires before the notifications for private messages. 1505 * 1506 * @since BuddyPress (1.1.0) 1507 */ 1508 do_action( 'bp_before_message_meta' ); ?> 1448 1509 <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?> 1449 1510 1450 1511 <strong><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_fullname(); ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ); ?></span></strong> 1451 1512 1452 <?php do_action( 'bp_after_message_meta' ); ?> 1513 <?php 1514 1515 /** 1516 * Fires after the notifications for private messages. 1517 * 1518 * @since BuddyPress (1.1.0) 1519 */ 1520 do_action( 'bp_after_message_meta' ); ?> 1453 1521 </div> 1454 1522 1455 <?php do_action( 'bp_before_message_content' ); ?> 1523 <?php 1524 1525 /** 1526 * Fires before the message content for a private message. 1527 * 1528 * @since BuddyPress (1.1.0) 1529 */ 1530 do_action( 'bp_before_message_content' ); ?> 1456 1531 1457 1532 <div class="message-content"> 1458 <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?> 1533 <?php 1534 1535 /** This filter is documented in bp-messages/bp-messages-template.php */ 1536 echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?> 1459 1537 </div> 1460 1538 1461 <?php do_action( 'bp_after_message_content' ); ?> 1539 <?php 1540 1541 /** 1542 * Fires after the message content for a private message. 1543 * 1544 * @since BuddyPress (1.1.0) 1545 */ 1546 do_action( 'bp_after_message_content' ); ?> 1462 1547 1463 1548 <div class="clear"></div> … … 1555 1640 */ 1556 1641 function bp_legacy_theme_ajax_messages_autocomplete_results() { 1642 1643 /** 1644 * Filters the max results default value for ajax messages autocomplete results. 1645 * 1646 * @since BuddyPress (1.5.0) 1647 * 1648 * @param int $value Max results for autocomplete. Default 10. 1649 */ 1557 1650 $limit = isset( $_GET['limit'] ) ? absint( $_GET['limit'] ) : (int) apply_filters( 'bp_autocomplete_max_results', 10 ); 1558 1651 $term = isset( $_GET['q'] ) ? sanitize_text_field( $_GET['q'] ) : '';
Note: See TracChangeset
for help on using the changeset viewer.