Changeset 7574
- Timestamp:
- 11/15/2013 08:57:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r7570 r7574 530 530 extract( $r ); 531 531 532 // Translate various values for 'display_comments' 533 // This allows disabling comments via ?display_comments=0 534 // or =none or =false. Final true is a strict type check. See #5029 535 if ( in_array( $display_comments, array( 0, '0', 'none', 'false' ), true ) ) { 536 $display_comments = false; 537 } 538 532 539 if ( empty( $search_terms ) && ! empty( $_REQUEST['s'] ) ) 533 540 $search_terms = $_REQUEST['s']; -
trunk/tests/testcases/activity/template.php
r7127 r7574 254 254 255 255 } 256 /**257 * @ticket BP5029258 */259 public function test_get_with_display_comments_false_querystring() {260 $now = time();261 $a1 = $this->factory->activity->create( array(262 'content' => 'Life Rules',263 'recorded_time' => date( 'Y-m-d H:i:s', $now ),264 ) );265 $a2 = $this->factory->activity->create( array(266 'content' => 'Life Drools',267 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),268 ) );269 $a3 = bp_activity_new_comment( array(270 'activity_id' => $a1,271 'content' => 'Candy is good',272 'recorded_time' => date( 'Y-m-d H:i:s', $now - 50 ),273 ) );274 275 $expected = BP_Activity_Activity::get( array(276 'display_comments' => false,277 ) );278 279 $found = BP_Activity_Activity::get( 'display_comments=false' );280 $this->assertEquals( $expected, $found );281 282 }283 284 285 256 }
Note: See TracChangeset
for help on using the changeset viewer.