| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | function debugging() { |
|---|
| 4 | global $wp_object_cache; |
|---|
| 5 | |
|---|
| 6 | $tmp = wp_suspend_cache_addition(true); |
|---|
| 7 | |
|---|
| 8 | error_log( "--------------" ); |
|---|
| 9 | foreach ($wp_object_cache->cache as $group => $cache) { |
|---|
| 10 | error_log("$group - ". count($cache) ." items"); |
|---|
| 11 | } |
|---|
| 12 | error_log( "--------------" ); |
|---|
| 13 | |
|---|
| 14 | $discarded = get_posts ('post_type=post&numberposts=50'); |
|---|
| 15 | |
|---|
| 16 | error_log( "--------------" ); |
|---|
| 17 | foreach ($wp_object_cache->cache as $group => $cache) { |
|---|
| 18 | error_log("$group - ". count($cache) ." items"); |
|---|
| 19 | } |
|---|
| 20 | error_log( "--------------" ); |
|---|
| 21 | |
|---|
| 22 | wp_suspend_cache_addition($tmp); |
|---|
| 23 | |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | add_action ( 'init', 'debugging' ); |
|---|
| 27 | |
|---|
| 28 | ?> |
|---|