| @@ -5,26 +5,44 @@ | ||
| 5 | 5 | |
| 6 | 6 | use WPCoder\Dashboard\Field; |
| 7 | 7 | |
| 8 | 8 | defined( 'ABSPATH' ) || exit; |
| 9 | + | |
| 10 | +$php_include = [ | |
| 11 | + 0 => __( 'Run where inserted', 'wp-coder' ), | |
| 12 | + 1 => __( 'Run only in admin area', 'wp-coder' ), | |
| 13 | + 2 => __( 'Run only on front-end', 'wp-coder' ), | |
| 14 | + 3 => __( 'Run everywhere', 'wp-coder' ), | |
| 15 | +] | |
| 9 | 16 | ?> |
| 10 | 17 | |
| 11 | - <h4> | |
| 12 | - <span class="codericon codericon-filetype-php"></span> | |
| 13 | - <?php esc_html_e( 'PHP Code', 'wpcoder' ); ?> | |
| 14 | - </h4> | |
| 18 | + <div class="wowp-settings__page"> | |
| 19 | + <div class="wowp-settings__page-sidebar"> | |
| 15 | 20 | |
| 16 | - <fieldset> | |
| 17 | - <div class="wowp-field is-full"> | |
| 21 | + <div class="wowp-field" data-option="php_include"> | |
| 22 | + <label> | |
| 23 | + <span class="label"> | |
| 24 | + <?php esc_html_e( 'Include PHP', 'wp-coder' ); ?> | |
| 25 | + <sup class="wowp-tooltip" data-tooltip="Define where this PHP code should run: by shortcode, in admin, front-end, or everywhere.">ℹ</sup> | |
| 26 | + </span> | |
| 27 | + <?php Field::select( 'php_include', null, $php_include ); ?> | |
| 28 | + </label> | |
| 29 | + </div> | |
| 30 | + | |
| 31 | + <button class="button-editor button" id="phpnav"><?php esc_html_e( 'Add NAV Comment', 'wp-coder' ); ?></button> | |
| 18 | 32 | <ol id="phpNavigationMenu" class="wowp-php-nav-menu"></ol> |
| 19 | - <button class="button-editor button" id="phpnav">Add NAV Comment</button> | |
| 33 | + | |
| 34 | + | |
| 20 | 35 | </div> |
| 21 | - </fieldset> | |
| 36 | + <div class="wowp-settings__page-content"> | |
| 22 | 37 | |
| 23 | -<?php Field::textarea( 'php_code' ); ?> | |
| 38 | + <?php Field::textarea( 'php_code' ); ?> | |
| 24 | 39 | |
| 25 | - <div class="wowp-notification -warning"> | |
| 26 | - Please input only the PHP content, omitting the <code>php</code> tag | |
| 40 | + <div class="wowp-notification notification-info"> | |
| 41 | + Just enter the PHP content. You don’t need to include <code><?php></code> — it’s already handled. | |
| 42 | + </div> | |
| 43 | + | |
| 44 | + </div> | |
| 27 | 45 | </div> |
| 28 | 46 | |
| 29 | 47 | <?php |
| 30 | 48 | |