| @@ -2,40 +2,20 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | * Page Name: Add New |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -use WPCoder\Dashboard\DashboardInitializer; | |
| 7 | 6 | use WPCoder\Dashboard\Field; |
| 8 | 7 | use WPCoder\Dashboard\Settings; |
| 9 | -use WPCoder\WPCoder; | |
| 8 | +use WPCoder\WOW_Plugin; | |
| 10 | 9 | |
| 11 | 10 | defined( 'ABSPATH' ) || exit; |
| 12 | 11 | |
| 13 | 12 | $default = Field::getDefault(); |
| 14 | 13 | |
| 15 | -$action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : ''; | |
| 16 | -$item_id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : ''; | |
| 17 | -$item_title = __( 'Add new code', 'wpcoder' ); | |
| 18 | -if ( $action === 'update' && ! empty( $item_id ) ) { | |
| 19 | - $item_title = __( 'Update code', 'wpcoder' ) . ' ID: ' . $item_id; | |
| 20 | -} elseif ( $action === 'duplicate' && ! empty( $item_id ) ) { | |
| 21 | - $item_title = __( 'Duplicate the code from', 'wpcoder' ) . ' ID: ' . $item_id; | |
| 22 | -} | |
| 23 | -$license_page = add_query_arg( ['page' => WPCoder::SLUG . '-license' ], admin_url( 'admin.php' ) ) | |
| 24 | 14 | ?> |
| 25 | 15 | |
| 26 | - <div class="wowp-header-wrapper"> | |
| 27 | - <?php DashboardInitializer::header(); ?> | |
| 16 | + <form action="" id="wowp-settings" class="wowp-settings" method="post"> | |
| 28 | 17 | |
| 29 | - <div class="wowp-header-title"> | |
| 30 | - <h2><?php echo esc_html( $item_title ); ?></h2> | |
| 31 | - | |
| 32 | - </div> | |
| 33 | - </div> | |
| 34 | - | |
| 35 | - | |
| 36 | - <form action="" id="wowp-settings" class="wowp-settings wowp-wrap" method="post"> | |
| 37 | - | |
| 38 | 18 | <div id="poststuff"> |
| 39 | 19 | <div id="post-body" class="metabox-holder columns-2"> |
| 40 | 20 | <div id="post-body-content"> |
| 41 | 21 | |
| @@ -42,10 +22,9 @@ | ||
| 42 | 22 | <div id="titlediv"> |
| 43 | 23 | |
| 44 | 24 | <div id="titlewrap"> |
| 45 | 25 | <label class="screen-reader-text" id="title-prompt-text" |
| 46 | - for="title"><?php esc_html_e( 'Enter title here', 'wpcoder' ); ?> | |
| 47 | - </label> | |
| 26 | + for="title"><?php esc_html_e( 'Enter title here', 'wpcoder' ); ?></label> | |
| 48 | 27 | <?php Field::text( 'title' ); ?> |
| 49 | 28 | </div> |
| 50 | 29 | |
| 51 | 30 | </div> |
| @@ -52,9 +31,9 @@ | ||
| 52 | 31 | </div> |
| 53 | 32 | |
| 54 | 33 | <!-- Sidebar with the setting--> |
| 55 | 34 | <div id="postbox-container-1" class="postbox-container"> |
| 56 | - <?php require_once plugin_dir_path( __FILE__ ) . 'sidebar.php'; ?> | |
| 35 | + <?php require_once plugin_dir_path(__FILE__) . 'sidebar.php';?> | |
| 57 | 36 | </div> |
| 58 | 37 | |
| 59 | 38 | <div id="postoptions"> |
| 60 | 39 | <div id="postbox-container-2" class="postbox-container wowp-settings-wrapper"> |
| @@ -66,9 +45,9 @@ | ||
| 66 | 45 | </div> |
| 67 | 46 | |
| 68 | 47 | <input type="hidden" name="tool_id" value="<?php echo absint( $default['id'] ); ?>" id="tool_id"/> |
| 69 | 48 | <input type="hidden" name="param[time]" value="<?php echo esc_attr( time() ); ?>"/> |
| 70 | - <?php wp_nonce_field( WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_settings' ); ?> | |
| 49 | + <?php wp_nonce_field( WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_settings' ); ?> | |
| 71 | 50 | |
| 72 | 51 | </form> |
| 73 | 52 | |
| 74 | 53 | |