Changeset 9276
- Timestamp:
- 12/24/2014 08:09:13 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-actions.php
r9194 r9276 754 754 } 755 755 756 $ results = bp_core_get_suggestions(array(756 $args = array( 757 757 'term' => sanitize_text_field( $_GET['term'] ), 758 758 'type' => sanitize_text_field( $_GET['type'] ), 759 ) ); 759 ); 760 761 // Support per-Group suggestions. 762 if ( ! empty( $_GET['group-id'] ) ) { 763 $args['group_id'] = absint( $_GET['group-id'] ); 764 } 765 766 $results = bp_core_get_suggestions( $args ); 760 767 761 768 if ( is_wp_error( $results ) ) { -
trunk/src/bp-activity/js/mentions.js
r9100 r9276 152 152 */ 153 153 remote_filter: function( query, render_view ) { 154 var self = $( this ); 154 var self = $( this ), 155 params = {}; 155 156 156 157 mentionsItem = mentionsQueryCache[ query ]; … … 164 165 } 165 166 166 self.xhr = $.getJSON( ajaxurl, { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' } ) 167 params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' }; 168 169 if ( $.isNumeric( this.$inputor.data( 'suggestions-group-id' ) ) ) { 170 params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 ); 171 } 172 173 self.xhr = $.getJSON( ajaxurl, params ) 167 174 /** 168 175 * Success callback for the @suggestions lookup. -
trunk/src/bp-groups/bp-groups-filters.php
r9026 r9276 234 234 } 235 235 add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' ); 236 237 /** 238 * Should BuddyPress load the mentions scripts and related assets, including results to prime the 239 * mentions suggestions? 240 * 241 * @param bool $load_mentions True to load mentions assets, false otherwise. 242 * @param bool $mentions_enabled True if mentions are enabled. 243 * @return bool True if mentions scripts should be loaded. 244 * @since BuddyPress (2.2.0) 245 */ 246 function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enabled ) { 247 if ( ! $mentions_enabled ) { 248 return $load_mentions; 249 } 250 251 if ( $load_mentions || ( bp_is_group_activity() || bp_is_group_home() ) ) { 252 return true; 253 } 254 255 return $load_mentions; 256 } 257 add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_groups_maybe_load_mentions_scripts', 10, 2 ); -
trunk/src/bp-templates/bp-legacy/buddypress/activity/post-form.php
r8754 r9276 28 28 <div id="whats-new-content"> 29 29 <div id="whats-new-textarea"> 30 <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea> 30 <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10" 31 <?php 32 if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; 33 if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; 34 ?> 35 ></textarea> 31 36 </div> 32 37
Note: See TracChangeset
for help on using the changeset viewer.