PluginProbe
Easy Footnotes / 1.1.10
Easy Footnotes v1.1.10
trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.2 All 32 releases
easy-footnotes / easy-footnotes-admin.php

easy-footnotes-admin.php in Easy Footnotes 1.1.10, at easy-footnotes-admin.php

76 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin screen functionality for Easy Footnotes.
4 *
5 * @package easy-footnotes
6 */
7
8 $footnoteOptions = get_option( 'easy_footnotes_options' );
9
10 if ( isset( $_POST['easy_footnote_hidden'] ) ) {
11 // Check the nonce for the Reading Time.
12 check_admin_referer( 'easy_footnotes_settings_nonce' );
13
14 if ( 'Y' === $_POST['easy_footnote_hidden'] ) :
15 // Form data sent.
16 $easyFootnoteLabel = ( isset( $_POST['easy_footnotes_label'] ) ) ? sanitize_text_field( wp_unslash( $_POST['easy_footnotes_label'] ) ) : '';
17 $easyFootnoteCheck = isset( $_POST['easy_footnote_check'] ) ? true : false;
18 $hide_easy_footnote_after_posts = isset( $_POST['hide_easy_footnote_after_posts'] ) ? true : false;
19 $show_easy_footnote_on_front = isset( $_POST['show_easy_footnote_on_front'] ) ? true : false;
20 $reset_footnotes = isset( $_POST['reset_footnotes'] ) ? true : false;
21
22 $updateOptions = array(
23 'footnoteLabel' => sanitize_text_field( $easyFootnoteLabel ),
24 'useLabel' => $easyFootnoteCheck,
25 'hide_easy_footnote_after_posts' => $hide_easy_footnote_after_posts,
26 'show_easy_footnote_on_front' => $show_easy_footnote_on_front,
27 'reset_footnotes' => $reset_footnotes,
28 );
29
30 update_option( 'easy_footnotes_options', $updateOptions );
31 ?>
32 <div class="updated">
33 <p><strong><?php esc_html_e( 'Options saved.', 'easy-footnotes' ); ?></strong></p>
34 </div>
35 <?php
36 endif;
37 } else {
38 // Normal page display.
39 $easyFootnoteLabel = isset( $footnoteOptions['footnoteLabel'] ) ? esc_html( $footnoteOptions['footnoteLabel'] ) : __( 'Footnotes', 'easy-footnotes' );
40 $easyFootnoteCheck = isset( $footnoteOptions['useLabel'] ) ? $footnoteOptions['useLabel'] : false;
41 $hide_easy_footnote_after_posts = isset( $footnoteOptions['hide_easy_footnote_after_posts'] ) ? $footnoteOptions['hide_easy_footnote_after_posts'] : false;
42 $show_easy_footnote_on_front = isset( $footnoteOptions['show_easy_footnote_on_front'] ) ? $footnoteOptions['show_easy_footnote_on_front'] : false;
43 $reset_footnotes = isset( $footnoteOptions['reset_footnotes'] ) ? $footnoteOptions['reset_footnotes'] : false;
44 }
45 ?>
46
47 <div class="wrap">
48 <?php echo '<h2>' . esc_html__( 'Easy Footnotes Settings', 'easy-footnotes' ) . '</h2>'; ?>
49
50 <form name="easy_footnotes_form" method="post">
51 <input type="hidden" name="easy_footnote_hidden" value="Y">
52 <?php wp_nonce_field( 'easy_footnotes_settings_nonce' ); ?>
53 <?php echo '<h4>' . esc_html__( 'Easy Footnotes Settings', 'easy-footnotes' ) . '</h4>'; ?>
54 <p><?php esc_html_e( 'Want to add a label to your footnotes section at the bottom of your post? Just enter some text here and check the box and you\'re good to go.', 'easy-footnotes' ); ?></p>
55 <p><?php esc_html_e( 'Easy Footnotes Label: ', 'easy-footnotes' ); ?><input type="text" name="easy_footnotes_label" value="<?php echo esc_attr( $easyFootnoteLabel ); ?>" size="20"></p>
56
57 <p><?php esc_html_e( 'Insert Easy Footnotes Label: ', 'easy-footnotes' ); ?><input type="checkbox" name="easy_footnote_check" <?php checked( $easyFootnoteCheck ); ?> size="20"></p>
58
59 <p><?php esc_html_e( 'Hide Footnotes after post content: ', 'easy-footnotes' ); ?><input type="checkbox" name="hide_easy_footnote_after_posts" <?php checked( $hide_easy_footnote_after_posts ); ?> size="20"></p>
60
61 <p><?php esc_html_e( 'Reset Footnotes to avoid duplication after the content: ', 'easy-footnotes' ); ?><input type="checkbox" name="reset_footnotes" <?php checked( $reset_footnotes ); ?> size="20"></p>
62
63 <p id="easy_footnote_on_front"><?php esc_html_e( 'Show Footnotes on Front Page: ', 'easy-footnotes' ); ?><input type="checkbox" name="show_easy_footnote_on_front" <?php checked( $show_easy_footnote_on_front ); ?> size="20"></p>
64
65
66 <p class="submit">
67 <input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options', 'easy-footnotes' ); ?>" />
68 </p>
69 </form>
70
71 <div class="easy-footnotes-shortcode-hint">
72 <p><?php echo esc_html__( 'Shortcode: [efn_note]Insert your note here.[/efn_note]', 'easy-footnotes' ); ?></p>
73 </div>
74
75 </div>
76