Repository navigation
Commit c3563e6
committed
Keep the object cache when listing computed post fields
Fields like post meta are read through WP_Post::__get(), which uses the
object cache. When the first post lacks such a field, the formatter
can't stream and only reads the fields once all posts are loaded. By
then the cache was cleared after each chunk, so every post needed
another query, which made `wp post list --fields=ID,<meta key>` slower
than before. Only clear the cache when all displayed fields are plain
post properties.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS1 parent f78534d commit c3563e6
2 files changed
Lines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | | - | |
1066 | | - | |
| 1065 | + | |
| 1066 | + | |
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1077 | 1081 | | |
1078 | | - | |
| 1082 | + | |
1079 | 1083 | | |
1080 | 1084 | | |
1081 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1082 | 1094 | | |
1083 | 1095 | | |
1084 | 1096 | | |
| |||
1117 | 1129 | | |
1118 | 1130 | | |
1119 | 1131 | | |
1120 | | - | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1121 | 1135 | | |
1122 | 1136 | | |
1123 | 1137 | | |
| |||
0 commit comments