| 1 |
<?php |
| 2 |
/** |
| 3 |
* Settings page view. |
| 4 |
* |
| 5 |
* @package Custom_404_Pro |
| 6 |
*/ |
| 7 |
|
| 8 |
$c4p_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 9 |
$active_tab = empty( $c4p_tab ) ? 'global-redirect' : $c4p_tab; |
| 10 |
|
| 11 |
?> |
| 12 |
|
| 13 |
<div class="wrap"> |
| 14 |
<h2><?php esc_html_e( 'Settings', 'custom-404-pro' ); ?></h2> |
| 15 |
<h2 class="nav-tab-wrapper"> |
| 16 |
<a href="?page=c4p-settings&tab=global-redirect" class="nav-tab <?php echo ( 'global-redirect' === $active_tab || '' === $active_tab ) ? 'nav-tab-active' : ''; ?>"> |
| 17 |
<?php esc_html_e( 'Redirect', 'custom-404-pro' ); ?> |
| 18 |
</a> |
| 19 |
<a href="?page=c4p-settings&tab=general" class="nav-tab <?php echo 'general' === $active_tab ? 'nav-tab-active' : ''; ?>"> |
| 20 |
<?php esc_html_e( 'General', 'custom-404-pro' ); ?> |
| 21 |
</a> |
| 22 |
</h2> |
| 23 |
</div> |
| 24 |
|
| 25 |
<?php |
| 26 |
|
| 27 |
switch ( $active_tab ) { |
| 28 |
case '': |
| 29 |
include 'settings-global-redirect.php'; |
| 30 |
break; |
| 31 |
case 'global-redirect': |
| 32 |
include 'settings-global-redirect.php'; |
| 33 |
break; |
| 34 |
case 'general': |
| 35 |
include 'settings-general.php'; |
| 36 |
break; |
| 37 |
} |
| 38 |
?> |
| 39 |
|