|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Insert Code Snippets. |
| 4 | + * |
| 5 | + * @since 1.2.0 |
| 6 | + * @package InsertCodess |
| 7 | + */ |
| 8 | + |
| 9 | +defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 10 | + |
| 11 | +?> |
| 12 | + <div class="insertcodes-container"> |
| 13 | + <div class="wrap insertcodes-wrap"> |
| 14 | + <div class="insertcodes__header"> |
| 15 | + <h1 class="wp-heading-inline"> |
| 16 | + <?php esc_html_e( 'Insert Code Snippets', 'insert-codes' ); ?> |
| 17 | + </h1> |
| 18 | + <p><?php esc_html_e( 'Bellow are the code editor fields for inserting code snippets inside the functions.php file.', 'insert-codes' ); ?></p> |
| 19 | + </div> |
| 20 | + <hr class="wp-header-end"> |
| 21 | + <div class="insertcodes__body"> |
| 22 | + <div class="insertcodes__content"> |
| 23 | + <form id="insertcodes-form" method="post" action="<?php echo esc_html( admin_url( 'admin-post.php' ) ); ?>"> |
| 24 | + <div class="field-group filed-section"> |
| 25 | + <h3><?php esc_html_e( 'PHP Code Snippets', 'insert-codes' ); ?></h3> |
| 26 | + </div> |
| 27 | + <div class="field-group field-editor"> |
| 28 | + <div class="field-label"> |
| 29 | + <label for="insertcodes_php"><strong><?php esc_html_e( 'PHP Code Snippets:', 'insert-codes' ); ?></strong></label> |
| 30 | + </div> |
| 31 | + <div class="field"> |
| 32 | + <textarea type="text" name="insertcodes_php" id="insertcodes_php"><?php echo esc_textarea( get_option( 'insertcodes_php' ) ); ?></textarea> |
| 33 | + <p class="description"><?php esc_html_e( 'These scripts will be executed in the PHP context.', 'insert-codes' ); ?></p> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + <div class="field-group filed-section"> |
| 37 | + <h3><?php esc_html_e( 'Snippets Settings', 'insert-codes' ); ?></h3> |
| 38 | + </div> |
| 39 | + <div class="field-group"> |
| 40 | + <div class="field-label"> |
| 41 | + <strong><?php esc_html_e( 'Enable Snippets:', 'insert-codes' ); ?></strong> |
| 42 | + </div> |
| 43 | + <div class="field"> |
| 44 | + <label for="insertcodes_enable_snippets"> |
| 45 | + <input name="insertcodes_enable_snippets" id="insertcodes_enable_snippets" type="checkbox" value="yes" <?php checked( get_option( 'insertcodes_enable_snippets' ), 'yes' ); ?>> |
| 46 | + <?php esc_html_e( 'Enable php code snippet', 'insert-codes' ); ?> |
| 47 | + </label> |
| 48 | + <p class="description"><?php esc_html_e( 'Enabling this will execute the PHP code snippets.', 'insert-codes' ); ?></p> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + <div class="field-group"> |
| 52 | + <div class="field-label"> |
| 53 | + <label for="insertcodes_snippets_location"><strong><?php esc_html_e( 'Location:', 'insert-codes' ); ?></strong></label> |
| 54 | + </div> |
| 55 | + <div class="field"> |
| 56 | + <select name="insertcodes_snippets_location" id="insertcodes_snippets_location" class="regular-text"> |
| 57 | + <option value="everywhere" <?php selected( get_option( 'insertcodes_snippets_location' ), 'everywhere' ); ?>><?php esc_html_e( 'Everywhere', 'insert-codes' ); ?></option> |
| 58 | + <option value="admin_only" <?php selected( get_option( 'insertcodes_snippets_location' ), 'admin_only' ); ?>><?php esc_html_e( 'Admin only', 'insert-codes' ); ?></option> |
| 59 | + <option value="frontend_only" <?php selected( get_option( 'insertcodes_snippets_location' ), 'frontend_only' ); ?>><?php esc_html_e( 'Frontend only', 'insert-codes' ); ?></option> |
| 60 | + </select> |
| 61 | + <p class="description"><?php esc_html_e( 'Select where the code snippet should execute.', 'insert-codes' ); ?></p> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <div class="field-group is-last-item"> |
| 65 | + <input type="hidden" name="action" value="insertcodes_snippets"> |
| 66 | + <?php wp_nonce_field( 'insertcodes_snippets' ); ?> |
| 67 | + <div class="field-submit-btn"> |
| 68 | + <?php submit_button(); ?> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + </form> |
| 72 | + </div> |
| 73 | + <div class="insertcodes__aside aside__items"> |
| 74 | + <div class="aside__item"> |
| 75 | + <div class="aside__item__header"> |
| 76 | + <h4><?php esc_html_e( 'Support & Rating', 'insert-codes' ); ?></h4> |
| 77 | + </div> |
| 78 | + <div class="aside__item__body"> |
| 79 | + <ul> |
| 80 | + <li> |
| 81 | + <p> |
| 82 | + <?php esc_html_e( 'If you need help, please visit the support forum.', 'insert-codes' ); ?> |
| 83 | + <a href="https://wordpress.org/support/plugin/insert-codes/" target="_blank"><?php esc_html_e( 'Get Support', 'insert-codes' ); ?></a> |
| 84 | + </p> |
| 85 | + </li> |
| 86 | + <li> |
| 87 | + <p> |
| 88 | + <?php esc_html_e( 'If you like the plugin, please rate it on WordPress.org.', 'insert-codes' ); ?> |
| 89 | + <a href="https://wordpress.org/plugins/insert-codes/" target="_blank"><?php esc_html_e( 'Give a Rating', 'insert-codes' ); ?></a> |
| 90 | + </p> |
| 91 | + </li> |
| 92 | + </ul> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | +<?php |
0 commit comments