|
306 | 306 | $expression = Util::parse($expression); |
307 | 307 |
|
308 | 308 | if (! empty($expression->get(2))) { |
309 | | - return "<?php if (collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->isNotEmpty()) : ?>" . // phpcs:ignore |
310 | | - "<a href=\"<?= get_term_link(collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->term_ID); ?>\">" . // phpcs:ignore |
311 | | - "<?= collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->name(); ?>" . |
| 309 | + return "<?php if (get_the_terms({$expression->get(1)}, {$expression->get(0)})) : ?>" . // phpcs:ignore |
| 310 | + "<a href=\"<?= get_term_link(collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->term_id); ?>\">" . // phpcs:ignore |
| 311 | + "<?= collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->name; ?>" . |
312 | 312 | "</a>" . |
313 | 313 | "<?php endif; ?>"; |
314 | 314 | } |
315 | 315 |
|
316 | 316 | if (! empty($expression->get(1))) { |
317 | 317 | if ($expression->get(1) === 'true') { |
318 | | - return "<?php if (collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->isNotEmpty()) : ?>" . |
319 | | - "<a href=\"<?= get_term_link(collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->shift()->term_ID); ?>\">" . // phpcs:ignore |
320 | | - "<?= collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->shift()->name(); ?>" . |
| 318 | + return "<?php if (get_the_terms(get_the_ID(), {$expression->get(0)})) : ?>" . |
| 319 | + "<a href=\"<?= get_term_link(collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->shift()->term_id); ?>\">" . // phpcs:ignore |
| 320 | + "<?= collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->shift()->name; ?>" . |
321 | 321 | "</a>" . |
322 | 322 | "<?php endif; ?>"; |
323 | 323 | } |
324 | 324 |
|
325 | | - return "<?php if (collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->isNotEmpty()) : ?>" . // phpcs:ignore |
326 | | - "<?= collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->name(); ?>" . |
| 325 | + return "<?php if (get_the_terms({$expression->get(1)}, {$expression->get(0)})) : ?>" . // phpcs:ignore |
| 326 | + "<?= collect(get_the_terms({$expression->get(1)}, {$expression->get(0)}))->shift()->name; ?>" . |
327 | 327 | "<?php endif; ?>"; |
328 | 328 | } |
329 | 329 |
|
330 | 330 | if (! empty($expression->get(0))) { |
331 | | - return "<?php if (collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->isNotEmpty()) : ?>" . |
| 331 | + return "<?php if (get_the_terms(get_the_ID(), {$expression->get(0)})) : ?>" . |
332 | 332 | "<?= collect(get_the_terms(get_the_ID(), {$expression->get(0)}))->shift()->name; ?>" . |
333 | 333 | "<?php endif; ?>"; |
334 | 334 | } |
|
0 commit comments