Skip to content

Commit 2e81e89

Browse files
committed
improve receipt template editor
1 parent 54a8e88 commit 2e81e89

File tree

7 files changed

+520
-322
lines changed

7 files changed

+520
-322
lines changed

includes/Activator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public function single_activate(): void {
9797
)
9898
);
9999

100+
// Migrate templates on activation
101+
Templates\Defaults::run_migration();
102+
100103
// set the auto redirection on next page load
101104
// set_transient( 'woocommere_pos_welcome', 1, 30 );
102105
}
@@ -266,6 +269,7 @@ private function db_upgrade( $old, $current ): void {
266269
'0.4.6' => 'updates/update-0.4.6.php',
267270
'1.0.0-beta.1' => 'updates/update-1.0.0-beta.1.php',
268271
'1.6.1' => 'updates/update-1.6.1.php',
272+
'1.8.0' => 'updates/update-1.8.0.php',
269273
);
270274
foreach ( $db_updates as $version => $updater ) {
271275
if ( version_compare( $version, $old, '>' ) &&

includes/Admin/Menu.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,8 @@ private function register_pos_admin(): void {
145145
array( '\WCPOS\WooCommercePOS\Admin\Settings', 'display_settings_page' )
146146
);
147147

148-
add_submenu_page(
149-
PLUGIN_NAME,
150-
__( 'Templates', 'woocommerce-pos' ),
151-
__( 'Templates', 'woocommerce-pos' ),
152-
'manage_woocommerce_pos',
153-
'edit.php?post_type=wcpos_template'
154-
);
148+
// Note: Templates submenu is automatically added by the custom post type registration
149+
// with 'show_in_menu' => PLUGIN_NAME
155150

156151
// adjust submenu
157152
global $submenu;

0 commit comments

Comments
 (0)