Changeset 4359
- Timestamp:
- 11/08/2012 07:37:50 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/admin.php
r4358 r4359 1252 1252 */ 1253 1253 public function suggest_forum() { 1254 foreach ( get_posts( array( 's' => like_escape( $_REQUEST['q'] ), 'post_type' => bbp_get_forum_post_type() ) ) as $post ) { 1255 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_forum_id( $post->ID ), bbp_get_forum_title( $post->ID ) ) . "\n"; 1254 1255 // Try to get some forums 1256 $forums = get_posts( array( 1257 's' => like_escape( $_REQUEST['q'] ), 1258 'post_type' => bbp_get_forum_post_type(), 1259 'post_status' => array( 1260 bbp_get_public_status_id(), 1261 bbp_get_hidden_status_id(), 1262 bbp_get_private_status_id() 1263 ) 1264 ) ); 1265 1266 // If we found some forums, loop through and display them 1267 if ( ! empty( $forums ) ) { 1268 foreach ( (array) $forums as $post ) { 1269 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_forum_id( $post->ID ), bbp_get_forum_title( $post->ID ) ) . "\n"; 1270 } 1256 1271 } 1257 1272 die(); … … 1269 1284 */ 1270 1285 public function suggest_topic() { 1271 foreach ( get_posts( array( 's' => like_escape( $_REQUEST['q'] ), 'post_type' => bbp_get_topic_post_type() ) ) as $post ) { 1272 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) ) . "\n"; 1286 1287 // TRy to get some topics 1288 $topics = get_posts( array( 1289 's' => like_escape( $_REQUEST['q'] ), 1290 'post_type' => bbp_get_topic_post_type() 1291 ) ); 1292 1293 // If we found some topics, loop through and display them 1294 if ( ! empty( $topics ) ) { 1295 foreach ( (array) $topics as $post ) { 1296 echo sprintf( __( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) ) . "\n"; 1297 } 1273 1298 } 1274 1299 die();
Note: See TracChangeset
for help on using the changeset viewer.