Changeset 34730 for trunk/src/wp-includes/class-wp-comment.php
- Timestamp:
- 10/01/2015 03:57:53 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment.php
r34599 r34730 158 158 */ 159 159 protected $children; 160 161 /** 162 * Whether children have been populated for this comment object. 163 * 164 * @since 4.4.0 165 * @access protected 166 * @var bool 167 */ 168 protected $populated_children = false; 160 169 161 170 /** … … 280 289 281 290 if ( is_null( $this->children ) ) { 282 $this->children = get_comments( $_args ); 291 if ( $this->populated_children ) { 292 $this->children = array(); 293 } else { 294 $this->children = get_comments( $_args ); 295 } 283 296 } 284 297 … … 332 345 333 346 /** 347 * Set the 'populated_children' flag. 348 * 349 * This flag is important for ensuring that calling `get_children()` on a childless comment will not trigger 350 * unneeded database queries. 351 * 352 * @since 4.4.0 353 */ 354 public function populated_children( $set ) { 355 $this->populated_children = (bool) $set; 356 } 357 358 /** 334 359 * Check whether a non-public property is set. 335 360 *
Note: See TracChangeset
for help on using the changeset viewer.