ads
5 months ago
groups
4 weeks ago
metaboxes
4 weeks ago
placements
4 weeks ago
screens
1 month ago
settings
4 weeks ago
support
1 month ago
tables
4 weeks ago
tools
2 months ago
upgrades
1 year ago
widgets
4 weeks ago
bulk-edit.php
4 weeks ago
feedback-disable.php
1 year ago
header-tabs.php
4 weeks ago
header.php
5 months ago
index.php
2 years ago
manual-link.php
1 year ago
page-bulk-edit.php
1 year ago
page-quick-edit.php
1 year ago
quick-edit.php
4 weeks ago
screen-options.php
4 weeks ago
table-views-list.php
4 weeks ago
welcome-box.php
1 year ago
table-views-list.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render list-table view navigation. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.0 |
| 8 | * |
| 9 | * @var array<string, string> $views List of views. |
| 10 | * @var bool $is_all Whether no filters are applied. |
| 11 | */ |
| 12 | |
| 13 | use AdvancedAds\Framework\Utilities\Str; |
| 14 | |
| 15 | ?> |
| 16 | <ul class="flex gap-x-2 float-left clear-both mt-2.5 mb-5"> |
| 17 | <?php foreach ( $views as $index => $view ) : ?> |
| 18 | <?php |
| 19 | $view = str_replace( [ '(', ')' ], '', $view ); |
| 20 | $is_active = Str::contains( 'class="current"', $view ) || ( $is_all && 'all' === $index ); |
| 21 | $classes = 'no-underline advads-button button ' . ( $is_active ? 'button-primary' : 'button-secondary' ); |
| 22 | |
| 23 | if ( $is_active ) { |
| 24 | $view = str_replace( 'class="current"', '', $view ); |
| 25 | } |
| 26 | |
| 27 | $view = str_replace( '<a ', '<a class="' . esc_attr( $classes ) . '" ', $view ); |
| 28 | ?> |
| 29 | <li> |
| 30 | <?php |
| 31 | echo wp_kses( |
| 32 | $view, |
| 33 | [ |
| 34 | 'a' => [ |
| 35 | 'href' => [], |
| 36 | 'class' => [], |
| 37 | 'aria-current' => [], |
| 38 | ], |
| 39 | 'span' => [ 'class' => [] ], |
| 40 | ] |
| 41 | ); |
| 42 | ?> |
| 43 | </li> |
| 44 | <?php endforeach; ?> |
| 45 | </ul> |
| 46 |