common
2 years ago
redirection-and-404-logs
2 years ago
redirection-rules
2 years ago
specific-url-redirections
2 years ago
automatic-redirects.php
2 years ago
change-urls.php
2 years ago
redirection-and-404-logs.php
2 years ago
redirection-rules.php
2 years ago
specific-url-redirections.php
2 years ago
redirection-rules.php
40 lines
| 1 | <?php |
| 2 | if (!defined("ABSPATH")) { |
| 3 | exit(); |
| 4 | } |
| 5 | |
| 6 | $redirectionType = self::TYPE_REDIRECTION_RULE; |
| 7 | $args = ["type" => $redirectionType]; |
| 8 | $countRedirects = (int) $this->dbManager->getCount($args); |
| 9 | $countPages = ceil($countRedirects / self::PER_PAGE_REDIRECTIONS); |
| 10 | $settingsData = $this->getData(); |
| 11 | |
| 12 | //==== export/import start |
| 13 | $adminUrl = admin_url("/admin-post.php?action=irrp_export&_type=" . self::TYPE_REDIRECTION_RULE); |
| 14 | $action = IRRPHelper::nonceKey(); |
| 15 | $exportNonceUrl = wp_nonce_url($adminUrl, $action, "_irrp_nonce"); |
| 16 | //==== export/import end |
| 17 | ?> |
| 18 | <?php include_once "redirection-rules/header.php"; ?> |
| 19 | <?php $customBodyClass = ($countRedirects > 0) ? "" : "ir-hidden"; ?> |
| 20 | <div class="ir-import-redirects-container"> |
| 21 | <?php $irImportLinkCls = $countRedirects ? "ir-hidden" : ""; ?> |
| 22 | <span class="ir-import-redirects-container__bottom-note highlighted ir-import-redirects <?php echo $irImportLinkCls; ?>"> |
| 23 | <?php _e("...or", "redirect-redirection"); ?> |
| 24 | <label for="irrp_import_redirects"> |
| 25 | <?php _e("<strong>import</strong> ", "redirect-redirection"); ?> |
| 26 | <input type="file" name="import" id="irrp_import_redirects" data-nonce="<?php echo wp_create_nonce(md5(ABSPATH . get_home_url())); ?>" /> |
| 27 | </label> |
| 28 | <?php _e("a list of specific URL redirections", "redirect-redirection"); ?> |
| 29 | </span> |
| 30 | </div> |
| 31 | <div class="custom-body <?php esc_attr_e($customBodyClass); ?>"> |
| 32 | <h3 class="custom-body__heading"> |
| 33 | <span class="custom-body__heading-primary"><?php _e("Your redirection rules", "redirect-redirection"); ?></span> |
| 34 | <!--<span class="custom-body__heading-secondary">(Your redirection rules)</span>--> |
| 35 | </h3> |
| 36 | <?php include_once "common/custom-filter.php"; ?> |
| 37 | <?php include_once "common/custom-body-data.php"; ?> |
| 38 | <textarea class="ir-selected-redirects ir-hidden"></textarea> |
| 39 | <input type="hidden" class="ir-redirection-type" value="<?php esc_attr_e(self::TYPE_REDIRECTION_RULE); ?>" /> |
| 40 | </div> |