- var_dump: documentation ( source)
- get_object_vars: documentation ( source)
<?php
class WP_Term {
public $data = array();
}
$wp_term = new WP_Term( new stdClass() );
echo 'Testing if the $data dynamic property is accessible when iterating the WP_Term\'s object properties.' . PHP_EOL;
foreach ( $wp_term as $property => $value ) {
echo "Key: $property" . PHP_EOL;
}
echo PHP_EOL;
echo 'Testing if the $data dynamic property is accessible when calling WP_Term::get_object_vars()' . PHP_EOL;
var_dump( get_object_vars( $wp_term ) );