@@ 144-153 (lines=10) @@ | ||
141 | * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be |
|
142 | * another value if filtered by a plugin. |
|
143 | */ |
|
144 | public function lazyload_term_meta( $check ) { |
|
145 | if ( ! empty( $this->pending_objects['term'] ) ) { |
|
146 | update_termmeta_cache( array_keys( $this->pending_objects['term'] ) ); |
|
147 | ||
148 | // No need to run again for this set of terms. |
|
149 | $this->reset_queue( 'term' ); |
|
150 | } |
|
151 | ||
152 | return $check; |
|
153 | } |
|
154 | ||
155 | /** |
|
156 | * Lazy-loads comment meta for queued comments. |
|
@@ 166-175 (lines=10) @@ | ||
163 | * @param mixed $check The `$check` param passed from the {@see 'get_comment_metadata'} hook. |
|
164 | * @return mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`. |
|
165 | */ |
|
166 | public function lazyload_comment_meta( $check ) { |
|
167 | if ( ! empty( $this->pending_objects['comment'] ) ) { |
|
168 | update_meta_cache( 'comment', array_keys( $this->pending_objects['comment'] ) ); |
|
169 | ||
170 | // No need to run again for this set of comments. |
|
171 | $this->reset_queue( 'comment' ); |
|
172 | } |
|
173 | ||
174 | return $check; |
|
175 | } |
|
176 | } |
|
177 |