beta-features.php
109 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin Beta Features View |
| 4 | * |
| 5 | * @package Secure Custom Fields |
| 6 | * @since SCF 6.5.0 |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | $beta_features = acf()->admin_beta_features->get_beta_features(); |
| 14 | ?> |
| 15 | <div class="wrap" id="scf-admin-beta-features"> |
| 16 | <h1 class="wp-heading-inline"><?php esc_html_e( 'Beta Features', 'secure-custom-fields' ); ?></h1> |
| 17 | <hr class="wp-header-end"> |
| 18 | |
| 19 | <div class="scf-beta-features-list"> |
| 20 | <div class="scf-beta-features-header"> |
| 21 | <p><?php esc_html_e( 'Enable or disable beta features. These features are in development and may change in future releases.', 'secure-custom-fields' ); ?></p> |
| 22 | </div> |
| 23 | |
| 24 | <?php if ( empty( $beta_features ) ) : ?> |
| 25 | <div class="scf-no-beta-features"> |
| 26 | <p><?php esc_html_e( 'No beta features are currently available.', 'secure-custom-fields' ); ?></p> |
| 27 | </div> |
| 28 | <?php else : ?> |
| 29 | <form method="post" action="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group&page=scf-beta-features' ) ); ?>"> |
| 30 | <?php wp_nonce_field( 'scf_beta_features_update', 'scf_beta_features_nonce' ); ?> |
| 31 | <table class="widefat scf-beta-features-table"> |
| 32 | <thead> |
| 33 | <tr> |
| 34 | <th class="scf-beta-feature-status"><?php esc_html_e( 'Enabled', 'secure-custom-fields' ); ?></th> |
| 35 | <th class="scf-beta-feature-info"><?php esc_html_e( 'Beta Feature', 'secure-custom-fields' ); ?></th> |
| 36 | </tr> |
| 37 | </thead> |
| 38 | <tbody> |
| 39 | <?php foreach ( $beta_features as $beta_feature ) : ?> |
| 40 | <tr> |
| 41 | <td class="scf-beta-feature-status"> |
| 42 | <input type="checkbox" |
| 43 | id="scf_beta_feature_<?php echo esc_attr( $beta_feature->name ); ?>" |
| 44 | name="scf_beta_features[<?php echo esc_attr( $beta_feature->name ); ?>]" |
| 45 | value="1" |
| 46 | <?php checked( $beta_feature->is_enabled() ); ?> |
| 47 | /> |
| 48 | </td> |
| 49 | <td class="scf-beta-feature-info"> |
| 50 | <label for="scf_beta_feature_<?php echo esc_attr( $beta_feature->name ); ?>"> |
| 51 | <strong><?php echo esc_html( $beta_feature->title ); ?></strong> |
| 52 | </label> |
| 53 | <p class="description"><?php echo esc_html( $beta_feature->description ); ?></p> |
| 54 | </td> |
| 55 | </tr> |
| 56 | <?php endforeach; ?> |
| 57 | </tbody> |
| 58 | </table> |
| 59 | |
| 60 | <p class="submit"> |
| 61 | <input type="submit" name="submit" class="button button-primary" value="<?php esc_attr_e( 'Save Changes', 'secure-custom-fields' ); ?>" /> |
| 62 | </p> |
| 63 | </form> |
| 64 | <?php endif; ?> |
| 65 | </div> |
| 66 | </div> |
| 67 | |
| 68 | <style> |
| 69 | .scf-beta-features-list { |
| 70 | max-width: 800px; |
| 71 | margin-top: 20px; |
| 72 | } |
| 73 | .scf-beta-features-header { |
| 74 | margin-bottom: 20px; |
| 75 | } |
| 76 | .scf-beta-features-table { |
| 77 | border-spacing: 0; |
| 78 | width: 100%; |
| 79 | clear: both; |
| 80 | margin: 0; |
| 81 | } |
| 82 | .scf-beta-features-table th { |
| 83 | padding: 8px 10px; |
| 84 | } |
| 85 | .scf-beta-features-table td { |
| 86 | padding: 15px 10px; |
| 87 | vertical-align: top; |
| 88 | } |
| 89 | .scf-beta-feature-status { |
| 90 | width: 60px; |
| 91 | text-align: center; |
| 92 | } |
| 93 | .scf-beta-feature-info label { |
| 94 | font-size: 14px; |
| 95 | line-height: 1.3; |
| 96 | } |
| 97 | .scf-beta-feature-info .description { |
| 98 | margin: 4px 0 0; |
| 99 | color: #646970; |
| 100 | } |
| 101 | .scf-no-beta-features { |
| 102 | background: #fff; |
| 103 | border: 1px solid #ccd0d4; |
| 104 | border-radius: 4px; |
| 105 | padding: 20px; |
| 106 | margin-top: 20px; |
| 107 | text-align: center; |
| 108 | } |
| 109 | </style> |