| @@ -18,16 +18,15 @@ | ||
| 18 | 18 | <div class="header"> |
| 19 | 19 | <h2><?php esc_html_e( 'Settings', 'hide-metadata' ); ?></h2> |
| 20 | 20 | </div> <!-- .Header --> |
| 21 | 21 | <div class="content"> |
| 22 | - <?php if ( isset( $_GET['settings-updated'] ) ) { ?> | |
| 22 | + <?php if( isset($_GET['settings-updated']) ) { ?> | |
| 23 | 23 | <div id="message" class="notice updated fade"> |
| 24 | - <p><strong><?php esc_html_e( 'Plugin Options Saved.', 'hide-metadata' ); ?></strong></p> | |
| 25 | - </div> | |
| 24 | + <p><strong><?php esc_html_e( 'Plugin Options Saved.', 'hide-metadata' ) ?></strong></p> | |
| 25 | + </div> | |
| 26 | 26 | <?php } ?> |
| 27 | - <?php | |
| 28 | - // Use nonce for verification. | |
| 29 | - wp_nonce_field( HIDE_METADATA_BASENAME, 'hide_metadata_nonce' ); | |
| 27 | + <?php // Use nonce for verification. | |
| 28 | + wp_nonce_field( basename( __FILE__ ), 'hide_metadata_nounce' ); | |
| 30 | 29 | ?> |
| 31 | 30 | <div id="hide_metadata_main" class="hide-metadata-main"> |
| 32 | 31 | <form method="post" action="options.php"> |
| 33 | 32 | <?php settings_fields( 'hide-metadata-group' ); ?> |
| @@ -35,52 +34,53 @@ | ||
| 35 | 34 | $settings = hide_metadata_get_options(); |
| 36 | 35 | ?> |
| 37 | 36 | <div class="option-container"> |
| 38 | 37 | <table class="form-table" bgcolor="white"> |
| 39 | - <tbody> | |
| 38 | + <tbody> | |
| 39 | + <tr> | |
| 40 | + <th> | |
| 41 | + <?php esc_html_e( 'Hide By', 'hide-metadata' ); ?> | |
| 42 | + </th> | |
| 43 | + <td> | |
| 44 | + <select name="hide_metadata_options[hide_by]" id="hide_metadata_options[hide_by]"> | |
| 45 | + <option value="css" <?php echo selected( $settings['hide_by'], 'css', false ); ?> ><?php esc_html_e( 'CSS', 'hide-metadata' ); ?></option> | |
| 46 | + <option value="php" <?php echo selected( $settings['hide_by'], 'php', false ); ?> ><?php esc_html_e( 'PHP', 'hide-metadata' ); ?></option> | |
| 47 | + </select> | |
| 48 | + <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'Whether you want to hide it with CSS only or you remove it from the Page/Code.', 'hide-metadata' ); ?>"></span> | |
| 49 | + </td> | |
| 50 | + </tr> | |
| 40 | 51 | <tr> |
| 41 | - <th> | |
| 42 | - <?php esc_html_e( 'Hide By', 'hide-metadata' ); ?> | |
| 43 | - </th> | |
| 44 | - <td> | |
| 45 | - <select name="hide_metadata_options[hide_by]" id="hide_metadata_options[hide_by]"> | |
| 46 | - <option value="css" <?php echo selected( $settings['hide_by'], 'css', false ); ?> ><?php esc_html_e( 'CSS', 'hide-metadata' ); ?></option> | |
| 47 | - <option value="php" <?php echo selected( $settings['hide_by'], 'php', false ); ?> ><?php esc_html_e( 'PHP', 'hide-metadata' ); ?></option> | |
| 48 | - </select> | |
| 49 | - <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'Whether you want to hide it with CSS only or you remove it from the Page/Code.', 'hide-metadata' ); ?>"></span> | |
| 50 | - </td> | |
| 51 | - </tr> | |
| 52 | - <tr> | |
| 53 | 52 | <th scope="row"><?php esc_html_e( 'Hide author', 'hide-metadata' ); ?></th> |
| 54 | 53 | <td> |
| 55 | 54 | <div class="module-header <?php echo $settings['hide_author'] ? 'active' : 'inactive'; ?>"> |
| 56 | 55 | <div class="switch"> |
| 57 | - <input type="checkbox" id="hide_metadata_options[hide_author]" value="1" name="hide_metadata_options[hide_author]" class="shm-input-switch" rel="hide_author" <?php checked( 1, $settings['hide_author'] ); ?> > | |
| 58 | - <label for="hide_metadata_options[hide_author]"></label> | |
| 59 | - </div> | |
| 60 | - </div> | |
| 56 | + <input type="checkbox" id="hide_metadata_options[hide_author]" name="hide_metadata_options[hide_author]" class="shm-input-switch" rel="hide_author" <?php checked( true, $settings['hide_author'] ); ?> > | |
| 57 | + <label for="hide_metadata_options[hide_author]"></label> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 61 | 60 | </td> |
| 62 | - </tr> | |
| 63 | - <tr> | |
| 61 | + </tr> | |
| 62 | + <tr> | |
| 64 | 63 | <th scope="row"><?php esc_html_e( 'Hide published date', 'hide-metadata' ); ?></th> |
| 65 | 64 | <td> |
| 66 | 65 | <div class="module-header <?php echo $settings['hide_date'] ? 'active' : 'inactive'; ?>"> |
| 67 | 66 | <div class="switch"> |
| 68 | - <input type="checkbox" id="hide_metadata_options[hide_date]" value="1" name="hide_metadata_options[hide_date]" class="shm-input-switch" rel="hide_date" <?php checked( 1, $settings['hide_date'] ); ?> > | |
| 69 | - <label for="hide_metadata_options[hide_date]"></label> | |
| 70 | - </div> | |
| 71 | - </div> | |
| 67 | + <input type="checkbox" id="hide_metadata_options[hide_date]" name="hide_metadata_options[hide_date]" class="shm-input-switch" rel="hide_date" <?php checked( true, $settings['hide_date'] ); ?> > | |
| 68 | + <label for="hide_metadata_options[hide_date]"></label> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 72 | 71 | </td> |
| 73 | - </tr> | |
| 72 | + </tr> | |
| 73 | + | |
| 74 | 74 | <tr> |
| 75 | - <th scope="row"><?php esc_html_e( 'Reset Options', 'hide-metadata' ); ?></th> | |
| 76 | - <td> | |
| 77 | - <?php | |
| 78 | - echo '<input name="hide_metadata_options[reset]" id="hide_metadata_options[reset]" type="checkbox" value="1" class="hide_metadata_options[reset]" />' . esc_html__( 'Check to reset', 'hide-metadata' ); | |
| 79 | - ?> | |
| 80 | - <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'Caution: Reset all settings to default.', 'hide-metadata' ); ?>"></span> | |
| 81 | - </td> | |
| 82 | - </tr> | |
| 75 | + <th scope="row"><?php esc_html_e( 'Reset Options', 'hide-metadata' ); ?></th> | |
| 76 | + <td> | |
| 77 | + <?php | |
| 78 | + echo '<input name="hide_metadata_options[reset]" id="hide_metadata_options[reset]" type="checkbox" value="1" class="hide_metadata_options[reset]" />' . esc_html__( 'Check to reset', 'hide-metadata' ); | |
| 79 | + ?> | |
| 80 | + <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'Caution: Reset all settings to default.', 'hide-metadata' ); ?>"></span> | |
| 81 | + </td> | |
| 82 | + </tr> | |
| 83 | 83 | </tbody> |
| 84 | 84 | </table> |
| 85 | 85 | <?php submit_button( esc_html__( 'Save Changes', 'hide-metadata' ) ); ?> |
| 86 | 86 | </div><!-- .option-container --> |